changeset 1:e78566595089

initial import
author mandel
date Mon, 11 May 2009 16:01:50 +0000
parents 36fb74dc547d
children ee8e70aca95e
files CMakeLists.txt Makefile build/core.makefile build/gui.makefile build/mkdir.bat build/opengl.makefile build/posix.makefile build/rm.d build/rm.exe build/svg.makefile build/windows.makefile changelog.txt common/qnativepointer.h cpp/qt_core/CMakeLists.txt cpp/qt_core/QModelIndex_shell.cpp cpp/qt_core/QPointF_shell.cpp cpp/qt_core/QPoint_shell.cpp cpp/qt_core/QSizeF_shell.cpp cpp/qt_core/QSize_shell.cpp cpp/qt_core/QString_shell.cpp cpp/qt_core/QVariant_shell.cpp cpp/qt_core/QVariant_shell.h cpp/qt_gui/CMakeLists.txt cpp/qt_opengl/CMakeLists.txt cpp/qt_qtd/ArrayOpsPrimitive_shell.cpp cpp/qt_qtd/CMakeLists.txt cpp/qt_qtd/qtd_core.cpp demos/interview/README demos/interview/build demos/interview/build.bat demos/interview/images/folder.png demos/interview/images/interview.png demos/interview/images/services.png demos/interview/main.d demos/interview/model.d examples/itemviews/dirview/build examples/itemviews/dirview/build.bat examples/itemviews/dirview/main.d examples/mainwindows/README examples/mainwindows/dockwidgets/build examples/mainwindows/dockwidgets/build.bat examples/mainwindows/dockwidgets/dockwidgets.pro examples/mainwindows/dockwidgets/dockwidgets.qrc examples/mainwindows/dockwidgets/images/new.png examples/mainwindows/dockwidgets/images/print.png examples/mainwindows/dockwidgets/images/save.png examples/mainwindows/dockwidgets/images/undo.png examples/mainwindows/dockwidgets/main.d examples/mainwindows/dockwidgets/mainwindow.d examples/mainwindows/mainwindows.pro examples/opengl/hellogl/build examples/opengl/hellogl/build.bat examples/opengl/hellogl/glwidget.d examples/opengl/hellogl/hellogl.pro examples/opengl/hellogl/main.d examples/opengl/hellogl/opengl/gl.d examples/opengl/hellogl/opengl/glfuncs.d examples/opengl/hellogl/opengl/gltypes.d examples/opengl/hellogl/opengl/glu.d examples/opengl/hellogl/window.d examples/tutorials/tutorial/t1/build examples/tutorials/tutorial/t1/build.bat examples/tutorials/tutorial/t1/main.d examples/tutorials/tutorial/t2/build examples/tutorials/tutorial/t2/build.bat examples/tutorials/tutorial/t2/main.d examples/tutorials/tutorial/t3/build examples/tutorials/tutorial/t3/build.bat examples/tutorials/tutorial/t3/main.d examples/tutorials/tutorial/t4/build examples/tutorials/tutorial/t4/build.bat examples/tutorials/tutorial/t4/main.d examples/tutorials/tutorial/t5/build examples/tutorials/tutorial/t5/build.bat examples/tutorials/tutorial/t5/main.d examples/tutorials/tutorial/t6/build examples/tutorials/tutorial/t6/build.bat examples/tutorials/tutorial/t6/main.d examples/widgets/analogclock/AnalogClock.d examples/widgets/analogclock/build examples/widgets/analogclock/main.d examples/widgets/calculator/build examples/widgets/calculator/build.bat examples/widgets/calculator/button.d examples/widgets/calculator/calculator.d examples/widgets/calculator/main.d generator/abstractmetabuilder.cpp generator/abstractmetabuilder.h generator/abstractmetalang.cpp generator/abstractmetalang.h generator/asttoxml.cpp generator/asttoxml.h generator/build_all.txt generator/build_core.txt generator/build_designer.bat generator/build_gui.txt generator/build_network.txt generator/build_opengl.txt generator/build_sql.txt generator/build_svg.txt generator/build_typesystem.txt generator/build_webkit.txt generator/build_xml.txt generator/build_xmlpatterns.txt generator/classlistgenerator.cpp generator/classlistgenerator.h generator/containergenerator.cpp generator/containergenerator.h generator/cppgenerator.cpp generator/cppgenerator.h generator/cppheadergenerator.cpp generator/cppheadergenerator.h generator/cppimplgenerator.cpp generator/cppimplgenerator.h generator/customtypes.cpp generator/customtypes.h generator/dgenerator.cpp generator/dgenerator.h generator/docparser.cpp generator/docparser.h generator/fileout.cpp generator/fileout.h generator/gen generator/gen.bat generator/generator.cpp generator/generator.h generator/generator.pri generator/generator.pro generator/generator.qrc generator/generator_pch.h generator/generatorset.cpp generator/generatorset.h generator/generatorsetd.cpp generator/generatorsetd.h generator/jumptable.cpp generator/jumptable.h generator/main.cpp generator/main.h generator/merge.xsl generator/metainfogenerator.cpp generator/metainfogenerator.h generator/metajava.cpp generator/metajava.h generator/metajavabuilder.cpp generator/metajavabuilder.h generator/parser/ast.cpp generator/parser/ast.h generator/parser/binder.cpp generator/parser/binder.h generator/parser/class_compiler.cpp generator/parser/class_compiler.h generator/parser/codemodel.cpp generator/parser/codemodel.h generator/parser/codemodel_finder.cpp generator/parser/codemodel_finder.h generator/parser/codemodel_fwd.h generator/parser/codemodel_pointer.h generator/parser/compiler_utils.cpp generator/parser/compiler_utils.h generator/parser/control.cpp generator/parser/control.h generator/parser/declarator_compiler.cpp generator/parser/declarator_compiler.h generator/parser/default_visitor.cpp generator/parser/default_visitor.h generator/parser/dumptree.cpp generator/parser/dumptree.h generator/parser/include/stdarg.h generator/parser/lexer.cpp generator/parser/lexer.h generator/parser/list.cpp generator/parser/list.h generator/parser/name_compiler.cpp generator/parser/name_compiler.h generator/parser/parser.cpp generator/parser/parser.h generator/parser/r++.macros generator/parser/rpp-allocator.h generator/parser/rpp/builtin-macros.cpp generator/parser/rpp/pp-cctype.h generator/parser/rpp/pp-configuration generator/parser/rpp/pp-engine-bits.h generator/parser/rpp/pp-engine.h generator/parser/rpp/pp-environment.h generator/parser/rpp/pp-fwd.h generator/parser/rpp/pp-internal.h generator/parser/rpp/pp-iterator.h generator/parser/rpp/pp-macro-expander.h generator/parser/rpp/pp-macro.h generator/parser/rpp/pp-main.cpp generator/parser/rpp/pp-qt-configuration generator/parser/rpp/pp-scanner.h generator/parser/rpp/pp-string.h generator/parser/rpp/pp-symbol.h generator/parser/rpp/pp.h generator/parser/rpp/preprocessor.cpp generator/parser/rpp/preprocessor.h generator/parser/rpp/rpp.pri generator/parser/rxx.pri generator/parser/rxx.pro generator/parser/rxx_allocator.h generator/parser/smallobject.cpp generator/parser/smallobject.h generator/parser/symbol.h generator/parser/tokens.cpp generator/parser/tokens.h generator/parser/type_compiler.cpp generator/parser/type_compiler.h generator/parser/visitor.cpp generator/parser/visitor.h generator/prigenerator.cpp generator/prigenerator.h generator/qdocgenerator.cpp generator/qdocgenerator.h generator/qtjambi_masterinclude.h generator/reporthandler.cpp generator/reporthandler.h generator/typeparser.cpp generator/typeparser.h generator/typesystem.cpp generator/typesystem.h generator/typesystem_core-common.xml generator/typesystem_core-java.java generator/typesystem_core-java.xml generator/typesystem_core.xml generator/typesystem_designer-common.xml generator/typesystem_designer-java.xml generator/typesystem_designer.xml generator/typesystem_gui-common.xml generator/typesystem_gui-java.java generator/typesystem_gui-java.xml generator/typesystem_gui.xml generator/typesystem_network-common.xml generator/typesystem_network-java.java generator/typesystem_network-java.xml generator/typesystem_network.xml generator/typesystem_opengl-common.xml generator/typesystem_opengl-java.java generator/typesystem_opengl-java.xml generator/typesystem_opengl.xml generator/typesystem_phonon-common.xml generator/typesystem_phonon-java.java generator/typesystem_phonon-java.xml generator/typesystem_phonon.xml generator/typesystem_sql-common.xml generator/typesystem_sql-java.java generator/typesystem_sql-java.xml generator/typesystem_sql.xml generator/typesystem_svg-common.xml generator/typesystem_svg-java.xml generator/typesystem_svg.xml generator/typesystem_webkit-common.xml generator/typesystem_webkit-java.java generator/typesystem_webkit-java.xml generator/typesystem_webkit.xml generator/typesystem_xml-common.xml generator/typesystem_xml-java.java generator/typesystem_xml-java.xml generator/typesystem_xml.xml generator/typesystem_xmlpatterns-common.xml generator/typesystem_xmlpatterns-java.java generator/typesystem_xmlpatterns-java.xml generator/typesystem_xmlpatterns.xml generator/uiconverter.cpp generator/uiconverter.h include/ArrayOpsPrimitive.h include/QObjectEntity.h include/qtd_core.h lib/glu32.lib lib/opengl32.lib mini/test1/build mini/test1/build.bat mini/test1/main.d qt/CMakeLists.txt qt/QGlobal.d qt/QObjectDefs.d qt/QtDObject.d qt/Signal.d qt/boost-license-1.0.txt qt/core/CMakeLists.txt qt/core/QModelIndex.d qt/core/QPoint.d qt/core/QPointF.d qt/core/QSize.d qt/core/QSizeF.d qt/core/QString.d qt/core/QVariant.d qt/d1/Signal.d qt/d2/Signal.d qt/opengl/gl.d qt/opengl/glfuncs.d qt/opengl/gltypes.d qt/opengl/glu.d qt/qtd/Array.d qt/qtd/ArrayOpsPrimitive.d qt/qtd/CMakeLists.txt qt/qtd/Str.d tools/duic/CMakeLists.txt tools/duic/customwidgetsinfo.cpp tools/duic/customwidgetsinfo.h tools/duic/d/dextractimages.cpp tools/duic/d/dextractimages.h tools/duic/d/dwritedeclaration.cpp tools/duic/d/dwritedeclaration.h tools/duic/d/dwriteicondata.cpp tools/duic/d/dwriteicondata.h tools/duic/d/dwriteicondeclaration.cpp tools/duic/d/dwriteicondeclaration.h tools/duic/d/dwriteiconinitialization.cpp tools/duic/d/dwriteiconinitialization.h tools/duic/d/dwriteincludes.cpp tools/duic/d/dwriteincludes.h tools/duic/d/dwriteinitialization.cpp tools/duic/d/dwriteinitialization.h tools/duic/databaseinfo.cpp tools/duic/databaseinfo.h tools/duic/driver.cpp tools/duic/driver.h tools/duic/globaldefs.h tools/duic/main.cpp tools/duic/option.h tools/duic/qclass_lib_map.h tools/duic/tests/helloworld.ui tools/duic/tests/mainwindow.ui tools/duic/tests/ui_helloworld.d tools/duic/tests/ui_mainwindow.d tools/duic/treewalker.cpp tools/duic/treewalker.h tools/duic/ui4.cpp tools/duic/ui4.h tools/duic/uic.cpp tools/duic/uic.h tools/duic/utils.h tools/duic/validator.cpp tools/duic/validator.h
diffstat 335 files changed, 105271 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/CMakeLists.txt	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,26 @@
+PROJECT(qtd CXX C)
+cmake_minimum_required(VERSION 2.6)
+FIND_PACKAGE(Qt4 REQUIRED)
+# Using Tango
+
+#set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/cmaked)
+#set(CMAKE_D_USE_TANGO True)
+
+include_directories(${QT_INCLUDES} include)
+
+IF(CMAKE_HOST_WIN32)
+    INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/cpp/qt_core/local.cmake)
+    INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/cpp/qt_gui/local.cmake)
+    INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/cpp/qt_opengl/local.cmake)
+#    INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/cpp/qt_qtd/local.cmake)
+    ADD_LIBRARY(qtd_cpp SHARED ${QT_QTD_SRCS} ${QT_CORE_SRCS} ${QT_GUI_SRCS})
+    TARGET_LINK_LIBRARIES( qtd_cpp ${QT_LIBRARIES} )
+ELSE(CMAKE_HOST_WIN32)
+    ADD_SUBDIRECTORY(cpp/qt_core bin)
+    ADD_SUBDIRECTORY(cpp/qt_gui bin)
+    ADD_SUBDIRECTORY(cpp/qt_opengl bin)
+    ADD_SUBDIRECTORY(cpp/qt_qtd bin)
+ENDIF(CMAKE_HOST_WIN32)
+
+#ADD_SUBDIRECTORY(qt bin)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Makefile	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,210 @@
+## TODO: CPP_SHARED is very experemental on posix.
+## TODO: "make clean" don`t work as expected.
+## TODO: add target "install"
+## TODO: delete 'lib' prefix from output library name under windows.
+
+## Read variable from shell.
+export QTDIR
+export QTDIR_INC
+export QTDIR_LIB
+## End. Read variable from shell.
+
+## Try identify system.
+ifeq ($(MAKE), mingw32-make) # TODO: add another system.
+SYSTEM = windows
+endif
+ifndef SYSTEM
+SYSTEM = posix
+endif
+## End, Try identify system.
+
+## Load system specify settings.
+include build/$(SYSTEM).makefile
+
+## Main settings.
+## D compiler.
+ifndef $(DC)
+DC = dmd
+endif
+## C++ compiler.
+ifndef $(CC)
+CC = g++
+endif
+## Archiver.
+ifndef $(AR)
+AR = ar
+endif
+## Set default target.
+ifndef $(BUILD_TYPE)
+BUILD_TYPE = release
+endif
+
+## Tmp path.
+ifndef $(TMP_PATH)
+TMP_PATH_ = tmp
+TMP_PATH = $(TMP_PATH_)$(SL)$(BUILD_TYPE)
+endif
+## Output path.
+ifndef $(OUTPUT_PATH)
+OUTPUT_PATH = lib
+endif
+## Prefix for lib name.
+ifndef $(NAME_PREFIX)
+NAME_PREFIX = qtd
+endif
+ifndef $(PACKAGES)
+PACKAGES = core gui
+endif
+LIB_PREFIX = lib
+CC_INCLUDE += include $(QTDIR_INC) $(QTDIR_INC)$(SL)Qt $(QTDIR_INC)$(SL)QtCore $(QTDIR_INC)$(SL)QtGui $(QTDIR_INC)$(SL)QtOpenGL $(QTDIR_INC)$(SL)QtSvg
+D_INCLUDE +=
+CC_LFLAGS += -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -Wl,-s -mthreads
+CC_CFLAGS +=
+D_CFLAGS +=
+CC_LIB_PATH += $(QTDIR_LIB) $(TMP_PATH)
+D_LIB_PATH += $(TMP_PATH)
+
+## D target
+ifndef D_TARGET
+D_TARGET = d1-tango
+endif
+ifeq ($(D_TARGET), d1-tango)
+D_VERSION = 1
+else
+D_VERSION = 2
+endif
+
+#End. Main settings.
+
+## Flags for debug version.
+ifeq ($(BUILD_TYPE), debug)
+CC_CFLAGS += -O0
+D_CFLAGS += -debug -g -gc
+LIB_POSTFIX = d
+else ifeq ($(BUILD_TYPE), release)
+## End. Flags for debug version.
+## Flags for release version
+CC_CFLAGS += -O
+D_CFLAGS += -O -release -inline
+endif
+## End. Flags for release version.
+
+## Load classes list.
+## param 1 - package name.
+define MODULE_template
+    include build/$(1).makefile
+    qt_$(1)_lib_name = $$(qt_$(1)_name)$(QT_LIB_POSTFIX)
+    $(1)_cpp_files += $$($(1)_classes:%=cpp/qt_$(1)/%_shell.cpp)
+    $(1)_cpp_obj_files = $$($(1)_cpp_files:cpp/%.cpp=$(TMP_PATH)/%.o)
+    $(1)_d_files += $$($(1)_classes:%=qt/$(1)/%.d)
+endef
+$(foreach package,$(PACKAGES),$(eval $(call MODULE_template,$(package))))
+## End. Load classes list
+
+## DMD compile template bug fix
+ifeq ($(DC), dmd)
+NOT_SEPARATE_D_OBJ = true
+endif
+
+
+## CPP_SHARED options.
+ifeq ($(CPP_SHARED), true)
+CC_CFLAGS += -DCPP_SHARED
+GEN_OPT   += --cpp_shared
+endif
+## End. CPP_SHARED options.
+
+all: dgen build
+
+windows:
+	$(MAKE) SYSTEM=windows
+
+posix:
+	$(MAKE) SYSTEM=posix
+
+release: all
+
+debug:
+	$(MAKE) BUILD_TYPE=debug
+
+build: mkdir $(PACKAGES)
+
+## DGenerator
+make_gen:
+	cd generator && qmake && $(MAKE)
+
+dgen:  make_gen
+	cd generator && $(GEN) $(GEN_OPT) --d-target=$(D_TARGET) --output-directory=../ qtjambi_masterinclude.h build_opengl.txt
+## DGenerator ## end
+
+mkdir:
+	@$(MKDIR) $(TMP_PATH_)
+	@$(MKDIR) $(TMP_PATH)
+	@$(MKDIR) $(TMP_PATH)$(SL)qt_qtd
+	@$(MKDIR) $(TMP_PATH)$(SL)qtd
+	@$(MKDIR) $(OUTPUT_PATH)
+
+## Build cpp files.
+$(TMP_PATH)/%.o: cpp/%.cpp
+	$(CC) $(CC_CFLAGS) $(CC_INCLUDE:%=-I%) -c $(@:$(TMP_PATH)/%.o=cpp/%.cpp) -o$@
+
+## Build d files.
+$(TMP_PATH)/%_d.o: qt/%.d
+	$(DC) $(D_CFLAGS) -c $(@:$(TMP_PATH)/%_d.o=qt/%.d) -of$@
+
+## Build package.
+## param 1 - package name.
+define BUILD_template
+    ## mkdir
+    mkdir_$(1):
+	    @$(MKDIR) $(TMP_PATH)$(SL)qt_$(1)
+	    @$(MKDIR) $(TMP_PATH)$(SL)$(1)
+    ## End. mkdir
+    ## Build d part.
+    ifeq ($(NOT_SEPARATE_D_OBJ), true)
+    ## DMD compile template bug fix
+    $(1)_D_RULE =$(TMP_PATH)/$(1)_dobj.$(D_OBJ_EXT)
+    $$($(1)_D_RULE):
+	    $(DC) $(D_CFLAGS) $(D_INCLUDE) -c $$($(1)_d_files) -of$$($(1)_D_RULE)
+    else
+    $(1)_D_RULE = $$($(1)_d_files:qt/%.d=$(TMP_PATH)/%_d.o)
+    endif
+    ## End. Build d part.
+    ## Build cpp part.
+    ifeq ($(CPP_SHARED), true)
+    ifeq ($(SYSTEM), windows)
+    $(1)_CPP_DYN_LIB = $(OUTPUT_PATH)$(SL)$(LIB_PREFIX)$(NAME_PREFIX)$(1)$(LIB_POSTFIX).$(DYN_LIB_EXT)
+    $$($(1)_CPP_DYN_LIB): $$($(1)_cpp_obj_files)
+	    $(CC) $(CC_LFLAGS) -shared $$($(1)_cpp_obj_files) -o $$($(1)_CPP_DYN_LIB) $(CC_LIB_PATH:%=-L%) -l$(qt_$(1)_lib_name) $$($(1)_link_cpp:%=-l%) -Wl,--out-implib,$(TMP_PATH)\$(LIB_PREFIX)$(NAME_PREFIX)$(1)_cpp.a
+    $(1)_CPP_RULE = $(TMP_PATH)\cpp_$(1).$(LIB_EXT)
+    $$($(1)_CPP_RULE): $$($(1)_CPP_DYN_LIB)
+	    $(IMPLIB) $$($(1)_CPP_RULE) $$($(1)_CPP_DYN_LIB)
+    else ## CPP_SHARED != true
+    $(1)_CPP_RULE = $(OUTPUT_PATH)$(SL)$(LIB_PREFIX)$(NAME_PREFIX)$(1)$(LIB_POSTFIX).$(DYN_LIB_EXT)
+    $$($(1)_CPP_RULE): $$($(1)_cpp_obj_files)
+	    $(CC) $(CC_LFLAGS) $(QTDIR_LIB)/$(LIB_PREFIX)$(qt_$(1)_name).$(DYN_LIB_EXT) $$($(1)_link_cpp:%=-l%) $$($(1)_cpp_obj_files) -o $$($(1)_CPP_RULE)
+    endif ## CPP_SHARED
+    DELETE_FILES += $$($(1)_CPP_DYN_LIB) $$($(1)_cpp_obj_files) $(TMP_PATH)\$(LIB_PREFIX)$(NAME_PREFIX)$(1)_cpp.a
+    else
+    $(1)_CPP_RULE = $$($(1)_cpp_obj_files)
+    endif
+    ## End. Build cpp part.
+
+    DELETE_FILES += $$($(1)_D_RULE) $$($(1)_CPP_RULE) $(OUTPUT_PATH)/$(LIB_PREFIX)$$(qt_$(1)_name)D.$(LIB_EXT)
+    ## Implib link.
+    $(1)_LIB = $(OUTPUT_PATH)$(SL)$(LIB_PREFIX)$(NAME_PREFIX)$(1)$(LIB_POSTFIX).$(LIB_EXT)
+    ifeq ($(SYSTEM), windows)
+    $$($(1)_LIB): $$($(1)_D_RULE) $$($(1)_CPP_RULE)
+	    $(DC) $$($(1)_D_RULE) $$($(1)_CPP_RULE) $(D_LIB_PATH:%=-L-L%) $$($(1)_link_d:%=-L-l%) -lib -of$$($(1)_LIB)
+    else
+    $$($(1)_LIB): $$($(1)_D_RULE) $$($(1)_CPP_RULE)
+	    $(AR) rcs $$($(1)_LIB) $$($(1)_D_RULE) $$($(1)_CPP_RULE)
+    endif
+    # End. Implib link.
+    $(1): mkdir_$(1) $$($(1)_LIB)
+endef
+$(foreach package,$(PACKAGES),$(eval $(call BUILD_template,$(package))))
+## End. Build package.
+
+clean:
+	@$(RM) $(DELETE_FILES)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/build/core.makefile	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,65 @@
+ifeq ($(D_VERSION), 1)
+D_PATH = d1
+else
+D_PATH = d2
+endif
+
+##--------------------------
+QTD_CORE += QGlobal qtd/Str core/Qt qtd/ArrayOpsPrimitive QtDObject Signal $(D_PATH)/Signal
+##--------------------------
+
+## Qt Lib name.
+qt_core_name = QtCore
+
+## Libraries linked to the cpp part (is active only when  CPP_SHARED == true).
+core_link_cpp += 
+
+## Libraries linked to the d part (is active only when  CPP_SHARED == true)..
+core_link_d += 
+
+## Module specific cpp files.
+core_cpp_files += cpp/qt_qtd/qtd_core.cpp cpp/qt_qtd/ArrayOpsPrimitive_shell.cpp
+
+## Module specific d files.
+core_d_files += $(QTD_CORE:%=qt/%.d)
+
+## Classes.
+## TODO: use list that genareted by dgen.
+core_classes =  \
+	ArrayOps \
+	QChildEvent \
+	QCoreApplication \
+	QEvent \
+	QEventLoop \
+	QObject \
+	QTimerEvent \
+	QTranslator \
+	QPoint \
+    QPointF \
+    QRect \
+    QRectF \
+    QByteArray \
+	QLocale \
+	QSize \
+	QSizeF \
+	QDataStream \
+    QLine \
+    QLineF \
+	QMimeData \
+	QIODevice \
+	QDateTime \
+	QDate \
+	QTime \
+	QVariant \
+	QBitArray \
+	QRegExp \
+	QUrl \
+	QModelIndex \
+	QAbstractItemModel \
+	QAbstractFileEngine \
+	QFile \
+	QDir \
+	QFileInfo \
+	QTextStream \
+	QString \
+	QTimer 
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/build/gui.makefile	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,228 @@
+## Qt Lib name.
+qt_gui_name = QtGui
+
+## Libraries linked to the cpp part (is active only when  CPP_SHARED == true).
+gui_link_cpp += qtdcore_cpp $(qt_core_lib_name)
+
+## Libraries linked to the d part (is active only when  CPP_SHARED == true)..
+gui_link_d += qtdcore
+
+## Module specific cpp files.
+gui_cpp_files += 
+
+## Module specific d files.
+gui_d_files += 
+
+## Classes.
+## TODO: use list that generated by dgen.
+gui_classes = \
+    ArrayOps \
+	QPushButton \
+	QFileIconProvider \
+	QPaintDevice \
+	QPicture \
+	QPixmap \
+	QImage \
+	QBitmap \
+	QStyle \
+	QStyleOption \
+	QDesktopWidget \
+	QMenu \
+	QAction \
+	QDropEvent \
+	QInputContext \
+	QWidget \
+	QApplication \
+	QIcon \
+	QIconEngine \
+	QPalette \
+	QSizePolicy \
+	QRegion \
+	QFontMetrics \
+	QCursor \
+	QFont \
+	QClipboard \
+	QSessionManager \
+	QPainterPath  \
+	QPainterPath_Element \
+	QPaintEvent \
+	QTransform \
+	QMatrix \
+	QPainter \
+	QDragLeaveEvent \
+	QPolygon \
+	QInputEvent \
+	QDragEnterEvent \
+	QKeyEvent \
+	QHideEvent \
+	QWheelEvent \
+	QMoveEvent \
+	QActionGroup \
+	QActionEvent \
+	QFocusEvent \
+	QIconEngineV2 \
+	QFontInfo \
+	QStyleHintReturn \
+	QColor \
+	QDragMoveEvent \
+	QStyleOptionMenuItem \
+	QTabletEvent \
+	QShowEvent \
+	QResizeEvent \
+	QBrush \
+	QInputMethodEvent \
+	QContextMenuEvent \
+	QStyleOptionComplex \
+	QMouseEvent \
+	QHelpEvent \
+	QTextFormat \
+	QKeySequence \
+	QCloseEvent \
+	QGradient \
+	QTextItem \
+	QTextOption \
+	QPolygonF \
+	QPen \
+	QTextCharFormat \
+	QTextListFormat \
+	QTextTableFormat \
+	QTextLength \
+	QTextFrameFormat \
+	QTextTableCellFormat \
+	QTextBlockFormat \
+	QTextImageFormat \
+	QFrame \
+	QLabel \
+	QAbstractButton \
+	QMovie \
+	QCheckBox \
+	QRadioButton \
+	QToolButton \
+	QStyleOptionButton \
+	QStyleOptionToolButton \
+	QStyleOptionToolBar \
+	QStyleOptionToolBox \
+	QStyleOptionToolBoxV2 \
+	QStyleOptionSlider \
+	QStyleOptionViewItem \
+	QStyleOptionHeader \
+	QStyleOptionDockWidget \
+	QStyleOptionTab \
+	QButtonGroup \
+	QLCDNumber \
+	QAbstractSlider \
+	QDial \
+	QSlider \
+	QScrollBar \
+	QPaintEngine \
+	QSpacerItem \
+	QLayout \
+	QLayoutItem \
+	QPaintEngineState \
+	QBoxLayout \
+	QHBoxLayout \
+	QVBoxLayout \
+	QFormLayout \
+	QGridLayout \
+	QStackedLayout \
+	QAbstractScrollArea \
+	QAbstractItemDelegate \
+	QAbstractItemView \
+	QTreeView \
+	QTableView \
+	QListView \
+	QHeaderView \
+	QItemSelection \
+	QItemSelectionModel \
+	QItemSelectionRange \
+	QDirModel \
+	QSplitter \
+	QSplitterHandle \
+	QListWidget \
+	QListWidgetItem \
+	QMainWindow \
+	QMenuBar \
+	QToolBar \
+	QMessageBox \
+	QDockWidget \
+	QDialog \
+	QStatusBar \
+	QTabWidget \
+	QTabBar \
+	QImageIOHandler \
+	QImageReader \
+	QTextFrame_iterator \
+	QTextBlock_iterator \
+	QPrinter \
+	QTextLine \
+	QTextEdit \
+	QTextCursor \
+	QTextFrame \
+	QTextObject \
+	QTextBlock \
+	QTextDocument \
+	QPrinterInfo \
+	QTextList \
+	QTextLayout \
+	QTextBlockUserData \
+	QTextDocumentFragment \
+	QTextTable \
+	QAbstractTextDocumentLayout \
+	QTextBlockGroup \
+	QTextObjectInterface \
+	QTextInlineObject \
+	QAbstractTextDocumentLayout_PaintContext \
+	QTextLayout_FormatRange \
+	QTextFragment \
+	QTextTableCell \
+	QPrintEngine \
+	QStyleOptionTabWidgetFrame \
+	QComboBox \
+	QValidator \
+	QCompleter \
+	QLineEdit \
+	QStyleOptionComboBox \
+	QStyleOptionFrame \
+	QFileDialog \
+	QAbstractProxyModel \
+	QGraphicsItem \
+	QGraphicsItemGroup \
+	QGraphicsWidget \
+	QGraphicsLayout \
+	QGraphicsScene \
+	QGraphicsSimpleTextItem \
+	QGraphicsRectItem \
+	QGraphicsPolygonItem \
+	QGraphicsPixmapItem \
+	QGraphicsPathItem \
+	QGraphicsLineItem \
+	QGraphicsEllipseItem \
+	QGraphicsLayoutItem \
+	QAbstractGraphicsShapeItem \
+	QGraphicsTextItem \
+	QGraphicsProxyWidget \
+	QGraphicsSceneEvent \
+	QGraphicsSceneWheelEvent \
+	QGraphicsSceneContextMenuEvent \
+	QGraphicsSceneMouseEvent \
+	QGraphicsSceneResizeEvent \
+	QStyleOptionGraphicsItem \
+	QGraphicsSceneMoveEvent \
+	QGraphicsSceneHoverEvent \
+	QGraphicsSceneDragDropEvent \
+	QGraphicsSceneHelpEvent \
+    QGraphicsView \
+    QTableWidgetSelectionRange \
+    QStandardItem \
+    QUndoStack \
+    QTreeWidgetItem \
+    QTreeWidget \
+    QTextEdit_ExtraSelection \
+    QTableWidgetItem \
+    QTableWidget \
+    QTextOption_Tab \
+    QMdiSubWindow \
+    QInputMethodEvent_Attribute \
+    QMdiArea \
+    QUndoCommand \
+    QStandardItemModel
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/build/mkdir.bat	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,4 @@
+@echo off
+IF EXIST %1 GOTO exit
+MKDIR %1
+:exit
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/build/opengl.makefile	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,19 @@
+##QTD_OPENGL += opengl/QGL opengl/gl opengl/glu opengl/glfuncs opengl/gltypes
+
+## Qt Lib name.
+qt_opengl_name = QtOpenGL
+
+## Libraries linked to the cpp part (is active only when  CPP_SHARED == true).
+## TODO: Add linux support.
+opengl_link_cpp += qtdcore_cpp $(qt_core_lib_name) $(qt_gui_lib_name)
+
+## Libraries linked to the d part (is active only when  CPP_SHARED == true)..
+opengl_link_d += qtdcore
+
+## Classes.
+## TODO: use list that generated by dgen.
+opengl_classes = \
+	QGLWidget \
+	QGLContext \
+	QGLFormat \
+	QGLColormap
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/build/posix.makefile	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,26 @@
+SYSTEM = posix
+ifndef QTDIR
+#QTDIR = /usr/share/qt4
+ifndef QTDIR_INC
+QTDIR_INC = /usr/include/qt4
+endif
+ifndef QTDIR_LIB
+QTDIR_LIB = /usr/lib
+endif
+else
+ifndef QTDIR_INC
+QTDIR_INC = $(QTDIR)/include
+endif
+ifndef QTDIR_LIB
+QTDIR_LIB = $(QTDIR)/lib
+endif
+endif
+LIB_EXT = a
+DYN_LIB_EXT = so
+D_OBJ_EXT = o
+LIB_NAME_PREFIX = lib
+GEN = ./generator
+MKDIR = mkdir -p
+RM = rm -f
+SL = /
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/build/rm.d	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,23 @@
+ import tango.io.FilePath;
+ import tango.io.Stdout;
+ import tango.text.Util;
+ void main (char[][] args)
+ {
+     foreach(arg; args[1..$])
+     {
+	 try
+	 {
+	    auto a = replace(arg,'\\','/');
+	    auto file = new FilePath(arg);
+	    if (file.exists())
+	    {
+		file.remove();
+		Stdout.format("'{}' removed", arg).newline;
+	    }
+	 }
+	 catch
+	 {
+	     Stdout.format("Error: '{}' don`t removed", arg).newline;
+	 }
+     }
+ }
Binary file build/rm.exe has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/build/svg.makefile	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,20 @@
+## Qt Lib name.
+qt_svg_name = QtSvg
+
+## Libraries linked to the cpp part (is active only when  CPP_SHARED == true).
+svg_link_cpp += qtdcore_cpp $(qt_core_lib_name) $(qt_gui_lib_name)
+
+## Libraries linked to the d part (is active only when  CPP_SHARED == true)..
+svg_link_d += qtdcore
+
+## Module specific cpp files.
+svg_cpp_files += 
+
+## Module specific d files.
+svg_d_files += 
+
+## Classes.
+## TODO: use list that generated by dgen.
+svg_classes = \
+	QSvgWidget \
+	QSvgRenderer
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/build/windows.makefile	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,31 @@
+SYSTEM = windows
+ifndef QTDIR
+QTDIR = J:\Qt\2009.02\qt
+endif
+IMPLIB = implib /system /PAGESIZE:32
+LIB_EXT = lib
+DYN_LIB_EXT = dll
+D_OBJ_EXT = obj
+LIB_NAME_PREFIX =
+LIB_LINK = mingw32 qtmain
+BIN_EXT = .exe
+GEN = release\generator$(BIN_EXT)
+MKDIR = build\mkdir.bat
+RM = build\rm.exe
+SL = \\
+
+CC_LFLAGS += -Wl -Wl,-subsystem,windows
+
+ifndef QTDIR_INC
+QTDIR_INC = $(QTDIR)\include
+endif
+
+ifndef QTDIR_LIB
+QTDIR_LIB = $(QTDIR)\lib
+endif
+
+## Force CPP_SHARED on windows
+ifeq ($(SYSTEM), windows)
+CPP_SHARED = true
+endif
+QT_LIB_POSTFIX = 4
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/changelog.txt	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,7 @@
+changes since 0.1
+
+ * lots of bugs fixed
+ * brand new signals implementation by Max Samukha
+ * switch to Qt 4.5
+ * all imports inside Qt are public to avoid import hell
+ * API dealing with containers is now wrapped
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/qnativepointer.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#ifndef QNATIVEPOINTER_H
+#define QNATIVEPOINTER_H
+
+// Make sure this in sync with QNativePointer.java's enum Type
+enum PointerType {
+    BooleanType         = 0,
+    ByteType            = 1,
+    CharType            = 2,
+    ShortType           = 3,
+    IntType             = 4,
+    LongType            = 5,
+    FloatType           = 6,
+    DoubleType          = 7,
+    PointerType         = 8,
+    StringType          = 9
+};
+
+#endif // QNATIVEPOINTER_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpp/qt_core/CMakeLists.txt	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,41 @@
+PROJECT(QT_CORE_CPP CXX)
+# source files
+
+SET(QT_CORE_SRCS
+QChildEvent_shell.cpp
+QCoreApplication_shell.cpp
+QEvent_shell.cpp
+QEventLoop_shell.cpp
+QObject_shell.cpp
+QTimerEvent_shell.cpp
+QTranslator_shell.cpp
+QRect_shell.cpp
+QPoint_shell.cpp
+QByteArray_shell.cpp
+QLocale_shell.cpp
+QSize_shell.cpp
+QSizeF_shell.cpp
+QDataStream_shell.cpp
+QMimeData_shell.cpp
+QIODevice_shell.cpp
+QPointF_shell.cpp
+QRectF_shell.cpp
+QDateTime_shell.cpp
+QDate_shell.cpp
+QTime_shell.cpp
+QVariant_shell.cpp
+QBitArray_shell.cpp
+QRegExp_shell.cpp
+QUrl_shell.cpp
+QModelIndex_shell.cpp
+QAbstractItemModel_shell.cpp
+QAbstractFileEngine_shell.cpp
+QFile_shell.cpp
+QDir_shell.cpp
+QFileInfo_shell.cpp
+QTextStream_shell.cpp
+QString_shell.cpp
+QTimer_shell.cpp
+)
+
+ADD_LIBRARY(qt_core_cpp STATIC ${QT_CORE_SRCS})
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpp/qt_core/QModelIndex_shell.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,196 @@
+#include <QVariant>
+#include <qabstractitemmodel.h>
+#include <qvariant.h>
+
+#include <qabstractitemmodel.h>
+
+#include "qtd_core.h"
+
+extern "C" DLL_PUBLIC void __qtd_QModelIndex_destructor(void *ptr)
+{
+    delete (QModelIndex *)ptr;
+}
+
+// ---externC---
+// QModelIndex::QModelIndex()
+extern "C" DLL_PUBLIC void* __qtd_QModelIndex_QModelIndex
+()
+{
+    QModelIndex *__qt_this = new QModelIndex();
+    return (void *) __qt_this;
+
+}
+
+// QModelIndex::QModelIndex(const QModelIndex & other)
+extern "C" DLL_PUBLIC void* __qtd_QModelIndex_QModelIndex_QModelIndex
+(QModelIndex other0)
+{
+    QModelIndex *__qt_this = new QModelIndex((const QModelIndex& )other0);
+    return (void *) __qt_this;
+
+}
+
+// QModelIndex::child(int row, int column) const
+extern "C" DLL_PUBLIC QModelIndex __qtd_QModelIndex_child_int_int
+(void* __this_nativeId,
+ int row0,
+ int column1)
+{
+    QModelIndex *__qt_this = (QModelIndex *) __this_nativeId;
+    QModelIndex  __qt_return_value = __qt_this->child((int )row0, (int )column1);
+
+
+    return __qt_return_value;
+}
+
+// QModelIndex::column() const
+extern "C" DLL_PUBLIC int __qtd_QModelIndex_column
+(void* __this_nativeId)
+{
+    QModelIndex *__qt_this = (QModelIndex *) __this_nativeId;
+    int  __qt_return_value = __qt_this->column();
+
+    int __java_return_value = __qt_return_value;
+
+    return __java_return_value;
+}
+
+// QModelIndex::data(int role) const
+extern "C" DLL_PUBLIC void* __qtd_QModelIndex_data_int
+(void* __this_nativeId,
+ int role0)
+{
+    QModelIndex *__qt_this = (QModelIndex *) __this_nativeId;
+    QVariant  __qt_return_value = __qt_this->data((int )role0);
+
+    QVariant *__java_return_value = new QVariant(__qt_return_value);
+
+    return __java_return_value;
+}
+
+// QModelIndex::flags() const
+extern "C" DLL_PUBLIC int __qtd_QModelIndex_flags
+(void* __this_nativeId)
+{
+    QModelIndex *__qt_this = (QModelIndex *) __this_nativeId;
+    int  __qt_return_value = __qt_this->flags();
+
+    int __java_return_value = __qt_return_value;
+
+    return __java_return_value;
+}
+
+// QModelIndex::internalId() const
+extern "C" DLL_PUBLIC qint64 __qtd_QModelIndex_internalId
+(void* __this_nativeId)
+{
+    QModelIndex *__qt_this = (QModelIndex *) __this_nativeId;
+    qint64  __qt_return_value = __qt_this->internalId();
+
+    qint64 __java_return_value = __qt_return_value;
+
+    return __java_return_value;
+}
+
+// QModelIndex::internalPointer() const
+extern "C" DLL_PUBLIC void* __qtd_QModelIndex_internalPointer
+(void* __this_nativeId)
+{
+    QModelIndex *__qt_this = (QModelIndex *) __this_nativeId;
+    void*  __qt_return_value = __qt_this->internalPointer();
+
+    void* __java_return_value = (void*) __qt_return_value;// qtjambi_from_cpointer
+
+    return __java_return_value;
+}
+
+// QModelIndex::isValid() const
+extern "C" DLL_PUBLIC bool __qtd_QModelIndex_isValid
+(void* __this_nativeId)
+{
+    QModelIndex *__qt_this = (QModelIndex *) __this_nativeId;
+    bool  __qt_return_value = __qt_this->isValid();
+
+    bool __java_return_value = __qt_return_value;
+
+    return __java_return_value;
+}
+
+// QModelIndex::model() const
+extern "C" DLL_PUBLIC void* __qtd_QModelIndex_model
+(void* __this_nativeId)
+{
+    QModelIndex *__qt_this = (QModelIndex *) __this_nativeId;
+    const QAbstractItemModel*  __qt_return_value = __qt_this->model();
+
+    void* __java_return_value = (void*) __qt_return_value;
+
+    return __java_return_value;
+}
+
+// QModelIndex::operator<(const QModelIndex & other) const
+extern "C" DLL_PUBLIC bool __qtd_QModelIndex_operator_less_QModelIndex
+(void* __this_nativeId,
+ QModelIndex other0)
+{
+    QModelIndex *__qt_this = (QModelIndex *) __this_nativeId;
+    bool  __qt_return_value = __qt_this->operator<((const QModelIndex& )other0);
+
+    bool __java_return_value = __qt_return_value;
+
+    return __java_return_value;
+}
+
+// QModelIndex::operator==(const QModelIndex & other) const
+extern "C" DLL_PUBLIC bool __qtd_QModelIndex_operator_equal_QModelIndex
+(void* __this_nativeId,
+ QModelIndex other0)
+{
+    QModelIndex *__qt_this = (QModelIndex *) __this_nativeId;
+    bool  __qt_return_value = __qt_this->operator==((const QModelIndex& )other0);
+
+    bool __java_return_value = __qt_return_value;
+
+    return __java_return_value;
+}
+
+// QModelIndex::parent() const
+extern "C" DLL_PUBLIC QModelIndex __qtd_QModelIndex_parent
+(void* __this_nativeId)
+{
+    QModelIndex *__qt_this = (QModelIndex *) __this_nativeId;
+    QModelIndex  __qt_return_value = __qt_this->parent();
+
+
+    return __qt_return_value;
+}
+
+// QModelIndex::row() const
+extern "C" DLL_PUBLIC int __qtd_QModelIndex_row
+(void* __this_nativeId)
+{
+    QModelIndex *__qt_this = (QModelIndex *) __this_nativeId;
+    int  __qt_return_value = __qt_this->row();
+
+    int __java_return_value = __qt_return_value;
+
+    return __java_return_value;
+}
+
+// QModelIndex::sibling(int row, int column) const
+extern "C" DLL_PUBLIC QModelIndex __qtd_QModelIndex_sibling_int_int
+(void* __this_nativeId,
+ int row0,
+ int column1)
+{
+    QModelIndex *__qt_this = (QModelIndex *) __this_nativeId;
+    QModelIndex  __qt_return_value = __qt_this->sibling((int )row0, (int )column1);
+
+
+    return __qt_return_value;
+}
+
+// ---externC---end
+// Field accessors
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpp/qt_core/QPointF_shell.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,28 @@
+#include <qdatastream.h>
+#include <qpoint.h>
+
+#include "qtd_core.h"
+
+// ---externC---
+// QPointF::operator<<(QDataStream & arg__1)
+extern "C" DLL_PUBLIC void qtd_QPointF_writeTo_QDataStream
+(void* __this_nativeId,
+ void* arg__1)
+{
+    QDataStream&  __qt_arg__1 = (QDataStream& ) * (QDataStream *) arg__1;
+    QPointF *__qt_this = (QPointF *) __this_nativeId;
+    if (__qt_this != 0) ::operator<<((QDataStream& )__qt_arg__1, *__qt_this);
+
+}
+
+// QPointF::operator>>(QDataStream & arg__1)
+extern "C" DLL_PUBLIC void qtd_QPointF_readFrom_QDataStream
+(void* __this_nativeId,
+ void* arg__1)
+{
+    QDataStream&  __qt_arg__1 = (QDataStream& ) * (QDataStream *) arg__1;
+    QPointF *__qt_this = (QPointF *) __this_nativeId;
+    if (__qt_this != 0) ::operator>>((QDataStream& )__qt_arg__1, *__qt_this);
+
+}
+// ---externC---end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpp/qt_core/QPoint_shell.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,40 @@
+#include <qdatastream.h>
+#include <qpoint.h>
+
+#include "qtd_core.h"
+
+
+// QPoint::manhattanLength() const
+extern "C" DLL_PUBLIC int qtd_QPoint_manhattanLength
+(void* __this_nativeId)
+{
+    QPoint *__qt_this = (QPoint *) __this_nativeId;
+    int  __qt_return_value = __qt_this->manhattanLength();
+
+    int __d_return_value = __qt_return_value;
+
+    return __d_return_value;
+}
+
+// QPoint::operator<<(QDataStream & arg__1)
+extern "C" DLL_PUBLIC void qtd_QPoint_writeTo_QDataStream
+(void* __this_nativeId,
+ void* arg__1)
+{
+    QDataStream&  __qt_arg__1 = (QDataStream& ) * (QDataStream *) arg__1;
+    QPoint *__qt_this = (QPoint *) __this_nativeId;
+    if (__qt_this != 0) ::operator<<((QDataStream& )__qt_arg__1, *__qt_this);
+
+}
+
+// QPoint::operator>>(QDataStream & arg__1)
+extern "C" DLL_PUBLIC void qtd_QPoint_readFrom_QDataStream
+(void* __this_nativeId,
+ void* arg__1)
+{
+    QDataStream&  __qt_arg__1 = (QDataStream& ) * (QDataStream *) arg__1;
+    QPoint *__qt_this = (QPoint *) __this_nativeId;
+    if (__qt_this != 0) ::operator>>((QDataStream& )__qt_arg__1, *__qt_this);
+
+}
+// ---externC---end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpp/qt_core/QSizeF_shell.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,38 @@
+#include <qdatastream.h>
+#include <qsize.h>
+#include "qtd_core.h"
+
+// QSizeF::operator<<(QDataStream & arg__1)
+extern "C" DLL_PUBLIC void __qtd_QSizeF_writeTo_QDataStream
+(void* __this_nativeId,
+ void* arg__1)
+{
+    QDataStream&  __qt_arg__1 = (QDataStream& ) * (QDataStream *) arg__1;
+    QSizeF *__qt_this = (QSizeF *) __this_nativeId;
+    if (__qt_this != 0) ::operator<<((QDataStream& )__qt_arg__1, *__qt_this);
+
+}
+
+// QSizeF::operator>>(QDataStream & arg__1)
+extern "C" DLL_PUBLIC void __qtd_QSizeF_readFrom_QDataStream
+(void* __this_nativeId,
+ void* arg__1)
+{
+    QDataStream&  __qt_arg__1 = (QDataStream& ) * (QDataStream *) arg__1;
+    QSizeF *__qt_this = (QSizeF *) __this_nativeId;
+    if (__qt_this != 0) ::operator>>((QDataStream& )__qt_arg__1, *__qt_this);
+
+}
+
+// QSizeF::scale(const QSizeF & s, Qt::AspectRatioMode mode)
+extern "C" DLL_PUBLIC void __qtd_QSizeF_scale_QSizeF_AspectRatioMode
+(void* __this_nativeId,
+ void* s0,
+ int mode1)
+{
+    const QSizeF&  __qt_s0 = (const QSizeF& ) *(QSizeF *)s0;
+    Qt::AspectRatioMode __qt_mode1 = (Qt::AspectRatioMode) mode1;
+    QSizeF *__qt_this = (QSizeF *) __this_nativeId;
+    __qt_this->scale((const QSizeF& )__qt_s0, (Qt::AspectRatioMode )__qt_mode1);
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpp/qt_core/QSize_shell.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,39 @@
+#include <qdatastream.h>
+#include <qsize.h>
+#include "qtd_core.h"
+
+
+// QSize::operator<<(QDataStream & arg__1)
+extern "C" DLL_PUBLIC void __qtd_QSize_writeTo_QDataStream
+(void* __this_nativeId,
+ void* arg__1)
+{
+    QDataStream&  __qt_arg__1 = (QDataStream& ) * (QDataStream *) arg__1;
+    QSize *__qt_this = (QSize *) __this_nativeId;
+    if (__qt_this != 0) ::operator<<((QDataStream& )__qt_arg__1, *__qt_this);
+
+}
+
+// QSize::operator>>(QDataStream & arg__1)
+extern "C" DLL_PUBLIC void __qtd_QSize_readFrom_QDataStream
+(void* __this_nativeId,
+ void* arg__1)
+{
+    QDataStream&  __qt_arg__1 = (QDataStream& ) * (QDataStream *) arg__1;
+    QSize *__qt_this = (QSize *) __this_nativeId;
+    if (__qt_this != 0) ::operator>>((QDataStream& )__qt_arg__1, *__qt_this);
+
+}
+
+// QSize::scale(const QSize & s, Qt::AspectRatioMode mode)
+extern "C" DLL_PUBLIC void __qtd_QSize_scale_QSize_AspectRatioMode
+(void* __this_nativeId,
+ void* s0,
+ int mode1)
+{
+    const QSize&  __qt_s0 = (const QSize& ) *(QSize *)s0;
+    Qt::AspectRatioMode __qt_mode1 = (Qt::AspectRatioMode) mode1;
+    QSize *__qt_this = (QSize *) __this_nativeId;
+    __qt_this->scale((const QSize& )__qt_s0, (Qt::AspectRatioMode )__qt_mode1);
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpp/qt_core/QString_shell.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,24 @@
+#include <QString>
+#include "qtd_core.h"
+
+extern "C" DLL_PUBLIC const ushort* __qtd_QString_utf16
+(void* __this_nativeId)
+{
+    QString *__qt_this = (QString *) __this_nativeId;
+    return __qt_this->utf16();
+}
+
+extern "C" DLL_PUBLIC int __qtd_QString_size
+(void* __this_nativeId)
+{
+    QString *__qt_this = (QString *) __this_nativeId;
+    return __qt_this->size();
+}
+
+extern "C" DLL_PUBLIC void __qtd_QString_operatorAssign
+(void* __this_nativeId,
+ char* text, uint text_size)
+{
+    QString *__qt_this = (QString *) __this_nativeId;
+    *__qt_this = QString::fromUtf8(text, text_size);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpp/qt_core/QVariant_shell.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,956 @@
+#include <QVariant>
+#include <qbitarray.h>
+#include <qbytearray.h>
+#include <qdatastream.h>
+#include <qdatetime.h>
+#include <qline.h>
+#include <qlist.h>
+#include <qlocale.h>
+#include <qpoint.h>
+#include <qrect.h>
+#include <qregexp.h>
+#include <qstringlist.h>
+#include <qurl.h>
+#include <qvariant.h>
+
+#include "QVariant_shell.h"
+#include <qvariant.h>
+
+#include "qtd_core.h"
+extern "C" DLL_PUBLIC void qtd_QVariant_destructor(void *ptr)
+{
+    delete (QVariant *)ptr;
+}
+
+QVariant_QtDShell::QVariant_QtDShell()
+    : QVariant()
+{
+}
+
+QVariant_QtDShell::QVariant_QtDShell(QDataStream&  s0)
+    : QVariant(s0)
+{
+}
+
+QVariant_QtDShell::QVariant_QtDShell(Qt::GlobalColor  color0)
+    : QVariant(color0)
+{
+}
+
+QVariant_QtDShell::QVariant_QtDShell(bool  b0)
+    : QVariant(b0)
+{
+}
+
+QVariant_QtDShell::QVariant_QtDShell(const QBitArray&  bitarray0)
+    : QVariant(bitarray0)
+{
+}
+
+QVariant_QtDShell::QVariant_QtDShell(const QByteArray&  bytearray0)
+    : QVariant(bytearray0)
+{
+}
+
+QVariant_QtDShell::QVariant_QtDShell(const QChar&  qchar0)
+    : QVariant(qchar0)
+{
+}
+
+QVariant_QtDShell::QVariant_QtDShell(const QDate&  date0)
+    : QVariant(date0)
+{
+}
+
+QVariant_QtDShell::QVariant_QtDShell(const QDateTime&  datetime0)
+    : QVariant(datetime0)
+{
+}
+
+QVariant_QtDShell::QVariant_QtDShell(const QLatin1String&  string0)
+    : QVariant(string0)
+{
+}
+
+QVariant_QtDShell::QVariant_QtDShell(const QLine&  line0)
+    : QVariant(line0)
+{
+}
+
+QVariant_QtDShell::QVariant_QtDShell(const QLineF&  line0)
+    : QVariant(line0)
+{
+}
+
+QVariant_QtDShell::QVariant_QtDShell(const QList<QVariant >&  list0)
+    : QVariant(list0)
+{
+}
+
+QVariant_QtDShell::QVariant_QtDShell(const QLocale&  locale0)
+    : QVariant(locale0)
+{
+}
+
+QVariant_QtDShell::QVariant_QtDShell(const QMap<QString , QVariant >&  map0)
+    : QVariant(map0)
+{
+}
+
+QVariant_QtDShell::QVariant_QtDShell(const QPoint&  pt0)
+    : QVariant(pt0)
+{
+}
+
+QVariant_QtDShell::QVariant_QtDShell(const QPointF&  pt0)
+    : QVariant(pt0)
+{
+}
+
+QVariant_QtDShell::QVariant_QtDShell(const QRect&  rect0)
+    : QVariant(rect0)
+{
+}
+
+QVariant_QtDShell::QVariant_QtDShell(const QRectF&  rect0)
+    : QVariant(rect0)
+{
+}
+
+QVariant_QtDShell::QVariant_QtDShell(const QRegExp&  regExp0)
+    : QVariant(regExp0)
+{
+}
+
+QVariant_QtDShell::QVariant_QtDShell(const QSize&  size0)
+    : QVariant(size0)
+{
+}
+
+QVariant_QtDShell::QVariant_QtDShell(const QSizeF&  size0)
+    : QVariant(size0)
+{
+}
+
+QVariant_QtDShell::QVariant_QtDShell(const QString&  string0)
+    : QVariant(string0)
+{
+}
+
+QVariant_QtDShell::QVariant_QtDShell(const QStringList&  stringlist0)
+    : QVariant(stringlist0)
+{
+}
+
+QVariant_QtDShell::QVariant_QtDShell(const QTime&  time0)
+    : QVariant(time0)
+{
+}
+
+QVariant_QtDShell::QVariant_QtDShell(const QUrl&  url0)
+    : QVariant(url0)
+{
+}
+
+QVariant_QtDShell::QVariant_QtDShell(const QVariant&  other0)
+    : QVariant(other0)
+{
+}
+
+QVariant_QtDShell::QVariant_QtDShell(const char*  str0)
+    : QVariant(str0)
+{
+}
+
+QVariant_QtDShell::QVariant_QtDShell(double  d0)
+    : QVariant(d0)
+{
+}
+
+QVariant_QtDShell::QVariant_QtDShell(int  i0)
+    : QVariant(i0)
+{
+}
+
+QVariant_QtDShell::QVariant_QtDShell(int  typeOrUserType0, const void*  copy1)
+    : QVariant(typeOrUserType0, copy1)
+{
+}
+
+QVariant_QtDShell::QVariant_QtDShell(qint64  ll0)
+    : QVariant(ll0)
+{
+}
+
+QVariant_QtDShell::QVariant_QtDShell(uint  ui0)
+    : QVariant(ui0)
+{
+}
+
+QVariant_QtDShell::QVariant_QtDShell(quint64  ull0)
+    : QVariant(ull0)
+{
+}
+
+QVariant_QtDShell::~QVariant_QtDShell()
+{
+}
+
+// Virtual overrides
+// Functions in shell class
+// public overrides for functions that are protected in the base class
+bool  QVariant_QtDShell::__public_cmp(const QVariant&  other0) const
+{
+    return QVariant::cmp((const QVariant& )other0);
+}
+
+void QVariant_QtDShell::__public_create(int  type0, const void*  copy1)
+{
+    QVariant::create((int )type0, (const void* )copy1);
+}
+
+// Write virtual function overries used to decide on static/virtual calls
+// ---externC---
+// QVariant::QVariant()
+extern "C" DLL_PUBLIC void* qtd_QVariant_QVariant
+()
+{
+    QVariant_QtDShell *__qt_this = new QVariant_QtDShell();
+    return (void *) __qt_this;
+
+}
+
+// QVariant::QVariant(QDataStream & s)
+extern "C" DLL_PUBLIC void* qtd_QVariant_QVariant_QDataStream
+(void* s0)
+{
+    QDataStream&  __qt_s0 = (QDataStream& ) * (QDataStream *) s0;
+    QVariant_QtDShell *__qt_this = new QVariant_QtDShell((QDataStream& )__qt_s0);
+    return (void *) __qt_this;
+
+}
+
+// QVariant::QVariant(Qt::GlobalColor color)
+extern "C" DLL_PUBLIC void* qtd_QVariant_QVariant_GlobalColor
+(int color0)
+{
+    Qt::GlobalColor __qt_color0 = (Qt::GlobalColor) color0;
+    QVariant_QtDShell *__qt_this = new QVariant_QtDShell((Qt::GlobalColor )__qt_color0);
+    return (void *) __qt_this;
+
+}
+
+// QVariant::QVariant(bool b)
+extern "C" DLL_PUBLIC void* qtd_QVariant_QVariant_bool
+(bool b0)
+{
+    QVariant_QtDShell *__qt_this = new QVariant_QtDShell((bool )b0);
+    return (void *) __qt_this;
+
+}
+
+// QVariant::QVariant(const QBitArray & bitarray)
+extern "C" DLL_PUBLIC void* qtd_QVariant_QVariant_QBitArray
+(void* bitarray0)
+{
+    const QBitArray&  __qt_bitarray0 = (const QBitArray& ) *(QBitArray *)bitarray0;
+    QVariant_QtDShell *__qt_this = new QVariant_QtDShell((const QBitArray& )__qt_bitarray0);
+    return (void *) __qt_this;
+
+}
+
+// QVariant::QVariant(const QByteArray & bytearray)
+extern "C" DLL_PUBLIC void* qtd_QVariant_QVariant_QByteArray
+(void* bytearray0)
+{
+    const QByteArray&  __qt_bytearray0 = (const QByteArray& ) *(QByteArray *)bytearray0;
+    QVariant_QtDShell *__qt_this = new QVariant_QtDShell((const QByteArray& )__qt_bytearray0);
+    return (void *) __qt_this;
+
+}
+
+// QVariant::QVariant(const QChar & qchar)
+// QVariant::QVariant(const QDate & date)
+extern "C" DLL_PUBLIC void* qtd_QVariant_QVariant_QDate
+(void* date0)
+{
+    const QDate&  __qt_date0 = (const QDate& ) *(QDate *)date0;
+    QVariant_QtDShell *__qt_this = new QVariant_QtDShell((const QDate& )__qt_date0);
+    return (void *) __qt_this;
+
+}
+
+// QVariant::QVariant(const QDateTime & datetime)
+extern "C" DLL_PUBLIC void* qtd_QVariant_QVariant_QDateTime
+(void* datetime0)
+{
+    const QDateTime&  __qt_datetime0 = (const QDateTime& ) *(QDateTime *)datetime0;
+    QVariant_QtDShell *__qt_this = new QVariant_QtDShell((const QDateTime& )__qt_datetime0);
+    return (void *) __qt_this;
+
+}
+
+// QVariant::QVariant(const QLine & line)
+extern "C" DLL_PUBLIC void* qtd_QVariant_QVariant_QLine
+(void* line0)
+{
+    const QLine&  __qt_line0 = (const QLine& ) *(QLine *)line0;
+    QVariant_QtDShell *__qt_this = new QVariant_QtDShell((const QLine& )__qt_line0);
+    return (void *) __qt_this;
+
+}
+
+// QVariant::QVariant(const QLineF & line)
+extern "C" DLL_PUBLIC void* qtd_QVariant_QVariant_QLineF
+(void* line0)
+{
+    const QLineF&  __qt_line0 = (const QLineF& ) *(QLineF *)line0;
+    QVariant_QtDShell *__qt_this = new QVariant_QtDShell((const QLineF& )__qt_line0);
+    return (void *) __qt_this;
+
+}
+
+// QVariant::QVariant(const QList<QVariant > & list)
+// QVariant::QVariant(const QLocale & locale)
+extern "C" DLL_PUBLIC void* qtd_QVariant_QVariant_QLocale
+(void* locale0)
+{
+    const QLocale&  __qt_locale0 = (const QLocale& ) *(QLocale *)locale0;
+    QVariant_QtDShell *__qt_this = new QVariant_QtDShell((const QLocale& )__qt_locale0);
+    return (void *) __qt_this;
+
+}
+
+// QVariant::QVariant(const QMap<QString, QVariant > & map)
+// QVariant::QVariant(const QPoint & pt)
+extern "C" DLL_PUBLIC void* qtd_QVariant_QVariant_QPoint
+(void* pt0)
+{
+    const QPoint&  __qt_pt0 = (const QPoint& ) *(QPoint *)pt0;
+    QVariant_QtDShell *__qt_this = new QVariant_QtDShell((const QPoint& )__qt_pt0);
+    return (void *) __qt_this;
+
+}
+
+// QVariant::QVariant(const QPointF & pt)
+extern "C" DLL_PUBLIC void* qtd_QVariant_QVariant_QPointF
+(void* pt0)
+{
+    const QPointF&  __qt_pt0 = (const QPointF& ) *(QPointF *)pt0;
+    QVariant_QtDShell *__qt_this = new QVariant_QtDShell((const QPointF& )__qt_pt0);
+    return (void *) __qt_this;
+
+}
+
+// QVariant::QVariant(const QRect & rect)
+extern "C" DLL_PUBLIC void* qtd_QVariant_QVariant_QRect
+(void* rect0)
+{
+    const QRect&  __qt_rect0 = (const QRect& ) *(QRect *)rect0;
+    QVariant_QtDShell *__qt_this = new QVariant_QtDShell((const QRect& )__qt_rect0);
+    return (void *) __qt_this;
+
+}
+
+// QVariant::QVariant(const QRectF & rect)
+extern "C" DLL_PUBLIC void* qtd_QVariant_QVariant_QRectF
+(void* rect0)
+{
+    const QRectF&  __qt_rect0 = (const QRectF& ) *(QRectF *)rect0;
+    QVariant_QtDShell *__qt_this = new QVariant_QtDShell((const QRectF& )__qt_rect0);
+    return (void *) __qt_this;
+
+}
+
+// QVariant::QVariant(const QRegExp & regExp)
+extern "C" DLL_PUBLIC void* qtd_QVariant_QVariant_QRegExp
+(void* regExp0)
+{
+    const QRegExp&  __qt_regExp0 = (const QRegExp& ) *(QRegExp *)regExp0;
+    QVariant_QtDShell *__qt_this = new QVariant_QtDShell((const QRegExp& )__qt_regExp0);
+    return (void *) __qt_this;
+
+}
+
+// QVariant::QVariant(const QSize & size)
+extern "C" DLL_PUBLIC void* qtd_QVariant_QVariant_QSize
+(void* size0)
+{
+    const QSize&  __qt_size0 = (const QSize& ) *(QSize *)size0;
+    QVariant_QtDShell *__qt_this = new QVariant_QtDShell((const QSize& )__qt_size0);
+    return (void *) __qt_this;
+
+}
+
+// QVariant::QVariant(const QSizeF & size)
+extern "C" DLL_PUBLIC void* qtd_QVariant_QVariant_QSizeF
+(void* size0)
+{
+    const QSizeF&  __qt_size0 = (const QSizeF& ) *(QSizeF *)size0;
+    QVariant_QtDShell *__qt_this = new QVariant_QtDShell((const QSizeF& )__qt_size0);
+    return (void *) __qt_this;
+
+}
+
+// QVariant::QVariant(const QString & string)
+extern "C" DLL_PUBLIC void* qtd_QVariant_QVariant_String
+(char* string0, uint string0_size)
+{
+    QString __qt_string0 = QString::fromUtf8(string0, string0_size);
+    QVariant_QtDShell *__qt_this = new QVariant_QtDShell((const QString& )__qt_string0);
+    return (void *) __qt_this;
+
+}
+
+// QVariant::QVariant(const QStringList & stringlist)
+// QVariant::QVariant(const QTime & time)
+extern "C" DLL_PUBLIC void* qtd_QVariant_QVariant_QTime
+(void* time0)
+{
+    const QTime&  __qt_time0 = (const QTime& ) *(QTime *)time0;
+    QVariant_QtDShell *__qt_this = new QVariant_QtDShell((const QTime& )__qt_time0);
+    return (void *) __qt_this;
+
+}
+
+// QVariant::QVariant(const QUrl & url)
+extern "C" DLL_PUBLIC void* qtd_QVariant_QVariant_QUrl
+(void* url0)
+{
+    const QUrl&  __qt_url0 = (const QUrl& ) *(QUrl *)url0;
+    QVariant_QtDShell *__qt_this = new QVariant_QtDShell((const QUrl& )__qt_url0);
+    return (void *) __qt_this;
+
+}
+
+// QVariant::QVariant(const QVariant & other)
+extern "C" DLL_PUBLIC void* qtd_QVariant_QVariant_QVariant
+(void* other0)
+{
+    const QVariant&  __qt_other0 = (const QVariant& ) *(QVariant *)other0;
+    QVariant_QtDShell *__qt_this = new QVariant_QtDShell((const QVariant& )__qt_other0);
+    return (void *) __qt_this;
+
+}
+
+// QVariant::QVariant(const char * str)
+extern "C" DLL_PUBLIC void* qtd_QVariant_QVariant_nativepointerchar
+(char* str0)
+{
+    const char*  __qt_str0 = (const char* ) str0;
+    QVariant_QtDShell *__qt_this = new QVariant_QtDShell((const char* )__qt_str0);
+    return (void *) __qt_this;
+
+}
+
+// QVariant::QVariant(double d)
+extern "C" DLL_PUBLIC void* qtd_QVariant_QVariant_double
+(double d0)
+{
+    QVariant_QtDShell *__qt_this = new QVariant_QtDShell((double )d0);
+    return (void *) __qt_this;
+
+}
+
+// QVariant::QVariant(int i)
+extern "C" DLL_PUBLIC void* qtd_QVariant_QVariant_int
+(int i0)
+{
+    QVariant_QtDShell *__qt_this = new QVariant_QtDShell((int )i0);
+    return (void *) __qt_this;
+
+}
+
+// QVariant::QVariant(int typeOrUserType, const void * copy)
+extern "C" DLL_PUBLIC void* qtd_QVariant_QVariant_int_nativepointervoid
+(int typeOrUserType0,
+ void* copy1)
+{
+    const void*  __qt_copy1 = (const void* ) copy1;
+    QVariant_QtDShell *__qt_this = new QVariant_QtDShell((int )typeOrUserType0, (const void* )__qt_copy1);
+    return (void *) __qt_this;
+
+}
+
+// QVariant::QVariant(long long ll)
+extern "C" DLL_PUBLIC void* qtd_QVariant_QVariant_long
+(qint64 ll0)
+{
+    QVariant_QtDShell *__qt_this = new QVariant_QtDShell((qint64 )ll0);
+    return (void *) __qt_this;
+
+}
+
+// QVariant::QVariant(uint ui)
+extern "C" DLL_PUBLIC void* qtd_QVariant_QVariant_uint
+(uint ui0)
+{
+    QVariant_QtDShell *__qt_this = new QVariant_QtDShell((uint )ui0);
+    return (void *) __qt_this;
+
+}
+
+// QVariant::QVariant(unsigned long long ull)
+extern "C" DLL_PUBLIC void* qtd_QVariant_QVariant_ulong
+(quint64 ull0)
+{
+    QVariant_QtDShell *__qt_this = new QVariant_QtDShell((quint64 )ull0);
+    return (void *) __qt_this;
+
+}
+
+// QVariant::canConvert() const
+extern "C" DLL_PUBLIC bool qtd_QVariant_canConvert
+(void* __this_nativeId, QVariant::Type type)
+{
+    QVariant_QtDShell *__qt_this = (QVariant_QtDShell *) __this_nativeId;
+    bool  __qt_return_value = __qt_this->canConvert(type);
+
+    bool __java_return_value = __qt_return_value;
+
+    return __java_return_value;
+}
+
+// QVariant::clear()
+extern "C" DLL_PUBLIC void qtd_QVariant_clear
+(void* __this_nativeId)
+{
+    QVariant_QtDShell *__qt_this = (QVariant_QtDShell *) __this_nativeId;
+    __qt_this->clear();
+
+}
+
+// QVariant::cmp(const QVariant & other) const
+extern "C" DLL_PUBLIC bool qtd_QVariant_cmp_QVariant
+(void* __this_nativeId,
+ void* other0)
+{
+    const QVariant&  __qt_other0 = (const QVariant& ) *(QVariant *)other0;
+    QVariant_QtDShell *__qt_this = (QVariant_QtDShell *) __this_nativeId;
+    bool  __qt_return_value = __qt_this->__public_cmp((const QVariant& )__qt_other0);
+
+    bool __java_return_value = __qt_return_value;
+
+    return __java_return_value;
+}
+
+// QVariant::create(int type, const void * copy)
+extern "C" DLL_PUBLIC void qtd_QVariant_create_int_nativepointervoid
+(void* __this_nativeId,
+ int type0,
+ void* copy1)
+{
+    const void*  __qt_copy1 = (const void* ) copy1;
+    QVariant_QtDShell *__qt_this = (QVariant_QtDShell *) __this_nativeId;
+    __qt_this->__public_create((int )type0, (const void* )__qt_copy1);
+
+}
+
+// QVariant::isNull() const
+extern "C" DLL_PUBLIC bool qtd_QVariant_isNull
+(void* __this_nativeId)
+{
+    QVariant_QtDShell *__qt_this = (QVariant_QtDShell *) __this_nativeId;
+    bool  __qt_return_value = __qt_this->isNull();
+
+    bool __java_return_value = __qt_return_value;
+
+    return __java_return_value;
+}
+
+// QVariant::isValid() const
+extern "C" DLL_PUBLIC bool qtd_QVariant_isValid
+(void* __this_nativeId)
+{
+    QVariant_QtDShell *__qt_this = (QVariant_QtDShell *) __this_nativeId;
+    bool  __qt_return_value = __qt_this->isValid();
+
+    bool __java_return_value = __qt_return_value;
+
+    return __java_return_value;
+}
+
+// QVariant::load(QDataStream & ds)
+extern "C" DLL_PUBLIC void qtd_QVariant_load_QDataStream
+(void* __this_nativeId,
+ void* ds0)
+{
+    QDataStream&  __qt_ds0 = (QDataStream& ) * (QDataStream *) ds0;
+    QVariant_QtDShell *__qt_this = (QVariant_QtDShell *) __this_nativeId;
+    __qt_this->load((QDataStream& )__qt_ds0);
+
+}
+
+// QVariant::operator<<(QDataStream & s)
+extern "C" DLL_PUBLIC void qtd_QVariant_writeTo_QDataStream
+(void* __this_nativeId,
+ void* s0)
+{
+    QDataStream&  __qt_s0 = (QDataStream& ) * (QDataStream *) s0;
+    QVariant_QtDShell *__qt_this = (QVariant_QtDShell *) __this_nativeId;
+    if (__qt_this != 0) ::operator<<((QDataStream& )__qt_s0, *__qt_this);
+
+}
+
+// QVariant::operator=(const QVariant & other)
+extern "C" DLL_PUBLIC void* qtd_QVariant_operator_assign_QVariant
+(void* __this_nativeId,
+ void* other0)
+{
+    const QVariant&  __qt_other0 = (const QVariant& ) *(QVariant *)other0;
+    QVariant_QtDShell *__qt_this = (QVariant_QtDShell *) __this_nativeId;
+    QVariant&  __qt_return_value = __qt_this->operator=((const QVariant& )__qt_other0);
+
+    void* __java_return_value = (void*) &__qt_return_value;// qtjambi_from_cpointer
+
+    return __java_return_value;
+}
+
+// QVariant::operator==(const QVariant & v) const
+extern "C" DLL_PUBLIC bool qtd_QVariant_operator_equal_QVariant
+(void* __this_nativeId,
+ void* v0)
+{
+    const QVariant&  __qt_v0 = (const QVariant& ) *(QVariant *)v0;
+    QVariant_QtDShell *__qt_this = (QVariant_QtDShell *) __this_nativeId;
+    bool  __qt_return_value = __qt_this->operator==((const QVariant& )__qt_v0);
+
+    bool __java_return_value = __qt_return_value;
+
+    return __java_return_value;
+}
+
+// QVariant::operator>>(QDataStream & s)
+extern "C" DLL_PUBLIC void qtd_QVariant_readFrom_QDataStream
+(void* __this_nativeId,
+ void* s0)
+{
+    QDataStream&  __qt_s0 = (QDataStream& ) * (QDataStream *) s0;
+    QVariant_QtDShell *__qt_this = (QVariant_QtDShell *) __this_nativeId;
+    if (__qt_this != 0) ::operator>>((QDataStream& )__qt_s0, *__qt_this);
+
+}
+
+// QVariant::save(QDataStream & ds) const
+extern "C" DLL_PUBLIC void qtd_QVariant_save_QDataStream
+(void* __this_nativeId,
+ void* ds0)
+{
+    QDataStream&  __qt_ds0 = (QDataStream& ) * (QDataStream *) ds0;
+    QVariant_QtDShell *__qt_this = (QVariant_QtDShell *) __this_nativeId;
+    __qt_this->save((QDataStream& )__qt_ds0);
+
+}
+
+// QVariant::toBitArray() const
+extern "C" DLL_PUBLIC void* qtd_QVariant_toBitArray
+(void* __this_nativeId)
+{
+    QVariant_QtDShell *__qt_this = (QVariant_QtDShell *) __this_nativeId;
+    QBitArray  __qt_return_value = __qt_this->toBitArray();
+
+    void* __java_return_value = (void*) new QBitArray(__qt_return_value);
+
+    return __java_return_value;
+}
+
+// QVariant::toBool() const
+extern "C" DLL_PUBLIC bool qtd_QVariant_toBool
+(void* __this_nativeId)
+{
+    QVariant_QtDShell *__qt_this = (QVariant_QtDShell *) __this_nativeId;
+    bool  __qt_return_value = __qt_this->toBool();
+
+    bool __java_return_value = __qt_return_value;
+
+    return __java_return_value;
+}
+
+// QVariant::toByteArray() const
+extern "C" DLL_PUBLIC void* qtd_QVariant_toByteArray
+(void* __this_nativeId)
+{
+    QVariant_QtDShell *__qt_this = (QVariant_QtDShell *) __this_nativeId;
+    QByteArray  __qt_return_value = __qt_this->toByteArray();
+
+    void* __java_return_value = (void*) new QByteArray(__qt_return_value);
+
+    return __java_return_value;
+}
+
+// QVariant::toChar() const
+// QVariant::toDate() const
+extern "C" DLL_PUBLIC void* qtd_QVariant_toDate
+(void* __this_nativeId)
+{
+    QVariant_QtDShell *__qt_this = (QVariant_QtDShell *) __this_nativeId;
+    QDate  __qt_return_value = __qt_this->toDate();
+
+    void* __java_return_value = (void*) new QDate(__qt_return_value);
+
+    return __java_return_value;
+}
+
+// QVariant::toDateTime() const
+extern "C" DLL_PUBLIC void* qtd_QVariant_toDateTime
+(void* __this_nativeId)
+{
+    QVariant_QtDShell *__qt_this = (QVariant_QtDShell *) __this_nativeId;
+    QDateTime  __qt_return_value = __qt_this->toDateTime();
+
+    void* __java_return_value = (void*) new QDateTime(__qt_return_value);
+
+    return __java_return_value;
+}
+
+// QVariant::toDouble(bool * ok) const
+extern "C" DLL_PUBLIC double qtd_QVariant_toDouble_nativepointerbool
+(void* __this_nativeId,
+ bool* ok0)
+{
+    bool*  __qt_ok0 = (bool* ) ok0;
+    QVariant_QtDShell *__qt_this = (QVariant_QtDShell *) __this_nativeId;
+    double  __qt_return_value = __qt_this->toDouble((bool* )__qt_ok0);
+
+    double __java_return_value = __qt_return_value;
+
+    return __java_return_value;
+}
+
+// QVariant::toInt(bool * ok) const
+extern "C" DLL_PUBLIC int qtd_QVariant_toInt_nativepointerbool
+(void* __this_nativeId,
+ bool* ok0)
+{
+    bool*  __qt_ok0 = (bool* ) ok0;
+    QVariant_QtDShell *__qt_this = (QVariant_QtDShell *) __this_nativeId;
+    int  __qt_return_value = __qt_this->toInt((bool* )__qt_ok0);
+
+    int __java_return_value = __qt_return_value;
+
+    return __java_return_value;
+}
+
+// QVariant::toLine() const
+extern "C" DLL_PUBLIC void* qtd_QVariant_toLine
+(void* __this_nativeId)
+{
+    QVariant_QtDShell *__qt_this = (QVariant_QtDShell *) __this_nativeId;
+    QLine  __qt_return_value = __qt_this->toLine();
+
+    void* __java_return_value = (void*) new QLine(__qt_return_value);
+
+    return __java_return_value;
+}
+
+// QVariant::toLineF() const
+extern "C" DLL_PUBLIC void* qtd_QVariant_toLineF
+(void* __this_nativeId)
+{
+    QVariant_QtDShell *__qt_this = (QVariant_QtDShell *) __this_nativeId;
+    QLineF  __qt_return_value = __qt_this->toLineF();
+
+    void* __java_return_value = (void*) new QLineF(__qt_return_value);
+
+    return __java_return_value;
+}
+
+// QVariant::toList() const
+// QVariant::toLocale() const
+extern "C" DLL_PUBLIC void* qtd_QVariant_toLocale
+(void* __this_nativeId)
+{
+    QVariant_QtDShell *__qt_this = (QVariant_QtDShell *) __this_nativeId;
+    QLocale  __qt_return_value = __qt_this->toLocale();
+
+    void* __java_return_value = (void*) new QLocale(__qt_return_value);
+
+    return __java_return_value;
+}
+
+// QVariant::toLongLong(bool * ok) const
+extern "C" DLL_PUBLIC qint64 qtd_QVariant_toLongLong_nativepointerbool
+(void* __this_nativeId,
+ bool* ok0)
+{
+    bool*  __qt_ok0 = (bool* ) ok0;
+    QVariant_QtDShell *__qt_this = (QVariant_QtDShell *) __this_nativeId;
+    qint64  __qt_return_value = __qt_this->toLongLong((bool* )__qt_ok0);
+
+    qint64 __java_return_value = __qt_return_value;
+
+    return __java_return_value;
+}
+
+// QVariant::toMap() const
+// QVariant::toPoint() const
+extern "C" DLL_PUBLIC QPoint qtd_QVariant_toPoint
+(void* __this_nativeId)
+{
+    QVariant_QtDShell *__qt_this = (QVariant_QtDShell *) __this_nativeId;
+    QPoint  __qt_return_value = __qt_this->toPoint();
+
+    return __qt_return_value;
+}
+
+// QVariant::toPointF() const
+extern "C" DLL_PUBLIC QPointF qtd_QVariant_toPointF
+(void* __this_nativeId)
+{
+    QVariant_QtDShell *__qt_this = (QVariant_QtDShell *) __this_nativeId;
+    QPointF  __qt_return_value = __qt_this->toPointF();
+
+    return __qt_return_value;
+}
+
+// QVariant::toRect() const
+extern "C" DLL_PUBLIC void* qtd_QVariant_toRect
+(void* __this_nativeId)
+{
+    QVariant_QtDShell *__qt_this = (QVariant_QtDShell *) __this_nativeId;
+    QRect  __qt_return_value = __qt_this->toRect();
+
+    void* __java_return_value = (void*) new QRect(__qt_return_value);
+
+    return __java_return_value;
+}
+
+// QVariant::toRectF() const
+extern "C" DLL_PUBLIC void* qtd_QVariant_toRectF
+(void* __this_nativeId)
+{
+    QVariant_QtDShell *__qt_this = (QVariant_QtDShell *) __this_nativeId;
+    QRectF  __qt_return_value = __qt_this->toRectF();
+
+    void* __java_return_value = (void*) new QRectF(__qt_return_value);
+
+    return __java_return_value;
+}
+
+// QVariant::toRegExp() const
+extern "C" DLL_PUBLIC void* qtd_QVariant_toRegExp
+(void* __this_nativeId)
+{
+    QVariant_QtDShell *__qt_this = (QVariant_QtDShell *) __this_nativeId;
+    QRegExp  __qt_return_value = __qt_this->toRegExp();
+
+    void* __java_return_value = (void*) new QRegExp(__qt_return_value);
+
+    return __java_return_value;
+}
+
+// QVariant::toSize() const
+extern "C" DLL_PUBLIC QSize qtd_QVariant_toSize
+(void* __this_nativeId)
+{
+    QVariant_QtDShell *__qt_this = (QVariant_QtDShell *) __this_nativeId;
+    QSize  __qt_return_value = __qt_this->toSize();
+
+
+    return __qt_return_value;
+}
+
+// QVariant::toSizeF() const
+extern "C" DLL_PUBLIC QSizeF qtd_QVariant_toSizeF
+(void* __this_nativeId)
+{
+    QVariant_QtDShell *__qt_this = (QVariant_QtDShell *) __this_nativeId;
+    QSizeF  __qt_return_value = __qt_this->toSizeF();
+
+
+    return __qt_return_value;
+}
+
+// QVariant::toString() const
+extern "C" DLL_PUBLIC void qtd_QVariant_toString
+(void* __this_nativeId,
+ void* __java_return_value)
+{
+    QVariant_QtDShell *__qt_this = (QVariant_QtDShell *) __this_nativeId;
+    QString  __qt_return_value = __qt_this->toString();
+
+    _d_toUtf8(__qt_return_value.utf16(), __qt_return_value.size(), __java_return_value);
+
+}
+
+// QVariant::toStringList() const
+// QVariant::toTime() const
+extern "C" DLL_PUBLIC void* qtd_QVariant_toTime
+(void* __this_nativeId)
+{
+    QVariant_QtDShell *__qt_this = (QVariant_QtDShell *) __this_nativeId;
+    QTime  __qt_return_value = __qt_this->toTime();
+
+    void* __java_return_value = (void*) new QTime(__qt_return_value);
+
+    return __java_return_value;
+}
+
+// QVariant::toUInt(bool * ok) const
+extern "C" DLL_PUBLIC uint qtd_QVariant_toUInt_nativepointerbool
+(void* __this_nativeId,
+ bool* ok0)
+{
+    bool*  __qt_ok0 = (bool* ) ok0;
+    QVariant_QtDShell *__qt_this = (QVariant_QtDShell *) __this_nativeId;
+    uint  __qt_return_value = __qt_this->toUInt((bool* )__qt_ok0);
+
+    uint __java_return_value = __qt_return_value;
+
+    return __java_return_value;
+}
+
+// QVariant::toULongLong(bool * ok) const
+extern "C" DLL_PUBLIC quint64 qtd_QVariant_toULongLong_nativepointerbool
+(void* __this_nativeId,
+ bool* ok0)
+{
+    bool*  __qt_ok0 = (bool* ) ok0;
+    QVariant_QtDShell *__qt_this = (QVariant_QtDShell *) __this_nativeId;
+    quint64  __qt_return_value = __qt_this->toULongLong((bool* )__qt_ok0);
+
+    quint64 __java_return_value = __qt_return_value;
+
+    return __java_return_value;
+}
+
+// QVariant::toUrl() const
+extern "C" DLL_PUBLIC void* qtd_QVariant_toUrl
+(void* __this_nativeId)
+{
+    QVariant_QtDShell *__qt_this = (QVariant_QtDShell *) __this_nativeId;
+    QUrl  __qt_return_value = __qt_this->toUrl();
+
+    void* __java_return_value = (void*) new QUrl(__qt_return_value);
+
+    return __java_return_value;
+}
+
+// QVariant::typeName() const
+extern "C" DLL_PUBLIC char* qtd_QVariant_typeName
+(void* __this_nativeId)
+{
+    QVariant_QtDShell *__qt_this = (QVariant_QtDShell *) __this_nativeId;
+    const char*  __qt_return_value = __qt_this->typeName();
+
+    char* __java_return_value = (char*) __qt_return_value;// qtjambi_from_cpointer
+
+    return __java_return_value;
+}
+
+// QVariant::userType() const
+extern "C" DLL_PUBLIC int qtd_QVariant_userType
+(void* __this_nativeId)
+{
+    QVariant_QtDShell *__qt_this = (QVariant_QtDShell *) __this_nativeId;
+    int  __qt_return_value = __qt_this->userType();
+
+    int __java_return_value = __qt_return_value;
+
+    return __java_return_value;
+}
+
+// ---externC---end
+// Field accessors
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpp/qt_core/QVariant_shell.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,66 @@
+#ifndef QVARIANT_SHELL_H
+#define QVARIANT_SHELL_H
+
+#include <QtCore/QHash>
+#include <QObjectEntity.h>
+#include <qvariant.h>
+
+#include <QVariant>
+#include <qbitarray.h>
+#include <qbytearray.h>
+#include <qdatastream.h>
+#include <qdatetime.h>
+#include <qline.h>
+#include <qlist.h>
+#include <qlocale.h>
+#include <qpoint.h>
+#include <qrect.h>
+#include <qregexp.h>
+#include <qstringlist.h>
+#include <qurl.h>
+#include <qvariant.h>
+
+class QVariant_QtDShell : public QVariant
+{
+public:
+    QVariant_QtDShell();
+    QVariant_QtDShell(QDataStream&  s0);
+    QVariant_QtDShell(Qt::GlobalColor  color0);
+    QVariant_QtDShell(bool  b0);
+    QVariant_QtDShell(const QBitArray&  bitarray0);
+    QVariant_QtDShell(const QByteArray&  bytearray0);
+    QVariant_QtDShell(const QChar&  qchar0);
+    QVariant_QtDShell(const QDate&  date0);
+    QVariant_QtDShell(const QDateTime&  datetime0);
+    QVariant_QtDShell(const QLatin1String&  string0);
+    QVariant_QtDShell(const QLine&  line0);
+    QVariant_QtDShell(const QLineF&  line0);
+    QVariant_QtDShell(const QList<QVariant >&  list0);
+    QVariant_QtDShell(const QLocale&  locale0);
+    QVariant_QtDShell(const QMap<QString , QVariant >&  map0);
+    QVariant_QtDShell(const QPoint&  pt0);
+    QVariant_QtDShell(const QPointF&  pt0);
+    QVariant_QtDShell(const QRect&  rect0);
+    QVariant_QtDShell(const QRectF&  rect0);
+    QVariant_QtDShell(const QRegExp&  regExp0);
+    QVariant_QtDShell(const QSize&  size0);
+    QVariant_QtDShell(const QSizeF&  size0);
+    QVariant_QtDShell(const QString&  string0);
+    QVariant_QtDShell(const QStringList&  stringlist0);
+    QVariant_QtDShell(const QTime&  time0);
+    QVariant_QtDShell(const QUrl&  url0);
+    QVariant_QtDShell(const QVariant&  other0);
+    QVariant_QtDShell(const char*  str0);
+    QVariant_QtDShell(double  d0);
+    QVariant_QtDShell(int  i0);
+    QVariant_QtDShell(int  typeOrUserType0, const void*  copy1);
+    QVariant_QtDShell(qint64  ll0);
+    QVariant_QtDShell(uint  ui0);
+    QVariant_QtDShell(quint64  ull0);
+    ~QVariant_QtDShell();
+
+    bool  __public_cmp(const QVariant&  other0) const;
+    void __public_create(int  type0, const void*  copy1);
+};
+
+#endif // QVARIANT_SHELL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpp/qt_gui/CMakeLists.txt	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,177 @@
+PROJECT(QT_GUI_CPP CXX)
+# source files
+
+SET(QT_GUI_SRCS
+QListWidget_shell.cpp
+QPushButton_shell.cpp
+QFileIconProvider_shell.cpp
+QPaintDevice_shell.cpp
+QPicture_shell.cpp
+QPixmap_shell.cpp
+QImage_shell.cpp
+QBitmap_shell.cpp
+QStyle_shell.cpp
+QStyleOption_shell.cpp
+QDesktopWidget_shell.cpp
+QMenu_shell.cpp
+QAction_shell.cpp
+QDropEvent_shell.cpp
+QInputContext_shell.cpp
+QWidget_shell.cpp
+QApplication_shell.cpp
+QIcon_shell.cpp
+QIconEngine_shell.cpp
+QPalette_shell.cpp
+QSizePolicy_shell.cpp
+QRegion_shell.cpp
+QFontMetrics_shell.cpp
+QCursor_shell.cpp
+QFont_shell.cpp
+QClipboard_shell.cpp
+QSessionManager_shell.cpp
+QPainterPath_shell.cpp
+QPainterPath_Element_shell.cpp
+QPaintEvent_shell.cpp
+QTransform_shell.cpp
+QMatrix_shell.cpp
+QPainter_shell.cpp
+QDragLeaveEvent_shell.cpp
+QPolygon_shell.cpp
+QInputEvent_shell.cpp
+QDragEnterEvent_shell.cpp
+QKeyEvent_shell.cpp
+QHideEvent_shell.cpp
+QWheelEvent_shell.cpp
+QMoveEvent_shell.cpp
+QActionGroup_shell.cpp
+QActionEvent_shell.cpp
+QFocusEvent_shell.cpp
+QIconEngineV2_shell.cpp
+QLine_shell.cpp
+QLineF_shell.cpp
+QFontInfo_shell.cpp
+QStyleHintReturn_shell.cpp
+QColor_shell.cpp
+QDragMoveEvent_shell.cpp
+QStyleOptionMenuItem_shell.cpp
+QTabletEvent_shell.cpp
+QShowEvent_shell.cpp
+QResizeEvent_shell.cpp
+QBrush_shell.cpp
+QInputMethodEvent_shell.cpp
+QContextMenuEvent_shell.cpp
+QStyleOptionComplex_shell.cpp
+QMouseEvent_shell.cpp
+QHelpEvent_shell.cpp
+QTextFormat_shell.cpp
+QKeySequence_shell.cpp
+QCloseEvent_shell.cpp
+QGradient_shell.cpp
+QTextItem_shell.cpp
+QTextOption_shell.cpp
+QPolygonF_shell.cpp
+QPen_shell.cpp
+QTextCharFormat_shell.cpp
+QTextListFormat_shell.cpp
+QTextTableFormat_shell.cpp
+QTextLength_shell.cpp
+QTextFrameFormat_shell.cpp
+QTextTableCellFormat_shell.cpp
+QTextBlockFormat_shell.cpp
+QTextImageFormat_shell.cpp
+QFrame_shell.cpp
+QLabel_shell.cpp
+QAbstractButton_shell.cpp
+QMovie_shell.cpp
+QCheckBox_shell.cpp
+QRadioButton_shell.cpp
+QToolButton_shell.cpp
+QStyleOptionButton_shell.cpp
+QStyleOptionToolButton_shell.cpp
+QStyleOptionToolBar_shell.cpp
+QStyleOptionToolBox_shell.cpp
+QStyleOptionToolBoxV2_shell.cpp
+QStyleOptionSlider_shell.cpp
+QStyleOptionViewItem_shell.cpp
+QStyleOptionHeader_shell.cpp
+QStyleOptionDockWidget_shell.cpp
+QStyleOptionTab_shell.cpp
+QButtonGroup_shell.cpp
+QLCDNumber_shell.cpp
+QAbstractSlider_shell.cpp
+QDial_shell.cpp
+QSlider_shell.cpp
+QScrollBar_shell.cpp
+QPaintEngine_shell.cpp
+QSpacerItem_shell.cpp
+QLayout_shell.cpp
+QLayoutItem_shell.cpp
+QPaintEngineState_shell.cpp
+QBoxLayout_shell.cpp
+QHBoxLayout_shell.cpp
+QVBoxLayout_shell.cpp
+QFormLayout_shell.cpp
+QGridLayout_shell.cpp
+QStackedLayout_shell.cpp
+QAbstractScrollArea_shell.cpp
+QAbstractItemDelegate_shell.cpp
+QAbstractItemView_shell.cpp
+QTreeView_shell.cpp
+QTableView_shell.cpp
+QListView_shell.cpp
+QHeaderView_shell.cpp
+QItemSelection_shell.cpp
+QItemSelectionModel_shell.cpp
+QItemSelectionRange_shell.cpp
+QDirModel_shell.cpp
+QSplitter_shell.cpp
+QSplitterHandle_shell.cpp
+QListWidgetItem_shell.cpp
+QMainWindow_shell.cpp
+QMenuBar_shell.cpp
+QToolBar_shell.cpp
+QMessageBox_shell.cpp
+QDockWidget_shell.cpp
+QDialog_shell.cpp
+QStatusBar_shell.cpp
+QTabWidget_shell.cpp
+QTabBar_shell.cpp
+QImageIOHandler_shell.cpp
+QImageReader_shell.cpp
+QTextFrame_iterator_shell.cpp
+QTextBlock_iterator_shell.cpp
+QPrinter_shell.cpp
+QTextLine_shell.cpp
+QTextEdit_shell.cpp
+QTextCursor_shell.cpp
+QTextFrame_shell.cpp
+QTextObject_shell.cpp
+QTextBlock_shell.cpp
+QTextDocument_shell.cpp
+QPrinterInfo_shell.cpp
+QTextList_shell.cpp
+QTextLayout_shell.cpp
+QTextBlockUserData_shell.cpp
+QTextDocumentFragment_shell.cpp
+QTextTable_shell.cpp
+QAbstractTextDocumentLayout_shell.cpp
+QTextBlockGroup_shell.cpp
+QTextObjectInterface_shell.cpp
+QTextInlineObject_shell.cpp
+QAbstractTextDocumentLayout_PaintContext_shell.cpp
+QTextLayout_FormatRange_shell.cpp
+QTextFragment_shell.cpp
+QTextTableCell_shell.cpp
+QPrintEngine_shell.cpp
+QStyleOptionTabWidgetFrame_shell.cpp
+QComboBox_shell.cpp
+QValidator_shell.cpp
+QCompleter_shell.cpp
+QLineEdit_shell.cpp
+QStyleOptionComboBox_shell.cpp
+QStyleOptionFrame_shell.cpp
+QFileDialog_shell.cpp
+QAbstractProxyModel_shell.cpp
+)
+
+ADD_LIBRARY(qt_gui_cpp STATIC ${QT_GUI_SRCS})
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpp/qt_opengl/CMakeLists.txt	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,11 @@
+PROJECT(QT_OPENGL_CPP CXX)
+# source files
+
+SET(QT_OPENGL_SRCS
+QGLWidget_shell.cpp
+QGLFormat_shell.cpp
+QGLContext_shell.cpp
+QGLColormap_shell.cpp
+)
+
+ADD_LIBRARY(qt_opengl_cpp STATIC ${QT_OPENGL_SRCS})
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpp/qt_qtd/ArrayOpsPrimitive_shell.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,55 @@
+/**
+*
+*  Copyright: Copyright QtD Team, 2008-2009
+*  License: <a href="http://www.boost.org/LICENSE_1_0.txt>Boost License 1.0</a>
+*
+*  Copyright QtD Team, 2008-2009
+*  Distributed under the Boost Software License, Version 1.0.
+*  (See accompanying file boost-license-1.0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+*
+*/
+
+// stuff for passing D function pointers!
+
+#ifdef CPP_SHARED
+
+#include "ArrayOpsPrimitive.h"
+
+QTD_EXPORT_VAR(qtd_allocate_int_array)
+QTD_EXPORT_VAR(qtd_assign_int_array_element)
+QTD_EXPORT_VAR(qtd_get_int_from_array)
+
+QTD_EXPORT_VAR(qtd_allocate_uint_array)
+QTD_EXPORT_VAR(qtd_assign_uint_array_element)
+QTD_EXPORT_VAR(qtd_get_uint_from_array)
+
+QTD_EXPORT_VAR(qtd_allocate_double_array)
+QTD_EXPORT_VAR(qtd_assign_double_array_element)
+QTD_EXPORT_VAR(qtd_get_double_from_array)
+
+QTD_EXPORT_VAR(qtd_allocate_string_array)
+QTD_EXPORT_VAR(qtd_assign_string_array_element)
+QTD_EXPORT_VAR(qtd_string_from_array)
+QTD_EXPORT_VAR(qtd_get_string_from_array)
+
+extern "C" DLL_PUBLIC void qtd_core_ArrayOps_initCallBacks(pfunc_abstr *callbacks)
+{
+    QTD_EXPORT_VAR_SET(qtd_allocate_int_array, callbacks[0]);
+    QTD_EXPORT_VAR_SET(qtd_assign_int_array_element, callbacks[1]);
+    QTD_EXPORT_VAR_SET(qtd_get_int_from_array, callbacks[2]);
+    
+    QTD_EXPORT_VAR_SET(qtd_allocate_uint_array, callbacks[3]);
+    QTD_EXPORT_VAR_SET(qtd_assign_uint_array_element, callbacks[4]);
+    QTD_EXPORT_VAR_SET(qtd_get_uint_from_array, callbacks[5]);
+    
+    QTD_EXPORT_VAR_SET(qtd_allocate_double_array, callbacks[6]);
+    QTD_EXPORT_VAR_SET(qtd_assign_double_array_element, callbacks[7]);
+    QTD_EXPORT_VAR_SET(qtd_get_double_from_array, callbacks[8]);
+    
+    QTD_EXPORT_VAR_SET(qtd_allocate_string_array, callbacks[9]);
+    QTD_EXPORT_VAR_SET(qtd_assign_string_array_element, callbacks[10]);
+    QTD_EXPORT_VAR_SET(qtd_string_from_array, callbacks[11]);
+    QTD_EXPORT_VAR_SET(qtd_get_string_from_array, callbacks[12]);
+}
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpp/qt_qtd/CMakeLists.txt	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,8 @@
+PROJECT(QT_CORE_CPP CXX)
+# source files
+
+SET(QT_QTD_SRCS
+qtd_core.cpp
+)
+
+ADD_LIBRARY(qt_qtd_cpp STATIC ${QT_QTD_SRCS})
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpp/qt_qtd/qtd_core.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,41 @@
+/**
+*
+*  Copyright: Copyright QtD Team, 2008-2009
+*  License: <a href="http://www.boost.org/LICENSE_1_0.txt>Boost License 1.0</a>
+*
+*  Copyright QtD Team, 2008-2009
+*  Distributed under the Boost Software License, Version 1.0.
+*  (See accompanying file boost-license-1.0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+*
+*/
+
+#include "qtd_core.h"
+#include <iostream>
+
+extern "C" DLL_PUBLIC QModelIndex qtd_to_QModelIndex(QModelIndexAccessor mia)
+{
+    return * (QModelIndex *) (&mia) ;
+}
+
+extern "C" DLL_PUBLIC QModelIndexAccessor qtd_from_QModelIndex(const QModelIndex &index)
+{
+    QModelIndexAccessor mia = {
+        index.row(),
+        index.column(),
+        index.internalPointer(),
+        (QAbstractItemModel *) index.model()
+    };
+
+    return mia;
+}
+
+#ifdef CPP_SHARED
+QTD_EXPORT_VAR(_d_toUtf8)
+QTD_EXPORT_VAR(__qtd_dummy)
+
+extern "C" DLL_PUBLIC void __qtd_qtd_core_initCallBacks(pfunc_abstr d_func, pfunc_abstr dummy) {
+    QTD_EXPORT_VAR_SET(_d_toUtf8, d_func);
+    QTD_EXPORT_VAR_SET(__qtd_dummy, dummy);
+//    std::cout << _d_toUtf8 << "\n";
+}
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/demos/interview/README	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,2 @@
+The interview example shows the same model and selection being shared
+between three different views.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/demos/interview/build	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,3 @@
+#! /bin/bash
+
+dmd main.d model.d -L-L../../lib -L-lqtdgui -L-lqtdcore -I../../ -L-lQtGui -L-lQtCore
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/demos/interview/build.bat	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,1 @@
+dmd main.d model.d libqtdcore.lib libqtdgui.lib -I../../
\ No newline at end of file
Binary file demos/interview/images/folder.png has changed
Binary file demos/interview/images/interview.png has changed
Binary file demos/interview/images/services.png has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/demos/interview/main.d	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,96 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the demonstration applications of the Qt Toolkit.
+**
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+** exception, Nokia gives you certain additional rights. These rights
+** are described in the Nokia Qt GPL Exception version 1.3, included in
+** the file GPL_EXCEPTION.txt in this package.
+**
+** Qt for Windows(R) Licensees
+** As a special exception, Nokia, as the sole copyright holder for Qt
+** Designer, grants users of the Qt/Eclipse Integration plug-in the
+** right for the Qt/Eclipse Integration to link to functionality
+** provided by Qt Designer and its related libraries.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+****************************************************************************/
+
+import model;
+
+import qt.gui.QApplication;
+import qt.gui.QItemSelectionModel;
+import qt.gui.QSplitter;
+import qt.gui.QTreeView;
+import qt.gui.QHeaderView;
+import qt.gui.QTableView;
+import qt.gui.QTreeView;
+import qt.gui.QListView;
+import qt.gui.QIcon;
+import qt.gui.QPixmap;
+
+
+int main(char[][] args)
+{
+//    Q_INIT_RESOURCE(interview);
+
+    scope app = new QApplication(args);
+    scope page = new QSplitter;
+
+    scope data = new Model(1000, 10); //parent = page
+    scope selections = new QItemSelectionModel(data);
+
+    scope table = new QTableView;
+    table.setModel(data);
+    table.setSelectionModel(selections);
+	table.horizontalHeader.setMovable(true);
+	table.verticalHeader.setMovable(true);
+    // Set StaticContents to enable minimal repaints on resizes.
+    table.viewport.setAttribute(Qt.WA_StaticContents);
+    page.addWidget(table);
+
+    scope tree = new QTreeView;
+    tree.setModel(data);
+    tree.setSelectionModel(selections);
+    tree.setUniformRowHeights(true);
+    tree.header.setStretchLastSection(false);
+    tree.viewport.setAttribute(Qt.WA_StaticContents);
+    // Disable the focus rect to get minimal repaints when scrolling on Mac.
+    tree.setAttribute(Qt.WA_MacShowFocusRect, false);
+    page.addWidget(tree);
+
+    scope list = new QListView;
+    list.setModel(data);
+    list.setSelectionModel(selections);
+    list.setViewMode(QListView.IconMode);
+    list.setSelectionMode(QAbstractItemView.ExtendedSelection);
+    list.setAlternatingRowColors(false);
+    list.viewport.setAttribute(Qt.WA_StaticContents);
+    list.setAttribute(Qt.WA_MacShowFocusRect, false);
+    page.addWidget(list);
+
+    page.setWindowIcon(new QIcon(new QPixmap("images/interview.png")));
+    page.setWindowTitle("Interview");
+    page.show();
+
+    return app.exec();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/demos/interview/model.d	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,183 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the demonstration applications of the Qt Toolkit.
+**
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+** exception, Nokia gives you certain additional rights. These rights
+** are described in the Nokia Qt GPL Exception version 1.3, included in
+** the file GPL_EXCEPTION.txt in this package.
+**
+** Qt for Windows(R) Licensees
+** As a special exception, Nokia, as the sole copyright holder for Qt
+** Designer, grants users of the Qt/Eclipse Integration plug-in the
+** right for the Qt/Eclipse Integration to link to functionality
+** provided by Qt Designer and its related libraries.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+****************************************************************************/
+
+module model;
+
+import qt.gui.QIcon;
+import qt.gui.QPixmap;
+import qt.gui.QFileIconProvider;
+
+import qt.core.QAbstractItemModel;
+import qt.core.QVariant;
+import qt.core.QModelIndex;
+
+import tango.core.Array;
+import Integer = tango.text.convert.Integer;
+
+import tango.io.Stdout;
+
+    class Node
+    {
+        this(Node parent_ = null)
+        {
+            parent = parent_;
+        }
+        
+        Node parent;
+        Node[] children;
+    }
+    
+class Model : QAbstractItemModel
+{
+
+    this(int rows, int columns, QObject parent = null)
+    {
+        super(parent);
+        rc = rows;
+        cc = columns;
+        tree = new Node[rows];
+        foreach(ref node; tree) {
+            node = new Node;
+        }
+        
+        iconProvider = new QFileIconProvider;
+        
+        folder = iconProvider.icon(QFileIconProvider.Folder);
+        file = iconProvider.icon(QFileIconProvider.File);
+        services = new QIcon("images/services.png");
+    }
+
+
+    QModelIndex index(int row, int column, QModelIndex parent)
+    {
+        if (row < rc && row >= 0 && column < cc && column >= 0) {
+            Node p = cast(Node) parent.internalPointer();
+            Node n = getNode(row, p);
+        if (n !is null)
+            return createIndex(row, column, cast(void*)n);
+        }
+        return QModelIndex();
+    }
+
+    QModelIndex parent(QModelIndex child)
+    {
+        if (child.isValid()) {
+            Node n = cast(Node) child.internalPointer();
+            Node p = parent(n);
+            if (p !is null)
+                return createIndex(row(p), 0, cast(void*)p);
+        }
+        return QModelIndex();
+    }
+
+    int rowCount(QModelIndex parent)
+    {
+        return (parent.isValid() && parent.column() != 0) ? 0 : rc;
+    }
+
+    int columnCount(QModelIndex parent)
+    {
+        return cc;
+    }
+    
+    QVariant data(QModelIndex index, int role)
+    {
+        if (!index.isValid)
+            return new QVariant;
+        if (role == Qt.DisplayRole)
+            return new QVariant("Item " ~ Integer.toString(index.row) ~ ":" ~ Integer.toString(index.column));
+        if (role == Qt.DecorationRole) {
+            if (index.column == 0)
+                //return iconProvider.icon(QFileIconProvider::Folder);
+                return folder.toVariant;
+            return file.toVariant;
+        }
+        return new QVariant;
+    }
+    
+    QVariant headerData(int section, Qt.Orientation orientation, int role)
+    {
+        if (role == Qt.DisplayRole)
+            return new QVariant(Integer.toString(section));
+        if (role == Qt.DecorationRole)
+            return services.toVariant;
+        return QAbstractItemModel.headerData(section, orientation, role);
+    }
+
+    bool hasChildren(QModelIndex parent)
+    {
+        if (parent.isValid && parent.column != 0)
+            return false;
+        return rc > 0 && cc > 0;
+    }
+    
+    int flags(QModelIndex index)
+    {
+        if (!index.isValid)
+            return 0;
+        return (Qt.ItemIsDragEnabled | Qt.ItemIsSelectable | Qt.ItemIsEnabled);
+    }
+
+    Node getNode(int row, Node parent)
+    {
+        if(parent !is null && parent.children.length == 0) {
+            for(int i = 0; i < rc; i++)
+                parent.children ~= new Node(parent);
+        }
+
+        Node[] v = parent !is null ? parent.children : tree;
+        return v[row];
+    }
+
+    Node parent(Node child)
+    {
+        return child !is null ? child.parent : null;
+    }
+    
+    int row(Node node)
+    {
+        Node[] v = node.parent !is null ? node.parent.children : tree;
+        return find(v, node);
+    }
+
+
+    int rc, cc;
+    Node[] tree;
+    QFileIconProvider iconProvider;
+    
+    QIcon folder, services, file;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/itemviews/dirview/build	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,4 @@
+#! /bin/bash
+#rcc mainwindow.qrc -o mainwindow_rcc.cpp
+#g++ -c -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I/usr/X11R6/include mainwindow_rcc.cpp
+dmd main.d -I../../../ -L-L../../../lib -L-lqtdgui -L-lqtdcore -L-lQtCore -L-lQtGui
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/itemviews/dirview/build.bat	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,1 @@
+dmd main.d libqtdcore.lib libqtdgui.lib -I../../../
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/itemviews/dirview/main.d	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the demonstration applications of the Qt Toolkit.
+**
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+** exception, Nokia gives you certain additional rights. These rights
+** are described in the Nokia Qt GPL Exception version 1.3, included in
+** the file GPL_EXCEPTION.txt in this package.
+**
+** Qt for Windows(R) Licensees
+** As a special exception, Nokia, as the sole copyright holder for Qt
+** Designer, grants users of the Qt/Eclipse Integration plug-in the
+** right for the Qt/Eclipse Integration to link to functionality
+** provided by Qt Designer and its related libraries.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+****************************************************************************/
+
+import qt.gui.QApplication;
+import qt.gui.QDirModel;
+import qt.gui.QTreeView;
+
+int main(char[][] args)
+{
+    scope app = new QApplication(args);
+
+    auto model = new QDirModel;
+    scope tree = new QTreeView;
+    tree.setModel(model);
+
+    // Demonstrating look and feel features
+    tree.setAnimated(false);
+    tree.setIndentation(20);
+    tree.setSortingEnabled(true);
+
+    tree.setWindowTitle("Dir View");
+    tree.resize(640, 480);
+    tree.show();
+
+    return app.exec();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/mainwindows/README	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,40 @@
+All the standard features of application main windows are provided by Qt.
+
+Main windows can have pull down menus, tool bars, and dock windows. These
+separate forms of user input are unified in an integrated action system that
+also supports keyboard shortcuts and accelerator keys in menu items.
+
+
+The example launcher provided with Qt can be used to explore each of the
+examples in this directory.
+
+Documentation for these examples can be found via the Tutorial and Examples
+link in the main Qt documentation.
+
+
+Finding the Qt Examples and Demos launcher
+==========================================
+
+On Windows:
+
+The launcher can be accessed via the Windows Start menu. Select the menu
+entry entitled "Qt Examples and Demos" entry in the submenu containing
+the Qt tools.
+
+On Mac OS X:
+
+For the binary distribution, the qtdemo executable is installed in the
+/Developer/Applications/Qt directory. For the source distribution, it is
+installed alongside the other Qt tools on the path specified when Qt is
+configured.
+
+On Unix/Linux:
+
+The qtdemo executable is installed alongside the other Qt tools on the path
+specified when Qt is configured.
+
+On all platforms:
+
+The source code for the launcher can be found in the demos/qtdemo directory
+in the Qt package. This example is built at the same time as the Qt libraries,
+tools, examples, and demonstrations.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/mainwindows/dockwidgets/build	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,4 @@
+#! /bin/bash
+#rcc mainwindow.qrc -o mainwindow_rcc.cpp
+#g++ -c -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I/usr/X11R6/include mainwindow_rcc.cpp
+dmd main.d mainwindow.d -I../../../ -L-L../../../lib -L-lqtdgui -L-lqtdcore -L-lQtCore -L-lQtGui
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/mainwindows/dockwidgets/build.bat	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,1 @@
+dmd main.d mainwindow.d libqtdcore.lib libqtdgui.lib -I../../../
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/mainwindows/dockwidgets/dockwidgets.pro	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,10 @@
+HEADERS         = mainwindow.h
+SOURCES         = main.cpp \
+                  mainwindow.cpp
+RESOURCES       = dockwidgets.qrc
+
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/mainwindows/dockwidgets
+sources.files = $$SOURCES $$HEADERS $$RESOURCES dockwidgets.pro images
+sources.path = $$[QT_INSTALL_EXAMPLES]/mainwindows/dockwidgets
+INSTALLS += target sources
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/mainwindows/dockwidgets/dockwidgets.qrc	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,8 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+    <file>images/new.png</file>
+    <file>images/print.png</file>
+    <file>images/save.png</file>
+    <file>images/undo.png</file>
+</qresource>
+</RCC>
Binary file examples/mainwindows/dockwidgets/images/new.png has changed
Binary file examples/mainwindows/dockwidgets/images/print.png has changed
Binary file examples/mainwindows/dockwidgets/images/save.png has changed
Binary file examples/mainwindows/dockwidgets/images/undo.png has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/mainwindows/dockwidgets/main.d	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,49 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the example classes of the Qt Toolkit.
+**
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+** exception, Nokia gives you certain additional rights. These rights
+** are described in the Nokia Qt GPL Exception version 1.3, included in
+** the file GPL_EXCEPTION.txt in this package.
+**
+** Qt for Windows(R) Licensees
+** As a special exception, Nokia, as the sole copyright holder for Qt
+** Designer, grants users of the Qt/Eclipse Integration plug-in the
+** right for the Qt/Eclipse Integration to link to functionality
+** provided by Qt Designer and its related libraries.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+****************************************************************************/
+
+import qt.gui.QApplication;
+import mainwindow;
+
+
+int main(char[][] args)
+{
+    scope app = new QApplication(args);
+    //    Q_INIT_RESOURCE(dockwidgets);
+    scope mainWin = new MainWindow;
+    mainWin.show();
+    return app.exec();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/mainwindows/dockwidgets/mainwindow.d	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,358 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the example classes of the Qt Toolkit.
+**
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+** exception, Nokia gives you certain additional rights. These rights
+** are described in the Nokia Qt GPL Exception version 1.3, included in
+** the file GPL_EXCEPTION.txt in this package.
+**
+** Qt for Windows(R) Licensees
+** As a special exception, Nokia, as the sole copyright holder for Qt
+** Designer, grants users of the Qt/Eclipse Integration plug-in the
+** right for the Qt/Eclipse Integration to link to functionality
+** provided by Qt Designer and its related libraries.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+****************************************************************************/
+
+
+import qt.gui.QMainWindow;
+
+import qt.gui.QListWidget;
+import qt.gui.QMenu;
+import qt.gui.QToolBar;
+import qt.gui.QDockWidget;
+import qt.gui.QListWidget;
+import qt.gui.QMessageBox;
+import qt.gui.QTextEdit;
+import qt.gui.QTextCursor;
+import qt.gui.QTextFrame;
+import qt.gui.QTextFrameFormat;
+import qt.gui.QTextCharFormat;
+import qt.gui.QTextTableFormat;
+import qt.gui.QAction;
+import qt.gui.QStatusBar;
+import qt.gui.QFont;
+import qt.gui.QIcon;
+
+import qt.core.QDate;
+/*import qt.gui.
+import qt.gui.
+import qt.gui.
+import qt.gui.
+import qt.gui.
+import qt.gui.
+*/
+import tango.text.Util;
+import tango.io.Stdout;
+
+class MainWindow : public QMainWindow
+{
+//    Q_OBJECT
+
+    public:
+        this()
+        {
+            textEdit = new QTextEdit;
+            setCentralWidget(textEdit);
+
+            createActions();
+            createMenus();
+            createToolBars();
+            createStatusBar();
+            createDockWindows();
+
+            setWindowTitle(tr("Dock Widgets"));
+            newLetter();
+        }
+
+    private : //slots:
+        void newLetter()
+        {
+            textEdit.clear();
+
+            scope cursor = textEdit.textCursor;
+            cursor.movePosition(QTextCursor.Start);
+            QTextFrame topFrame = cursor.currentFrame();
+            QTextFrameFormat topFrameFormat = topFrame.frameFormat();
+            topFrameFormat.setPadding(16);
+            topFrame.setFrameFormat(topFrameFormat);
+
+            scope textFormat = new QTextCharFormat;
+            scope boldFormat = new QTextCharFormat;
+            scope italicFormat = new QTextCharFormat;
+            boldFormat.setFontWeight(QFont.Bold);
+            italicFormat.setFontItalic(true);
+
+            scope tableFormat = new QTextTableFormat;
+            tableFormat.setBorder(1);
+            tableFormat.setCellPadding(16);
+            tableFormat.setAlignment(Qt.AlignRight);
+            cursor.insertTable(1, 1, tableFormat);
+            cursor.insertText("The Firm", boldFormat);
+            cursor.insertBlock();
+            cursor.insertText("321 City Street", textFormat);
+            cursor.insertBlock();
+            cursor.insertText("Industry Park");
+            cursor.insertBlock();
+            cursor.insertText("Some Country");
+            cursor.setPosition(topFrame.lastPosition());
+            cursor.insertText(QDate.currentDate.toString("d MMMM yyyy"), textFormat);
+            cursor.insertBlock();
+            cursor.insertBlock();
+            cursor.insertText("Dear ", textFormat);
+            cursor.insertText("NAME", italicFormat);
+            cursor.insertText(",", textFormat);
+            for (int i = 0; i < 3; ++i)
+                cursor.insertBlock();
+            cursor.insertText(tr("Yours sincerely,"), textFormat);
+            for (int i = 0; i < 3; ++i)
+                cursor.insertBlock();
+            cursor.insertText("The Boss", textFormat);
+            cursor.insertBlock();
+            cursor.insertText("ADDRESS", italicFormat);
+        }
+/*
+        void save()
+        {
+            char[] fileName = QFileDialog.getSaveFileName(this,
+                                                          tr("Choose a file name"), ".",
+                                                          tr("HTML (*.html *.htm)"));
+            if (fileName.isEmpty())
+                return;
+            scope file = new QFile(fileName);
+            if (!file.open(QFile.WriteOnly | QFile.Text)) {
+                QMessageBox.warning(this, tr("Dock Widgets"),
+                                    tr(layout("Cannot write file %1:\n%2.", fileName, file.errorString))
+                return;
+            }
+
+            scope outStream = new QTextStream(file);
+            QApplication.setOverrideCursor(Qt.WaitCursor);
+            outStream << textEdit.toHtml();
+            QApplication.restoreOverrideCursor();
+
+            statusBar.showMessage(layout("Saved '%1'", fileName), 2000);
+        }*/
+
+        void print() { }
+
+        void undo() {
+            auto document = textEdit.document();
+            document.undo();
+        }
+
+        void insertCustomer(char[] customer)
+        {
+            if (customer == "")
+                return;
+            char[][] customerList = customer.split(", ");
+            auto document = textEdit.document();
+            QTextCursor cursor = document.find("NAME");
+            if (!cursor.isNull) {
+                cursor.beginEditBlock();
+                cursor.insertText(customerList[0]);
+                scope oldcursor = new QTextCursor(cursor);
+                cursor = document.find("ADDRESS");
+                if (!cursor.isNull) {
+                    for (int i = 1; i < customerList.length; ++i) {
+                        cursor.insertBlock();
+                        cursor.insertText(customerList[i]);
+                    }
+                    cursor.endEditBlock();
+                }
+                else
+                    oldcursor.endEditBlock();
+            }
+        }
+
+        void addParagraph(char[] paragraph)
+        {
+            if (paragraph == "")
+                return;
+            auto document = textEdit.document();
+            scope cursor = document.find(tr("Yours sincerely,"));
+            if (cursor.isNull)
+                return;
+            cursor.beginEditBlock();
+            cursor.movePosition(QTextCursor.PreviousBlock, QTextCursor.MoveAnchor, 2);
+            cursor.insertBlock();
+            cursor.insertText(paragraph);
+            cursor.insertBlock();
+            cursor.endEditBlock();
+
+        }
+
+        void about()
+        {
+            QMessageBox.about(this, "About Dock Widgets",
+                               "The <b>Dock Widgets</b> example demonstrates how to "
+                               "use Qt's dock widgets. You can enter your own text, "
+                               "click a customer to add a customer name and "
+                               "address, and click standard paragraphs to add them.");
+        }
+
+    private:
+        void createActions()
+        {
+            newLetterAct = new QAction(new QIcon("images/new.png"), tr("&New Letter"), this);
+            newLetterAct.setShortcut(tr("Ctrl+N"));
+            newLetterAct.setStatusTip(tr("Create a new form letter"));
+            newLetterAct.triggered.connect(&this.newLetter);
+
+            saveAct = new QAction(new QIcon("images/save.png"), tr("&Save..."), this);
+            saveAct.setShortcut(tr("Ctrl+S"));
+            saveAct.setStatusTip(tr("Save the current form letter"));
+            // saveAct.triggered.connect(&save);
+
+            printAct = new QAction(new QIcon("images/print.png"), tr("&Print..."), this);
+            printAct.setShortcut(tr("Ctrl+P"));
+            printAct.setStatusTip(tr("Print the current form letter"));
+            // printAct.triggered.connect(&print);
+
+            undoAct = new QAction(new QIcon("images/undo.png"), tr("&Undo"), this);
+            undoAct.setShortcut(tr("Ctrl+Z"));
+            undoAct.setStatusTip(tr("Undo the last editing action"));
+            undoAct.triggered.connect(&undo);
+
+            quitAct = new QAction(tr("&Quit"), this);
+            quitAct.setShortcut(tr("Ctrl+Q"));
+            quitAct.setStatusTip(tr("Quit the application"));
+            quitAct.triggered.connect(&this.close);
+
+            aboutAct = new QAction(tr("&About"), this);
+            aboutAct.setStatusTip(tr("Show the application's About box"));
+            aboutAct.triggered.connect(&about);
+
+            aboutQtAct = new QAction(tr("About &Qt"), this);
+            aboutQtAct.setStatusTip(tr("Show the Qt library's About box"));
+            // aboutQtAct.triggered(&aboutQt);
+        }
+
+        void createMenus()
+        {
+            fileMenu = menuBar.addMenu(tr("&File"));
+            fileMenu.addAction(newLetterAct);
+            fileMenu.addAction(saveAct);
+            fileMenu.addAction(printAct);
+            fileMenu.addSeparator();
+            fileMenu.addAction(quitAct);
+
+            editMenu = menuBar.addMenu(tr("&Edit"));
+            editMenu.addAction(undoAct);
+
+            viewMenu = menuBar.addMenu(tr("&View"));
+
+            menuBar().addSeparator();
+
+            helpMenu = menuBar.addMenu(tr("&Help"));
+            helpMenu.addAction(aboutAct);
+            helpMenu.addAction(aboutQtAct);
+        }
+
+        void createToolBars()
+        {
+            fileToolBar = addToolBar(tr("File"));
+            fileToolBar.addAction(newLetterAct);
+            fileToolBar.addAction(saveAct);
+            fileToolBar.addAction(printAct);
+
+            editToolBar = addToolBar(tr("Edit"));
+            editToolBar.addAction(undoAct);
+        }
+
+        void createStatusBar()
+        {
+            statusBar.showMessage(tr("Ready"));
+        }
+
+        void createDockWindows()
+        {
+            QDockWidget dock = new QDockWidget(tr("Customers"), this);
+            dock.setAllowedAreas(Qt.LeftDockWidgetArea | Qt.RightDockWidgetArea);
+            customerList = new QListWidget(dock);
+            customerList.addItems([
+                "John Doe, Harmony Enterprises, 12 Lakeside, Ambleton",
+                "Jane Doe, Memorabilia, 23 Watersedge, Beaton",
+                "Tammy Shea, Tiblanka, 38 Sea Views, Carlton",
+                "Tim Sheen, Caraba Gifts, 48 Ocean Way, Deal",
+                "Sol Harvey, Chicos Coffee, 53 New Springs, Eccleston",
+                "Sally Hobart, Tiroli Tea, 67 Long River, Fedula"]);
+            dock.setWidget(customerList);
+            addDockWidget(Qt.RightDockWidgetArea, dock);
+            viewMenu.addAction(dock.toggleViewAction());
+
+            dock = new QDockWidget(tr("Paragraphs"), this);
+            paragraphsList = new QListWidget(dock);
+            paragraphsList.addItems([
+                "Thank you for your payment which we have received today.",
+                "Your order has been dispatched and should be with you "
+                "within 28 days.",
+
+                "We have dispatched those items that were in stock. The "
+                "rest of your order will be dispatched once all the "
+                "remaining items have arrived at our warehouse. No "
+                "additional shipping charges will be made.",
+
+                "You made a small overpayment (less than $5) which we "
+                "will keep on account for you, or return at your request.",
+
+                "You made a small underpayment (less than $1), but we have "
+                "sent your order anyway. We'll add this underpayment to "
+                "your next bill.",
+
+                "Unfortunately you did not send enough money. Please remit "
+                "an additional $. Your order will be dispatched as soon as "
+                "the complete amount has been received.",
+
+                "You made an overpayment (more than $5). Do you wish to "
+                "buy more items, or should we return the excess to you?"]);
+            dock.setWidget(paragraphsList);
+            addDockWidget(Qt.RightDockWidgetArea, dock);
+            viewMenu.addAction(dock.toggleViewAction());
+
+            customerList.currentTextChanged.connect(&this.insertCustomer);
+            paragraphsList.currentTextChanged.connect(&this.addParagraph);
+        }
+
+        QTextEdit textEdit;
+        QListWidget customerList;
+        QListWidget paragraphsList;
+
+        QMenu fileMenu;
+        QMenu editMenu;
+        QMenu viewMenu;
+        QMenu helpMenu;
+        QToolBar fileToolBar;
+        QToolBar editToolBar;
+        QAction newLetterAct;
+        QAction saveAct;
+        QAction printAct;
+        QAction undoAct;
+        QAction aboutAct;
+        QAction aboutQtAct;
+        QAction quitAct;
+}
+
+
+//! [9]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/mainwindows/mainwindows.pro	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,13 @@
+TEMPLATE      = subdirs
+SUBDIRS       = application \
+                dockwidgets \
+                mdi \
+                menus \
+                recentfiles \
+                sdi
+
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/mainwindows
+sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS mainwindows.pro README
+sources.path = $$[QT_INSTALL_EXAMPLES]/mainwindows
+INSTALLS += target sources
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/opengl/hellogl/build	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,4 @@
+#! /bin/bash
+#rcc mainwindow.qrc -o mainwindow_rcc.cpp
+#g++ -c -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I/usr/X11R6/include mainwindow_rcc.cpp
+dmd main.d window.d glwidget.d opengl/gl.d opengl/glu.d -L-L../../../lib -I../../../ -L-lqtdgui -L-lqtdcore -L-lqtdopengl -L-lQtGui -L-lQtCore -L-lQtOpenGL -L-lGLU
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/opengl/hellogl/build.bat	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,1 @@
+dmd main.d window.d glwidget.d libqtdgui.lib libqtdcore.lib libqtdopengl.lib opengl32.lib glu32.lib -I../../../
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/opengl/hellogl/glwidget.d	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,268 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the example classes of the Qt Toolkit.
+**
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+** exception, Nokia gives you certain additional rights. These rights
+** are described in the Nokia Qt GPL Exception version 1.3, included in
+** the file GPL_EXCEPTION.txt in this package.
+**
+** Qt for Windows(R) Licensees
+** As a special exception, Nokia, as the sole copyright holder for Qt
+** Designer, grants users of the Qt/Eclipse Integration plug-in the
+** right for the Qt/Eclipse Integration to link to functionality
+** provided by Qt Designer and its related libraries.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+****************************************************************************/
+
+
+import tango.math.Math;
+
+import qt.core.QPoint;
+import qt.gui.QMouseEvent;
+import qt.opengl.QGLWidget;
+import qt.gui.QColor;
+import qt.core.QSize;
+
+import qt.opengl.gl;
+import qt.opengl.glu;
+
+class GLWidget : QGLWidget
+{
+//    Q_OBJECT
+
+    public:
+        this(QWidget parent = null)
+        {
+            super(parent);
+            object = 0;
+            xRot = 0;
+            yRot = 0;
+            zRot = 0;
+
+            trolltechGreen = QColor.fromCmykF(0.40, 0.0, 1.0, 0.0);
+            trolltechPurple = QColor.fromCmykF(0.39, 0.39, 0.0, 0.0);
+        }
+
+        ~this()
+        {
+            makeCurrent();
+            glDeleteLists(object, 1);
+        }
+
+        QSize minimumSizeHint()
+        {
+            return QSize(50, 50);
+        }
+
+        QSize sizeHint()
+        {
+            return QSize(400, 400);
+        }
+
+
+    public: // slots:
+        void setXRotation(int angle)
+        {
+            normalizeAngle(&angle);
+            if (angle != xRot) {
+                xRot = angle;
+                xRotationChanged.emit(angle);
+                updateGL();
+            }
+        }
+
+        void setYRotation(int angle)
+        {
+            normalizeAngle(&angle);
+            if (angle != yRot) {
+                yRot = angle;
+                yRotationChanged.emit(angle);
+                updateGL();
+            }
+        }
+
+        void setZRotation(int angle)
+        {
+            normalizeAngle(&angle);
+            if (angle != zRot) {
+                zRot = angle;
+                zRotationChanged.emit(angle);
+                updateGL();
+            }
+        }
+
+        mixin Signal!("xRotationChanged", int);
+        mixin Signal!("yRotationChanged", int);
+        mixin Signal!("zRotationChanged", int);
+
+
+    protected:
+        void initializeGL()
+        {
+            qglClearColor(trolltechPurple.darker());
+            object = makeObject();
+            glShadeModel(GL_FLAT);
+            glEnable(GL_DEPTH_TEST);
+            glEnable(GL_CULL_FACE);
+        }
+
+        void paintGL()
+        {
+            glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+            glLoadIdentity();
+            glTranslated(0.0, 0.0, -10.0);
+            glRotated(xRot / 16.0, 1.0, 0.0, 0.0);
+            glRotated(yRot / 16.0, 0.0, 1.0, 0.0);
+            glRotated(zRot / 16.0, 0.0, 0.0, 1.0);
+            glCallList(object);
+        }
+
+        void resizeGL(int width, int height)
+        {
+            int side = qMin(width, height);
+            glViewport((width - side) / 2, (height - side) / 2, side, side);
+
+            glMatrixMode(GL_PROJECTION);
+            glLoadIdentity();
+            glOrtho(-0.5, +0.5, +0.5, -0.5, 4.0, 15.0);
+            glMatrixMode(GL_MODELVIEW);
+        }
+
+        void mousePressEvent(QMouseEvent event)
+        {
+            lastPos = QPoint(event.pos.x, event.pos.y);
+        }
+
+        void mouseMoveEvent(QMouseEvent event)
+        {
+            int dx = event.x - lastPos.x;
+            int dy = event.y - lastPos.y;
+
+            if (event.buttons() & Qt.LeftButton) {
+                setXRotation(xRot + 8 * dy);
+                setYRotation(yRot + 8 * dx);
+            } else if (event.buttons() & Qt.RightButton) {
+                setXRotation(xRot + 8 * dy);
+                setZRotation(zRot + 8 * dx);
+            }
+            lastPos = QPoint(event.pos.x, event.pos.y);
+        }
+    private:
+        GLuint makeObject()
+        {
+            GLuint list = glGenLists(1);
+            glNewList(list, GL_COMPILE);
+
+            glBegin(GL_QUADS);
+
+            GLdouble x1 = +0.06;
+            GLdouble y1 = -0.14;
+            GLdouble x2 = +0.14;
+            GLdouble y2 = -0.06;
+            GLdouble x3 = +0.08;
+            GLdouble y3 = +0.00;
+            GLdouble x4 = +0.30;
+            GLdouble y4 = +0.22;
+
+            quad(x1, y1, x2, y2, y2, x2, y1, x1);
+            quad(x3, y3, x4, y4, y4, x4, y3, x3);
+
+            extrude(x1, y1, x2, y2);
+            extrude(x2, y2, y2, x2);
+            extrude(y2, x2, y1, x1);
+            extrude(y1, x1, x1, y1);
+            extrude(x3, y3, x4, y4);
+            extrude(x4, y4, y4, x4);
+            extrude(y4, x4, y3, x3);
+
+            const double Pi = 3.14159265358979323846;
+            const int NumSectors = 200;
+
+            for (int i = 0; i < NumSectors; ++i) {
+                double angle1 = (i * 2 * Pi) / NumSectors;
+                GLdouble x5 = 0.30 * sin(angle1);
+                GLdouble y5 = 0.30 * cos(angle1);
+                GLdouble x6 = 0.20 * sin(angle1);
+                GLdouble y6 = 0.20 * cos(angle1);
+
+                double angle2 = ((i + 1) * 2 * Pi) / NumSectors;
+                GLdouble x7 = 0.20 * sin(angle2);
+                GLdouble y7 = 0.20 * cos(angle2);
+                GLdouble x8 = 0.30 * sin(angle2);
+                GLdouble y8 = 0.30 * cos(angle2);
+
+                quad(x5, y5, x6, y6, x7, y7, x8, y8);
+
+                extrude(x6, y6, x7, y7);
+                extrude(x8, y8, x5, y5);
+            }
+
+            glEnd();
+
+            glEndList();
+            return list;
+        }
+
+        void quad(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2,
+                   GLdouble x3, GLdouble y3, GLdouble x4, GLdouble y4)
+        {
+            qglColor(trolltechGreen);
+
+            glVertex3d(x1, y1, -0.05);
+            glVertex3d(x2, y2, -0.05);
+            glVertex3d(x3, y3, -0.05);
+            glVertex3d(x4, y4, -0.05);
+
+            glVertex3d(x4, y4, +0.05);
+            glVertex3d(x3, y3, +0.05);
+            glVertex3d(x2, y2, +0.05);
+            glVertex3d(x1, y1, +0.05);
+        }
+
+        void extrude(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2)
+        {
+            qglColor(trolltechGreen.darker(rndint(250 + (100 * x1))));
+
+            glVertex3d(x1, y1, +0.05);
+            glVertex3d(x2, y2, +0.05);
+            glVertex3d(x2, y2, -0.05);
+            glVertex3d(x1, y1, -0.05);
+        }
+
+        void normalizeAngle(int *angle)
+        {
+            while (*angle < 0)
+                *angle += 360 * 16;
+            while (*angle > 360 * 16)
+                *angle -= 360 * 16;
+        }
+
+        GLuint object;
+        int xRot;
+        int yRot;
+        int zRot;
+        QPoint lastPos;
+        QColor trolltechGreen;
+        QColor trolltechPurple;
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/opengl/hellogl/hellogl.pro	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,12 @@
+HEADERS       = glwidget.h \
+                window.h
+SOURCES       = glwidget.cpp \
+                main.cpp \
+                window.cpp
+QT           += opengl
+
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/opengl/hellogl
+sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS hellogl.pro
+sources.path = $$[QT_INSTALL_EXAMPLES]/opengl/hellogl
+INSTALLS += target sources
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/opengl/hellogl/main.d	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,48 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the example classes of the Qt Toolkit.
+**
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+** exception, Nokia gives you certain additional rights. These rights
+** are described in the Nokia Qt GPL Exception version 1.3, included in
+** the file GPL_EXCEPTION.txt in this package.
+**
+** Qt for Windows(R) Licensees
+** As a special exception, Nokia, as the sole copyright holder for Qt
+** Designer, grants users of the Qt/Eclipse Integration plug-in the
+** right for the Qt/Eclipse Integration to link to functionality
+** provided by Qt Designer and its related libraries.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+****************************************************************************/
+
+import qt.gui.QApplication;
+
+import window;
+
+int main(char[][] args)
+{
+    scope app = new QApplication(args);
+    scope window = new Window;
+    window.show();
+    return app.exec();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/opengl/hellogl/opengl/gl.d	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,7 @@
+module opengl.gl;
+
+public
+{
+    import opengl.gltypes;
+    import opengl.glfuncs;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/opengl/hellogl/opengl/glfuncs.d	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,441 @@
+module opengl.glfuncs;
+
+private import opengl.gltypes;
+
+
+extern (C)
+{
+void glVertexPointer(GLint,GLenum,GLsizei,GLvoid*);
+void glNormalPointer(GLenum,GLsizei,GLvoid*);
+void glColorPointer(GLint,GLenum,GLsizei,GLvoid*);
+void glIndexPointer(GLenum,GLsizei,GLvoid*);
+void glTexCoordPointer(GLint,GLenum,GLsizei,GLvoid*);
+void glEdgeFlagPointer(GLsizei,GLvoid*);
+void glGetPointerv(GLenum,GLvoid**);
+void glArrayElement(GLint);
+void glDrawArrays(GLenum,GLint,GLsizei);
+void glDrawElements(GLenum,GLsizei,GLenum,GLvoid*);
+void glInterleavedArrays(GLenum,GLsizei,GLvoid*);
+}
+
+
+/*
+extern (C)
+{
+	void glEnable(GLenum);
+	void glEnableClientState(GLenum);
+	void glDisableClientState(GLenum);
+	void glClear(GLbitfield);
+	void glLoadIdentity();
+	void glBegin(GLenum);
+	void glColor3f(GLfloat,GLfloat,GLfloat);
+	void glVertex3f(GLfloat,GLfloat,GLfloat);
+	void glEnd();
+	void glViewport(GLint,GLint,GLsizei,GLsizei);
+	void glMatrixMode(GLenum);
+	void glGetDoublev(GLenum,GLdouble*);
+	void glGetFloatv(GLenum,GLfloat*);
+	void glGetIntegerv(GLenum,GLint*);
+	void glScalef(GLfloat,GLfloat,GLfloat);
+	void glDeleteLists(GLuint, GLsizei);
+	void glShadeModel(GLenum);
+	void glTranslated(GLdouble, GLdouble, GLdouble);
+	void glTranslatef(GLfloat, GLfloat, GLfloat);
+	void glRotated(GLdouble, GLdouble, GLdouble, GLdouble);
+	void glCallList(GLuint);
+	void glOrtho (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
+	GLuint glGenLists (GLsizei range);
+}
+*/
+alias ptrdiff_t GLintptrARB;
+alias ptrdiff_t GLsizeiptrARB;
+
+enum : GLenum
+{
+    GL_BUFFER_SIZE_ARB                             = 0x8764,
+    GL_BUFFER_USAGE_ARB                            = 0x8765,
+    GL_ARRAY_BUFFER_ARB                            = 0x8892,
+    GL_ELEMENT_ARRAY_BUFFER_ARB                    = 0x8893,
+    GL_ARRAY_BUFFER_BINDING_ARB                    = 0x8894,
+    GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB            = 0x8895,
+    GL_VERTEX_ARRAY_BUFFER_BINDING_ARB             = 0x8896,
+    GL_NORMAL_ARRAY_BUFFER_BINDING_ARB             = 0x8897,
+    GL_COLOR_ARRAY_BUFFER_BINDING_ARB              = 0x8898,
+    GL_INDEX_ARRAY_BUFFER_BINDING_ARB              = 0x8899,
+    GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB      = 0x889A,
+    GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB          = 0x889B,
+    GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB    = 0x889C,
+    GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB     = 0x889D,
+    GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB             = 0x889E,
+    GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB      = 0x889F,
+    GL_READ_ONLY_ARB                               = 0x88B8,
+    GL_WRITE_ONLY_ARB                              = 0x88B9,
+    GL_READ_WRITE_ARB                              = 0x88BA,
+    GL_BUFFER_ACCESS_ARB                           = 0x88BB,
+    GL_BUFFER_MAPPED_ARB                           = 0x88BC,
+    GL_BUFFER_MAP_POINTER_ARB                      = 0x88BD,
+    GL_STREAM_DRAW_ARB                             = 0x88E0,
+    GL_STREAM_READ_ARB                             = 0x88E1,
+    GL_STREAM_COPY_ARB                             = 0x88E2,
+    GL_STATIC_DRAW_ARB                             = 0x88E4,
+    GL_STATIC_READ_ARB                             = 0x88E5,
+    GL_STATIC_COPY_ARB                             = 0x88E6,
+    GL_DYNAMIC_DRAW_ARB                            = 0x88E8,
+    GL_DYNAMIC_READ_ARB                            = 0x88E9,
+    GL_DYNAMIC_COPY_ARB                            = 0x88EA,
+}
+
+extern (C)
+{
+	void glBindBufferARB (GLenum target, GLuint buffer);
+	void glDeleteBuffersARB (GLsizei n, GLuint *buffers);
+	void glGenBuffersARB (GLsizei n, GLuint *buffers);
+	GLboolean glIsBufferARB (GLuint buffer);
+	void glBufferDataARB (GLenum target, GLsizeiptrARB size, GLvoid *data, GLenum usage);
+	void glBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data);
+	void glGetBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data);
+	GLvoid* glMapBufferARB (GLenum target, GLenum access);
+	GLboolean glUnmapBufferARB (GLenum target);
+	void glGetBufferParameterivARB (GLenum target, GLenum pname, GLint *params);
+	void glGetBufferPointervARB (GLenum target, GLenum pname, GLvoid* *params);
+}
+
+extern (C)
+{
+	void glAccum (GLenum op, GLfloat value);
+	void glAlphaFunc (GLenum func, GLclampf ref_);
+	GLboolean glAreTexturesResident (GLsizei n, GLuint *textures, GLboolean *residences);
+	void glArrayElement (GLint i);
+	void glBegin (GLenum mode);
+	void glBindTexture (GLenum target, GLuint texture);
+	void glBitmap (GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, GLubyte *bitmap);
+	void glBlendFunc (GLenum sfactor, GLenum dfactor);
+	void glCallList (GLuint list);
+	void glCallLists (GLsizei n, GLenum type, GLvoid *lists);
+	void glClear (GLbitfield mask);
+	void glClearAccum (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+	void glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+	void glClearDepth (GLclampd depth);
+	void glClearIndex (GLfloat c);
+	void glClearStencil (GLint s);
+	void glClipPlane (GLenum plane, GLdouble *equation);
+	void glColor3b (GLbyte red, GLbyte green, GLbyte blue);
+	void glColor3bv (GLbyte *v);
+	void glColor3d (GLdouble red, GLdouble green, GLdouble blue);
+	void glColor3dv (GLdouble *v);
+	void glColor3f (GLfloat red, GLfloat green, GLfloat blue);
+	void glColor3fv (GLfloat *v);
+	void glColor3i (GLint red, GLint green, GLint blue);
+	void glColor3iv (GLint *v);
+	void glColor3s (GLshort red, GLshort green, GLshort blue);
+	void glColor3sv (GLshort *v);
+	void glColor3ub (GLubyte red, GLubyte green, GLubyte blue);
+	void glColor3ubv (GLubyte *v);
+	void glColor3ui (GLuint red, GLuint green, GLuint blue);
+	void glColor3uiv (GLuint *v);
+	void glColor3us (GLushort red, GLushort green, GLushort blue);
+	void glColor3usv (GLushort *v);
+	void glColor4b (GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha);
+	void glColor4bv (GLbyte *v);
+	void glColor4d (GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha);
+	void glColor4dv (GLdouble *v);
+	void glColor4f (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+	void glColor4fv (GLfloat *v);
+	void glColor4i (GLint red, GLint green, GLint blue, GLint alpha);
+	void glColor4iv (GLint *v);
+	void glColor4s (GLshort red, GLshort green, GLshort blue, GLshort alpha);
+	void glColor4sv (GLshort *v);
+	void glColor4ub (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);
+	void glColor4ubv (GLubyte *v);
+	void glColor4ui (GLuint red, GLuint green, GLuint blue, GLuint alpha);
+	void glColor4uiv (GLuint *v);
+	void glColor4us (GLushort red, GLushort green, GLushort blue, GLushort alpha);
+	void glColor4usv (GLushort *v);
+	void glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
+	void glColorMaterial (GLenum face, GLenum mode);
+	void glColorPointer (GLint size, GLenum type, GLsizei stride, GLvoid *pointer);
+	void glCopyPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum type);
+	void glCopyTexImage1D (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border);
+	void glCopyTexImage2D (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+	void glCopyTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
+	void glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+	void glCullFace (GLenum mode);
+	void glDeleteLists (GLuint list, GLsizei range);
+	void glDeleteTextures (GLsizei n, GLuint *textures);
+	void glDepthFunc (GLenum func);
+	void glDepthMask (GLboolean flag);
+	void glDepthRange (GLclampd zNear, GLclampd zFar);
+	void glDisable (GLenum cap);
+	void glDisableClientState (GLenum array);
+	void glDrawArrays (GLenum mode, GLint first, GLsizei count);
+	void glDrawBuffer (GLenum mode);
+	void glDrawElements (GLenum mode, GLsizei count, GLenum type, GLvoid *indices);
+	void glDrawPixels (GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels);
+	void glEdgeFlag (GLboolean flag);
+	void glEdgeFlagPointer (GLsizei stride, GLvoid *pointer);
+	void glEdgeFlagv (GLboolean *flag);
+	void glEnable (GLenum cap);
+	void glEnableClientState (GLenum array);
+	void glEnd ();
+	void glEndList ();
+	void glEvalCoord1d (GLdouble u);
+	void glEvalCoord1dv (GLdouble *u);
+	void glEvalCoord1f (GLfloat u);
+	void glEvalCoord1fv (GLfloat *u);
+	void glEvalCoord2d (GLdouble u, GLdouble v);
+	void glEvalCoord2dv (GLdouble *u);
+	void glEvalCoord2f (GLfloat u, GLfloat v);
+	void glEvalCoord2fv (GLfloat *u);
+	void glEvalMesh1 (GLenum mode, GLint i1, GLint i2);
+	void glEvalMesh2 (GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2);
+	void glEvalPoint1 (GLint i);
+	void glEvalPoint2 (GLint i, GLint j);
+	void glFeedbackBuffer (GLsizei size, GLenum type, GLfloat *buffer);
+	void glFinish ();
+	void glFlush ();
+	void glFogf (GLenum pname, GLfloat param);
+	void glFogfv (GLenum pname, GLfloat *params);
+	void glFogi (GLenum pname, GLint param);
+	void glFogiv (GLenum pname, GLint *params);
+	void glFrontFace (GLenum mode);
+	void glFrustum (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
+	GLuint glGenLists (GLsizei range);
+	void glGenTextures (GLsizei n, GLuint *textures);
+	void glGetBooleanv (GLenum pname, GLboolean *params);
+	void glGetClipPlane (GLenum plane, GLdouble *equation);
+	void glGetDoublev (GLenum pname, GLdouble *params);
+	GLenum glGetError ();
+	void glGetFloatv (GLenum pname, GLfloat *params);
+	void glGetIntegerv (GLenum pname, GLint *params);
+	void glGetLightfv (GLenum light, GLenum pname, GLfloat *params);
+	void glGetLightiv (GLenum light, GLenum pname, GLint *params);
+	void glGetMapdv (GLenum target, GLenum query, GLdouble *v);
+	void glGetMapfv (GLenum target, GLenum query, GLfloat *v);
+	void glGetMapiv (GLenum target, GLenum query, GLint *v);
+	void glGetMaterialfv (GLenum face, GLenum pname, GLfloat *params);
+	void glGetMaterialiv (GLenum face, GLenum pname, GLint *params);
+	void glGetPixelMapfv (GLenum map, GLfloat *values);
+	void glGetPixelMapuiv (GLenum map, GLuint *values);
+	void glGetPixelMapusv (GLenum map, GLushort *values);
+	void glGetPointerv (GLenum pname, GLvoid* *params);
+	void glGetPolygonStipple (GLubyte *mask);
+	GLubyte * glGetString (GLenum name);
+	void glGetTexEnvfv (GLenum target, GLenum pname, GLfloat *params);
+	void glGetTexEnviv (GLenum target, GLenum pname, GLint *params);
+	void glGetTexGendv (GLenum coord, GLenum pname, GLdouble *params);
+	void glGetTexGenfv (GLenum coord, GLenum pname, GLfloat *params);
+	void glGetTexGeniv (GLenum coord, GLenum pname, GLint *params);
+	void glGetTexImage (GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels);
+	void glGetTexLevelParameterfv (GLenum target, GLint level, GLenum pname, GLfloat *params);
+	void glGetTexLevelParameteriv (GLenum target, GLint level, GLenum pname, GLint *params);
+	void glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params);
+	void glGetTexParameteriv (GLenum target, GLenum pname, GLint *params);
+	void glHint (GLenum target, GLenum mode);
+	void glIndexMask (GLuint mask);
+	void glIndexPointer (GLenum type, GLsizei stride, GLvoid *pointer);
+	void glIndexd (GLdouble c);
+	void glIndexdv (GLdouble *c);
+	void glIndexf (GLfloat c);
+	void glIndexfv (GLfloat *c);
+	void glIndexi (GLint c);
+	void glIndexiv (GLint *c);
+	void glIndexs (GLshort c);
+	void glIndexsv (GLshort *c);
+	void glIndexub (GLubyte c);
+	void glIndexubv (GLubyte *c);
+	void glInitNames ();
+	void glInterleavedArrays (GLenum format, GLsizei stride, GLvoid *pointer);
+	GLboolean glIsEnabled (GLenum cap);
+	GLboolean glIsList (GLuint list);
+	GLboolean glIsTexture (GLuint texture);
+	void glLightModelf (GLenum pname, GLfloat param);
+	void glLightModelfv (GLenum pname, GLfloat *params);
+	void glLightModeli (GLenum pname, GLint param);
+	void glLightModeliv (GLenum pname, GLint *params);
+	void glLightf (GLenum light, GLenum pname, GLfloat param);
+	void glLightfv (GLenum light, GLenum pname, GLfloat *params);
+	void glLighti (GLenum light, GLenum pname, GLint param);
+	void glLightiv (GLenum light, GLenum pname, GLint *params);
+	void glLineStipple (GLint factor, GLushort pattern);
+	void glLineWidth (GLfloat width);
+	void glListBase (GLuint base);
+	void glLoadIdentity ();
+	void glLoadMatrixd (GLdouble *m);
+	void glLoadMatrixf (GLfloat *m);
+	void glLoadName (GLuint name);
+	void glLogicOp (GLenum opcode);
+	void glMap1d (GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, GLdouble *points);
+	void glMap1f (GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, GLfloat *points);
+	void glMap2d (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble *points);
+	void glMap2f (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat *points);
+	void glMapGrid1d (GLint un, GLdouble u1, GLdouble u2);
+	void glMapGrid1f (GLint un, GLfloat u1, GLfloat u2);
+	void glMapGrid2d (GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2);
+	void glMapGrid2f (GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2);
+	void glMaterialf (GLenum face, GLenum pname, GLfloat param);
+	void glMaterialfv (GLenum face, GLenum pname, GLfloat *params);
+	void glMateriali (GLenum face, GLenum pname, GLint param);
+	void glMaterialiv (GLenum face, GLenum pname, GLint *params);
+	void glMatrixMode (GLenum mode);
+	void glMultMatrixd (GLdouble *m);
+	void glMultMatrixf (GLfloat *m);
+	void glNewList (GLuint list, GLenum mode);
+	void glNormal3b (GLbyte nx, GLbyte ny, GLbyte nz);
+	void glNormal3bv (GLbyte *v);
+	void glNormal3d (GLdouble nx, GLdouble ny, GLdouble nz);
+	void glNormal3dv (GLdouble *v);
+	void glNormal3f (GLfloat nx, GLfloat ny, GLfloat nz);
+	void glNormal3fv (GLfloat *v);
+	void glNormal3i (GLint nx, GLint ny, GLint nz);
+	void glNormal3iv (GLint *v);
+	void glNormal3s (GLshort nx, GLshort ny, GLshort nz);
+	void glNormal3sv (GLshort *v);
+	void glNormalPointer (GLenum type, GLsizei stride, GLvoid *pointer);
+	void glOrtho (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
+	void glPassThrough (GLfloat token);
+	void glPixelMapfv (GLenum map, GLsizei mapsize, GLfloat *values);
+	void glPixelMapuiv (GLenum map, GLsizei mapsize, GLuint *values);
+	void glPixelMapusv (GLenum map, GLsizei mapsize, GLushort *values);
+	void glPixelStoref (GLenum pname, GLfloat param);
+	void glPixelStorei (GLenum pname, GLint param);
+	void glPixelTransferf (GLenum pname, GLfloat param);
+	void glPixelTransferi (GLenum pname, GLint param);
+	void glPixelZoom (GLfloat xfactor, GLfloat yfactor);
+	void glPointSize (GLfloat size);
+	void glPolygonMode (GLenum face, GLenum mode);
+	void glPolygonOffset (GLfloat factor, GLfloat units);
+	void glPolygonStipple (GLubyte *mask);
+	void glPopAttrib ();
+	void glPopClientAttrib ();
+	void glPopMatrix ();
+	void glPopName ();
+	void glPrioritizeTextures (GLsizei n, GLuint *textures, GLclampf *priorities);
+	void glPushAttrib (GLbitfield mask);
+	void glPushClientAttrib (GLbitfield mask);
+	void glPushMatrix ();
+	void glPushName (GLuint name);
+	void glRasterPos2d (GLdouble x, GLdouble y);
+	void glRasterPos2dv (GLdouble *v);
+	void glRasterPos2f (GLfloat x, GLfloat y);
+	void glRasterPos2fv (GLfloat *v);
+	void glRasterPos2i (GLint x, GLint y);
+	void glRasterPos2iv (GLint *v);
+	void glRasterPos2s (GLshort x, GLshort y);
+	void glRasterPos2sv (GLshort *v);
+	void glRasterPos3d (GLdouble x, GLdouble y, GLdouble z);
+	void glRasterPos3dv (GLdouble *v);
+	void glRasterPos3f (GLfloat x, GLfloat y, GLfloat z);
+	void glRasterPos3fv (GLfloat *v);
+	void glRasterPos3i (GLint x, GLint y, GLint z);
+	void glRasterPos3iv (GLint *v);
+	void glRasterPos3s (GLshort x, GLshort y, GLshort z);
+	void glRasterPos3sv (GLshort *v);
+	void glRasterPos4d (GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+	void glRasterPos4dv (GLdouble *v);
+	void glRasterPos4f (GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+	void glRasterPos4fv (GLfloat *v);
+	void glRasterPos4i (GLint x, GLint y, GLint z, GLint w);
+	void glRasterPos4iv (GLint *v);
+	void glRasterPos4s (GLshort x, GLshort y, GLshort z, GLshort w);
+	void glRasterPos4sv (GLshort *v);
+	void glReadBuffer (GLenum mode);
+	void glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels);
+	void glRectd (GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2);
+	void glRectdv (GLdouble *v1, GLdouble *v2);
+	void glRectf (GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2);
+	void glRectfv (GLfloat *v1, GLfloat *v2);
+	void glRecti (GLint x1, GLint y1, GLint x2, GLint y2);
+	void glRectiv (GLint *v1, GLint *v2);
+	void glRects (GLshort x1, GLshort y1, GLshort x2, GLshort y2);
+	void glRectsv (GLshort *v1, GLshort *v2);
+	GLint glRenderMode (GLenum mode);
+	void glRotated (GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
+	void glRotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
+	void glScaled (GLdouble x, GLdouble y, GLdouble z);
+	void glScalef (GLfloat x, GLfloat y, GLfloat z);
+	void glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
+	void glSelectBuffer (GLsizei size, GLuint *buffer);
+	void glShadeModel (GLenum mode);
+	void glStencilFunc (GLenum func, GLint ref_, GLuint mask);
+	void glStencilMask (GLuint mask);
+	void glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
+	void glTexCoord1d (GLdouble s);
+	void glTexCoord1dv (GLdouble *v);
+	void glTexCoord1f (GLfloat s);
+	void glTexCoord1fv (GLfloat *v);
+	void glTexCoord1i (GLint s);
+	void glTexCoord1iv (GLint *v);
+	void glTexCoord1s (GLshort s);
+	void glTexCoord1sv (GLshort *v);
+	void glTexCoord2d (GLdouble s, GLdouble t);
+	void glTexCoord2dv (GLdouble *v);
+	void glTexCoord2f (GLfloat s, GLfloat t);
+	void glTexCoord2fv (GLfloat *v);
+	void glTexCoord2i (GLint s, GLint t);
+	void glTexCoord2iv (GLint *v);
+	void glTexCoord2s (GLshort s, GLshort t);
+	void glTexCoord2sv (GLshort *v);
+	void glTexCoord3d (GLdouble s, GLdouble t, GLdouble r);
+	void glTexCoord3dv (GLdouble *v);
+	void glTexCoord3f (GLfloat s, GLfloat t, GLfloat r);
+	void glTexCoord3fv (GLfloat *v);
+	void glTexCoord3i (GLint s, GLint t, GLint r);
+	void glTexCoord3iv (GLint *v);
+	void glTexCoord3s (GLshort s, GLshort t, GLshort r);
+	void glTexCoord3sv (GLshort *v);
+	void glTexCoord4d (GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+	void glTexCoord4dv (GLdouble *v);
+	void glTexCoord4f (GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+	void glTexCoord4fv (GLfloat *v);
+	void glTexCoord4i (GLint s, GLint t, GLint r, GLint q);
+	void glTexCoord4iv (GLint *v);
+	void glTexCoord4s (GLshort s, GLshort t, GLshort r, GLshort q);
+	void glTexCoord4sv (GLshort *v);
+	void glTexCoordPointer (GLint size, GLenum type, GLsizei stride, GLvoid *pointer);
+	void glTexEnvf (GLenum target, GLenum pname, GLfloat param);
+	void glTexEnvfv (GLenum target, GLenum pname, GLfloat *params);
+	void glTexEnvi (GLenum target, GLenum pname, GLint param);
+	void glTexEnviv (GLenum target, GLenum pname, GLint *params);
+	void glTexGend (GLenum coord, GLenum pname, GLdouble param);
+	void glTexGendv (GLenum coord, GLenum pname, GLdouble *params);
+	void glTexGenf (GLenum coord, GLenum pname, GLfloat param);
+	void glTexGenfv (GLenum coord, GLenum pname, GLfloat *params);
+	void glTexGeni (GLenum coord, GLenum pname, GLint param);
+	void glTexGeniv (GLenum coord, GLenum pname, GLint *params);
+	void glTexImage1D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, GLvoid *pixels);
+	void glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, GLvoid *pixels);
+	void glTexParameterf (GLenum target, GLenum pname, GLfloat param);
+	void glTexParameterfv (GLenum target, GLenum pname, GLfloat *params);
+	void glTexParameteri (GLenum target, GLenum pname, GLint param);
+	void glTexParameteriv (GLenum target, GLenum pname, GLint *params);
+	void glTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, GLvoid *pixels);
+	void glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels);
+	void glTranslated (GLdouble x, GLdouble y, GLdouble z);
+	void glTranslatef (GLfloat x, GLfloat y, GLfloat z);
+	void glVertex2d (GLdouble x, GLdouble y);
+	void glVertex2dv (GLdouble *v);
+	void glVertex2f (GLfloat x, GLfloat y);
+	void glVertex2fv (GLfloat *v);
+	void glVertex2i (GLint x, GLint y);
+	void glVertex2iv (GLint *v);
+	void glVertex2s (GLshort x, GLshort y);
+	void glVertex2sv (GLshort *v);
+	void glVertex3d (GLdouble x, GLdouble y, GLdouble z);
+	void glVertex3dv (GLdouble *v);
+	void glVertex3f (GLfloat x, GLfloat y, GLfloat z);
+	void glVertex3fv (GLfloat *v);
+	void glVertex3i (GLint x, GLint y, GLint z);
+	void glVertex3iv (GLint *v);
+	void glVertex3s (GLshort x, GLshort y, GLshort z);
+	void glVertex3sv (GLshort *v);
+	void glVertex4d (GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+	void glVertex4dv (GLdouble *v);
+	void glVertex4f (GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+	void glVertex4fv (GLfloat *v);
+	void glVertex4i (GLint x, GLint y, GLint z, GLint w);
+	void glVertex4iv (GLint *v);
+	void glVertex4s (GLshort x, GLshort y, GLshort z, GLshort w);
+	void glVertex4sv (GLshort *v);
+	void glVertexPointer (GLint size, GLenum type, GLsizei stride, GLvoid *pointer);
+	void glViewport (GLint x, GLint y, GLsizei width, GLsizei height);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/opengl/hellogl/opengl/gltypes.d	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,631 @@
+module opengl.gltypes;
+
+alias uint      GLenum;
+alias ubyte     GLboolean;
+alias uint      GLbitfield;
+alias void      GLvoid;
+alias byte      GLbyte;
+alias short     GLshort;
+alias int       GLint;
+alias ubyte     GLubyte;
+alias ushort    GLushort;
+alias uint      GLuint;
+alias int       GLsizei;
+alias float     GLfloat;
+alias float     GLclampf;
+alias double    GLdouble;
+alias double    GLclampd;
+alias char      GLchar;
+alias ptrdiff_t GLintptr;
+alias ptrdiff_t GLsizeiptr;
+
+// Boolean values
+enum : GLboolean
+{
+    GL_FALSE    = 0x0,
+    GL_TRUE    = 0x1,
+}
+
+enum : GLenum
+{
+    // Data types
+    GL_BYTE                                = 0x1400,
+    GL_UNSIGNED_BYTE                       = 0x1401,
+    GL_SHORT                               = 0x1402,
+    GL_UNSIGNED_SHORT                      = 0x1403,
+    GL_INT                                 = 0x1404,
+    GL_UNSIGNED_INT                        = 0x1405,
+    GL_FLOAT                               = 0x1406,
+    GL_DOUBLE                              = 0x140A,
+    GL_2_BYTES                             = 0x1407,
+    GL_3_BYTES                             = 0x1408,
+    GL_4_BYTES                             = 0x1409,
+
+    // Primitives
+    GL_POINTS                              = 0x0000,
+    GL_LINES                               = 0x0001,
+    GL_LINE_LOOP                           = 0x0002,
+    GL_LINE_STRIP                          = 0x0003,
+    GL_TRIANGLES                           = 0x0004,
+    GL_TRIANGLE_STRIP                      = 0x0005,
+    GL_TRIANGLE_FAN                        = 0x0006,
+    GL_QUADS                               = 0x0007,
+    GL_QUAD_STRIP                          = 0x0008,
+    GL_POLYGON                             = 0x0009,
+
+    // Vertex Arrays
+    GL_VERTEX_ARRAY                        = 0x8074,
+    GL_NORMAL_ARRAY                        = 0x8075,
+    GL_COLOR_ARRAY                         = 0x8076,
+    GL_INDEX_ARRAY                         = 0x8077,
+    GL_TEXTURE_COORD_ARRAY                 = 0x8078,
+    GL_EDGE_FLAG_ARRAY                     = 0x8079,
+    GL_VERTEX_ARRAY_SIZE                   = 0x807A,
+    GL_VERTEX_ARRAY_TYPE                   = 0x807B,
+    GL_VERTEX_ARRAY_STRIDE                 = 0x807C,
+    GL_NORMAL_ARRAY_TYPE                   = 0x807E,
+    GL_NORMAL_ARRAY_STRIDE                 = 0x807F,
+    GL_COLOR_ARRAY_SIZE                    = 0x8081,
+    GL_COLOR_ARRAY_TYPE                    = 0x8082,
+    GL_COLOR_ARRAY_STRIDE                  = 0x8083,
+    GL_INDEX_ARRAY_TYPE                    = 0x8085,
+    GL_INDEX_ARRAY_STRIDE                  = 0x8086,
+    GL_TEXTURE_COORD_ARRAY_SIZE            = 0x8088,
+    GL_TEXTURE_COORD_ARRAY_TYPE            = 0x8089,
+    GL_TEXTURE_COORD_ARRAY_STRIDE          = 0x808A,
+    GL_EDGE_FLAG_ARRAY_STRIDE              = 0x808C,
+    GL_VERTEX_ARRAY_POINTER                = 0x808E,
+    GL_NORMAL_ARRAY_POINTER                = 0x808F,
+    GL_COLOR_ARRAY_POINTER                 = 0x8090,
+    GL_INDEX_ARRAY_POINTER                 = 0x8091,
+    GL_TEXTURE_COORD_ARRAY_POINTER         = 0x8092,
+    GL_EDGE_FLAG_ARRAY_POINTER             = 0x8093,
+    GL_V2F                                 = 0x2A20,
+    GL_V3F                                 = 0x2A21,
+    GL_C4UB_V2F                            = 0x2A22,
+    GL_C4UB_V3F                            = 0x2A23,
+    GL_C3F_V3F                             = 0x2A24,
+    GL_N3F_V3F                             = 0x2A25,
+    GL_C4F_N3F_V3F                         = 0x2A26,
+    GL_T2F_V3F                             = 0x2A27,
+    GL_T4F_V4F                             = 0x2A28,
+    GL_T2F_C4UB_V3F                        = 0x2A29,
+    GL_T2F_C3F_V3F                         = 0x2A2A,
+    GL_T2F_N3F_V3F                         = 0x2A2B,
+    GL_T2F_C4F_N3F_V3F                     = 0x2A2C,
+    GL_T4F_C4F_N3F_V4F                     = 0x2A2D,
+
+    // Matrix Mode
+    GL_MATRIX_MODE                         = 0x0BA0,
+    GL_MODELVIEW                           = 0x1700,
+    GL_PROJECTION                          = 0x1701,
+    GL_TEXTURE                             = 0x1702,
+
+    // Points
+    GL_POINT_SMOOTH                        = 0x0B10,
+    GL_POINT_SIZE                          = 0x0B11,
+    GL_POINT_SIZE_GRANULARITY              = 0x0B13,
+    GL_POINT_SIZE_RANGE                    = 0x0B12,
+
+    // Lines
+    GL_LINE_SMOOTH                         = 0x0B20,
+    GL_LINE_STIPPLE                        = 0x0B24,
+    GL_LINE_STIPPLE_PATTERN                = 0x0B25,
+    GL_LINE_STIPPLE_REPEAT                 = 0x0B26,
+    GL_LINE_WIDTH                          = 0x0B21,
+    GL_LINE_WIDTH_GRANULARITY              = 0x0B23,
+    GL_LINE_WIDTH_RANGE                    = 0x0B22,
+
+    // Polygons
+    GL_POINT                               = 0x1B00,
+    GL_LINE                                = 0x1B01,
+    GL_FILL                                = 0x1B02,
+    GL_CW                                  = 0x0900,
+    GL_CCW                                 = 0x0901,
+    GL_FRONT                               = 0x0404,
+    GL_BACK                                = 0x0405,
+    GL_POLYGON_MODE                        = 0x0B40,
+    GL_POLYGON_SMOOTH                      = 0x0B41,
+    GL_POLYGON_STIPPLE                     = 0x0B42,
+    GL_EDGE_FLAG                           = 0x0B43,
+    GL_CULL_FACE                           = 0x0B44,
+    GL_CULL_FACE_MODE                      = 0x0B45,
+    GL_FRONT_FACE                          = 0x0B46,
+    GL_POLYGON_OFFSET_FACTOR               = 0x8038,
+    GL_POLYGON_OFFSET_UNITS                = 0x2A00,
+    GL_POLYGON_OFFSET_POINT                = 0x2A01,
+    GL_POLYGON_OFFSET_LINE                 = 0x2A02,
+    GL_POLYGON_OFFSET_FILL                 = 0x8037,
+
+    // Display Lists
+    GL_COMPILE                             = 0x1300,
+    GL_COMPILE_AND_EXECUTE                 = 0x1301,
+    GL_LIST_BASE                           = 0x0B32,
+    GL_LIST_INDEX                          = 0x0B33,
+    GL_LIST_MODE                           = 0x0B30,
+
+    // Depth buffer
+    GL_NEVER                               = 0x0200,
+    GL_LESS                                = 0x0201,
+    GL_EQUAL                               = 0x0202,
+    GL_LEQUAL                              = 0x0203,
+    GL_GREATER                             = 0x0204,
+    GL_NOTEQUAL                            = 0x0205,
+    GL_GEQUAL                              = 0x0206,
+    GL_ALWAYS                              = 0x0207,
+    GL_DEPTH_TEST                          = 0x0B71,
+    GL_DEPTH_BITS                          = 0x0D56,
+    GL_DEPTH_CLEAR_VALUE                   = 0x0B73,
+    GL_DEPTH_FUNC                          = 0x0B74,
+    GL_DEPTH_RANGE                         = 0x0B70,
+    GL_DEPTH_WRITEMASK                     = 0x0B72,
+    GL_DEPTH_COMPONENT                     = 0x1902,
+
+    // Lighting
+    GL_LIGHTING                            = 0x0B50,
+    GL_LIGHT0                              = 0x4000,
+    GL_LIGHT1                              = 0x4001,
+    GL_LIGHT2                              = 0x4002,
+    GL_LIGHT3                              = 0x4003,
+    GL_LIGHT4                              = 0x4004,
+    GL_LIGHT5                              = 0x4005,
+    GL_LIGHT6                              = 0x4006,
+    GL_LIGHT7                              = 0x4007,
+    GL_SPOT_EXPONENT                       = 0x1205,
+    GL_SPOT_CUTOFF                         = 0x1206,
+    GL_CONSTANT_ATTENUATION                = 0x1207,
+    GL_LINEAR_ATTENUATION                  = 0x1208,
+    GL_QUADRATIC_ATTENUATION               = 0x1209,
+    GL_AMBIENT                             = 0x1200,
+    GL_DIFFUSE                             = 0x1201,
+    GL_SPECULAR                            = 0x1202,
+    GL_SHININESS                           = 0x1601,
+    GL_EMISSION                            = 0x1600,
+    GL_POSITION                            = 0x1203,
+    GL_SPOT_DIRECTION                      = 0x1204,
+    GL_AMBIENT_AND_DIFFUSE                 = 0x1602,
+    GL_COLOR_INDEXES                       = 0x1603,
+    GL_LIGHT_MODEL_TWO_SIDE                = 0x0B52,
+    GL_LIGHT_MODEL_LOCAL_VIEWER            = 0x0B51,
+    GL_LIGHT_MODEL_AMBIENT                 = 0x0B53,
+    GL_FRONT_AND_BACK                      = 0x0408,
+    GL_SHADE_MODEL                         = 0x0B54,
+    GL_FLAT                                = 0x1D00,
+    GL_SMOOTH                              = 0x1D01,
+    GL_COLOR_MATERIAL                      = 0x0B57,
+    GL_COLOR_MATERIAL_FACE                 = 0x0B55,
+    GL_COLOR_MATERIAL_PARAMETER            = 0x0B56,
+    GL_NORMALIZE                           = 0x0BA1,
+
+    // User clipping planes
+    GL_CLIP_PLANE0                         = 0x3000,
+    GL_CLIP_PLANE1                         = 0x3001,
+    GL_CLIP_PLANE2                         = 0x3002,
+    GL_CLIP_PLANE3                         = 0x3003,
+    GL_CLIP_PLANE4                         = 0x3004,
+    GL_CLIP_PLANE5                         = 0x3005,
+
+    // Accumulation buffer
+    GL_ACCUM_RED_BITS                      = 0x0D58,
+    GL_ACCUM_GREEN_BITS                    = 0x0D59,
+    GL_ACCUM_BLUE_BITS                     = 0x0D5A,
+    GL_ACCUM_ALPHA_BITS                    = 0x0D5B,
+    GL_ACCUM_CLEAR_VALUE                   = 0x0B80,
+    GL_ACCUM                               = 0x0100,
+    GL_ADD                                 = 0x0104,
+    GL_LOAD                                = 0x0101,
+    GL_MULT                                = 0x0103,
+    GL_RETURN                              = 0x0102,
+
+    // Alpha testing
+    GL_ALPHA_TEST                          = 0x0BC0,
+    GL_ALPHA_TEST_REF                      = 0x0BC2,
+    GL_ALPHA_TEST_FUNC                     = 0x0BC1,
+
+    // Blending
+    GL_BLEND                               = 0x0BE2,
+    GL_BLEND_SRC                           = 0x0BE1,
+    GL_BLEND_DST                           = 0x0BE0,
+    GL_ZERO                                = 0x0,
+    GL_ONE                                 = 0x1,
+    GL_SRC_COLOR                           = 0x0300,
+    GL_ONE_MINUS_SRC_COLOR                 = 0x0301,
+    GL_SRC_ALPHA                           = 0x0302,
+    GL_ONE_MINUS_SRC_ALPHA                 = 0x0303,
+    GL_DST_ALPHA                           = 0x0304,
+    GL_ONE_MINUS_DST_ALPHA                 = 0x0305,
+    GL_DST_COLOR                           = 0x0306,
+    GL_ONE_MINUS_DST_COLOR                 = 0x0307,
+    GL_SRC_ALPHA_SATURATE                  = 0x0308,
+    
+    // Render Mode
+    GL_FEEDBACK                            = 0x1C01,
+    GL_RENDER                              = 0x1C00,
+    GL_SELECT                              = 0x1C02,
+
+    // Feedback
+    GL_2D                                  = 0x0600,
+    GL_3D                                  = 0x0601,
+    GL_3D_COLOR                            = 0x0602,
+    GL_3D_COLOR_TEXTURE                    = 0x0603,
+    GL_4D_COLOR_TEXTURE                    = 0x0604,
+    GL_POINT_TOKEN                         = 0x0701,
+    GL_LINE_TOKEN                          = 0x0702,
+    GL_LINE_RESET_TOKEN                    = 0x0707,
+    GL_POLYGON_TOKEN                       = 0x0703,
+    GL_BITMAP_TOKEN                        = 0x0704,
+    GL_DRAW_PIXEL_TOKEN                    = 0x0705,
+    GL_COPY_PIXEL_TOKEN                    = 0x0706,
+    GL_PASS_THROUGH_TOKEN                  = 0x0700,
+    GL_FEEDBACK_BUFFER_POINTER             = 0x0DF0,
+    GL_FEEDBACK_BUFFER_SIZE                = 0x0DF1,
+    GL_FEEDBACK_BUFFER_TYPE                = 0x0DF2,
+
+    // Selection
+    GL_SELECTION_BUFFER_POINTER            = 0x0DF3,
+    GL_SELECTION_BUFFER_SIZE               = 0x0DF4,
+
+    // Fog
+    GL_FOG                                 = 0x0B60,
+    GL_FOG_MODE                            = 0x0B65,
+    GL_FOG_DENSITY                         = 0x0B62,
+    GL_FOG_COLOR                           = 0x0B66,
+    GL_FOG_INDEX                           = 0x0B61,
+    GL_FOG_START                           = 0x0B63,
+    GL_FOG_END                             = 0x0B64,
+    GL_LINEAR                              = 0x2601,
+    GL_EXP                                 = 0x0800,
+    GL_EXP2                                = 0x0801,
+
+    // Logic Ops
+    GL_LOGIC_OP                            = 0x0BF1,
+    GL_INDEX_LOGIC_OP                      = 0x0BF1,
+    GL_COLOR_LOGIC_OP                      = 0x0BF2,
+    GL_LOGIC_OP_MODE                       = 0x0BF0,
+    GL_CLEAR                               = 0x1500,
+    GL_SET                                 = 0x150F,
+    GL_COPY                                = 0x1503,
+    GL_COPY_INVERTED                       = 0x150C,
+    GL_NOOP                                = 0x1505,
+    GL_INVERT                              = 0x150A,
+    GL_AND                                 = 0x1501,
+    GL_NAND                                = 0x150E,
+    GL_OR                                  = 0x1507,
+    GL_NOR                                 = 0x1508,
+    GL_XOR                                 = 0x1506,
+    GL_EQUIV                               = 0x1509,
+    GL_AND_REVERSE                         = 0x1502,
+    GL_AND_INVERTED                        = 0x1504,
+    GL_OR_REVERSE                          = 0x150B,
+    GL_OR_INVERTED                         = 0x150D,
+
+    // Stencil
+    GL_STENCIL_TEST                        = 0x0B90,
+    GL_STENCIL_WRITEMASK                   = 0x0B98,
+    GL_STENCIL_BITS                        = 0x0D57,
+    GL_STENCIL_FUNC                        = 0x0B92,
+    GL_STENCIL_VALUE_MASK                  = 0x0B93,
+    GL_STENCIL_REF                         = 0x0B97,
+    GL_STENCIL_FAIL                        = 0x0B94,
+    GL_STENCIL_PASS_DEPTH_PASS             = 0x0B96,
+    GL_STENCIL_PASS_DEPTH_FAIL             = 0x0B95,
+    GL_STENCIL_CLEAR_VALUE                 = 0x0B91,
+    GL_STENCIL_INDEX                       = 0x1901,
+    GL_KEEP                                = 0x1E00,
+    GL_REPLACE                             = 0x1E01,
+    GL_INCR                                = 0x1E02,
+    GL_DECR                                = 0x1E03,
+
+    // Buffers, Pixel Drawing/Reading
+    GL_NONE                                = 0x0,
+    GL_LEFT                                = 0x0406,
+    GL_RIGHT                               = 0x0407,
+    GL_FRONT_LEFT                          = 0x0400,
+    GL_FRONT_RIGHT                         = 0x0401,
+    GL_BACK_LEFT                           = 0x0402,
+    GL_BACK_RIGHT                          = 0x0403,
+    GL_AUX0                                = 0x0409,
+    GL_AUX1                                = 0x040A,
+    GL_AUX2                                = 0x040B,
+    GL_AUX3                                = 0x040C,
+    GL_COLOR_INDEX                         = 0x1900,
+    GL_RED                                 = 0x1903,
+    GL_GREEN                               = 0x1904,
+    GL_BLUE                                = 0x1905,
+    GL_ALPHA                               = 0x1906,
+    GL_LUMINANCE                           = 0x1909,
+    GL_LUMINANCE_ALPHA                     = 0x190A,
+    GL_ALPHA_BITS                          = 0x0D55,
+    GL_RED_BITS                            = 0x0D52,
+    GL_GREEN_BITS                          = 0x0D53,
+    GL_BLUE_BITS                           = 0x0D54,
+    GL_INDEX_BITS                          = 0x0D51,
+    GL_SUBPIXEL_BITS                       = 0x0D50,
+    GL_AUX_BUFFERS                         = 0x0C00,
+    GL_READ_BUFFER                         = 0x0C02,
+    GL_DRAW_BUFFER                         = 0x0C01,
+    GL_DOUBLEBUFFER                        = 0x0C32,
+    GL_STEREO                              = 0x0C33,
+    GL_BITMAP                              = 0x1A00,
+    GL_COLOR                               = 0x1800,
+    GL_DEPTH                               = 0x1801,
+    GL_STENCIL                             = 0x1802,
+    GL_DITHER                              = 0x0BD0,
+    GL_RGB                                 = 0x1907,
+    GL_RGBA                                = 0x1908,
+
+    // Implementation limits
+    GL_MAX_LIST_NESTING                    = 0x0B31,
+    GL_MAX_ATTRIB_STACK_DEPTH              = 0x0D35,
+    GL_MAX_MODELVIEW_STACK_DEPTH           = 0x0D36,
+    GL_MAX_NAME_STACK_DEPTH                = 0x0D37,
+    GL_MAX_PROJECTION_STACK_DEPTH          = 0x0D38,
+    GL_MAX_TEXTURE_STACK_DEPTH             = 0x0D39,
+    GL_MAX_EVAL_ORDER                      = 0x0D30,
+    GL_MAX_LIGHTS                          = 0x0D31,
+    GL_MAX_CLIP_PLANES                     = 0x0D32,
+    GL_MAX_TEXTURE_SIZE                    = 0x0D33,
+    GL_MAX_PIXEL_MAP_TABLE                 = 0x0D34,
+    GL_MAX_VIEWPORT_DIMS                   = 0x0D3A,
+    GL_MAX_CLIENT_ATTRIB_STACK_DEPTH       = 0x0D3B,
+
+    // Gets
+    GL_ATTRIB_STACK_DEPTH                  = 0x0BB0,
+    GL_CLIENT_ATTRIB_STACK_DEPTH           = 0x0BB1,
+    GL_COLOR_CLEAR_VALUE                   = 0x0C22,
+    GL_COLOR_WRITEMASK                     = 0x0C23,
+    GL_CURRENT_INDEX                       = 0x0B01,
+    GL_CURRENT_COLOR                       = 0x0B00,
+    GL_CURRENT_NORMAL                      = 0x0B02,
+    GL_CURRENT_RASTER_COLOR                = 0x0B04,
+    GL_CURRENT_RASTER_DISTANCE             = 0x0B09,
+    GL_CURRENT_RASTER_INDEX                = 0x0B05,
+    GL_CURRENT_RASTER_POSITION             = 0x0B07,
+    GL_CURRENT_RASTER_TEXTURE_COORDS       = 0x0B06,
+    GL_CURRENT_RASTER_POSITION_VALID       = 0x0B08,
+    GL_CURRENT_TEXTURE_COORDS              = 0x0B03,
+    GL_INDEX_CLEAR_VALUE                   = 0x0C20,
+    GL_INDEX_MODE                          = 0x0C30,
+    GL_INDEX_WRITEMASK                     = 0x0C21,
+    GL_MODELVIEW_MATRIX                    = 0x0BA6,
+    GL_MODELVIEW_STACK_DEPTH               = 0x0BA3,
+    GL_NAME_STACK_DEPTH                    = 0x0D70,
+    GL_PROJECTION_MATRIX                   = 0x0BA7,
+    GL_PROJECTION_STACK_DEPTH              = 0x0BA4,
+    GL_RENDER_MODE                         = 0x0C40,
+    GL_RGBA_MODE                           = 0x0C31,
+    GL_TEXTURE_MATRIX                      = 0x0BA8,
+    GL_TEXTURE_STACK_DEPTH                 = 0x0BA5,
+    GL_VIEWPORT                            = 0x0BA2,
+
+    // Evaluators
+    GL_AUTO_NORMAL                         = 0x0D80,
+    GL_MAP1_COLOR_4                        = 0x0D90,
+    GL_MAP1_GRID_DOMAIN                    = 0x0DD0,
+    GL_MAP1_GRID_SEGMENTS                  = 0x0DD1,
+    GL_MAP1_INDEX                          = 0x0D91,
+    GL_MAP1_NORMAL                         = 0x0D92,
+    GL_MAP1_TEXTURE_COORD_1                = 0x0D93,
+    GL_MAP1_TEXTURE_COORD_2                = 0x0D94,
+    GL_MAP1_TEXTURE_COORD_3                = 0x0D95,
+    GL_MAP1_TEXTURE_COORD_4                = 0x0D96,
+    GL_MAP1_VERTEX_3                       = 0x0D97,
+    GL_MAP1_VERTEX_4                       = 0x0D98,
+    GL_MAP2_COLOR_4                        = 0x0DB0,
+    GL_MAP2_GRID_DOMAIN                    = 0x0DD2,
+    GL_MAP2_GRID_SEGMENTS                  = 0x0DD3,
+    GL_MAP2_INDEX                          = 0x0DB1,
+    GL_MAP2_NORMAL                         = 0x0DB2,
+    GL_MAP2_TEXTURE_COORD_1                = 0x0DB3,
+    GL_MAP2_TEXTURE_COORD_2                = 0x0DB4,
+    GL_MAP2_TEXTURE_COORD_3                = 0x0DB5,
+    GL_MAP2_TEXTURE_COORD_4                = 0x0DB6,
+    GL_MAP2_VERTEX_3                       = 0x0DB7,
+    GL_MAP2_VERTEX_4                       = 0x0DB8,
+    GL_COEFF                               = 0x0A00,
+    GL_DOMAIN                              = 0x0A02,
+    GL_ORDER                               = 0x0A01,
+
+    // Hints
+    GL_FOG_HINT                            = 0x0C54,
+    GL_LINE_SMOOTH_HINT                    = 0x0C52,
+    GL_PERSPECTIVE_CORRECTION_HINT         = 0x0C50,
+    GL_POINT_SMOOTH_HINT                   = 0x0C51,
+    GL_POLYGON_SMOOTH_HINT                 = 0x0C53,
+    GL_DONT_CARE                           = 0x1100,
+    GL_FASTEST                             = 0x1101,
+    GL_NICEST                              = 0x1102,
+
+    // Scissor box
+    GL_SCISSOR_TEST                        = 0x0C11,
+    GL_SCISSOR_BOX                         = 0x0C10,
+
+    // Pixel Mode / Transfer
+    GL_MAP_COLOR                           = 0x0D10,
+    GL_MAP_STENCIL                         = 0x0D11,
+    GL_INDEX_SHIFT                         = 0x0D12,
+    GL_INDEX_OFFSET                        = 0x0D13,
+    GL_RED_SCALE                           = 0x0D14,
+    GL_RED_BIAS                            = 0x0D15,
+    GL_GREEN_SCALE                         = 0x0D18,
+    GL_GREEN_BIAS                          = 0x0D19,
+    GL_BLUE_SCALE                          = 0x0D1A,
+    GL_BLUE_BIAS                           = 0x0D1B,
+    GL_ALPHA_SCALE                         = 0x0D1C,
+    GL_ALPHA_BIAS                          = 0x0D1D,
+    GL_DEPTH_SCALE                         = 0x0D1E,
+    GL_DEPTH_BIAS                          = 0x0D1F,
+    GL_PIXEL_MAP_S_TO_S_SIZE               = 0x0CB1,
+    GL_PIXEL_MAP_I_TO_I_SIZE               = 0x0CB0,
+    GL_PIXEL_MAP_I_TO_R_SIZE               = 0x0CB2,
+    GL_PIXEL_MAP_I_TO_G_SIZE               = 0x0CB3,
+    GL_PIXEL_MAP_I_TO_B_SIZE               = 0x0CB4,
+    GL_PIXEL_MAP_I_TO_A_SIZE               = 0x0CB5,
+    GL_PIXEL_MAP_R_TO_R_SIZE               = 0x0CB6,
+    GL_PIXEL_MAP_G_TO_G_SIZE               = 0x0CB7,
+    GL_PIXEL_MAP_B_TO_B_SIZE               = 0x0CB8,
+    GL_PIXEL_MAP_A_TO_A_SIZE               = 0x0CB9,
+    GL_PIXEL_MAP_S_TO_S                    = 0x0C71,
+    GL_PIXEL_MAP_I_TO_I                    = 0x0C70,
+    GL_PIXEL_MAP_I_TO_R                    = 0x0C72,
+    GL_PIXEL_MAP_I_TO_G                    = 0x0C73,
+    GL_PIXEL_MAP_I_TO_B                    = 0x0C74,
+    GL_PIXEL_MAP_I_TO_A                    = 0x0C75,
+    GL_PIXEL_MAP_R_TO_R                    = 0x0C76,
+    GL_PIXEL_MAP_G_TO_G                    = 0x0C77,
+    GL_PIXEL_MAP_B_TO_B                    = 0x0C78,
+    GL_PIXEL_MAP_A_TO_A                    = 0x0C79,
+    GL_PACK_ALIGNMENT                      = 0x0D05,
+    GL_PACK_LSB_FIRST                      = 0x0D01,
+    GL_PACK_ROW_LENGTH                     = 0x0D02,
+    GL_PACK_SKIP_PIXELS                    = 0x0D04,
+    GL_PACK_SKIP_ROWS                      = 0x0D03,
+    GL_PACK_SWAP_BYTES                     = 0x0D00,
+    GL_UNPACK_ALIGNMENT                    = 0x0CF5,
+    GL_UNPACK_LSB_FIRST                    = 0x0CF1,
+    GL_UNPACK_ROW_LENGTH                   = 0x0CF2,
+    GL_UNPACK_SKIP_PIXELS                  = 0x0CF4,
+    GL_UNPACK_SKIP_ROWS                    = 0x0CF3,
+    GL_UNPACK_SWAP_BYTES                   = 0x0CF0,
+    GL_ZOOM_X                              = 0x0D16,
+    GL_ZOOM_Y                              = 0x0D17,
+
+    // Texture mapping
+    GL_TEXTURE_ENV                         = 0x2300,
+    GL_TEXTURE_ENV_MODE                    = 0x2200,
+    GL_TEXTURE_1D                          = 0x0DE0,
+    GL_TEXTURE_2D                          = 0x0DE1,
+    GL_TEXTURE_WRAP_S                      = 0x2802,
+    GL_TEXTURE_WRAP_T                      = 0x2803,
+    GL_TEXTURE_MAG_FILTER                  = 0x2800,
+    GL_TEXTURE_MIN_FILTER                  = 0x2801,
+    GL_TEXTURE_ENV_COLOR                   = 0x2201,
+    GL_TEXTURE_GEN_S                       = 0x0C60,
+    GL_TEXTURE_GEN_T                       = 0x0C61,
+    GL_TEXTURE_GEN_MODE                    = 0x2500,
+    GL_TEXTURE_BORDER_COLOR                = 0x1004,
+    GL_TEXTURE_WIDTH                       = 0x1000,
+    GL_TEXTURE_HEIGHT                      = 0x1001,
+    GL_TEXTURE_BORDER                      = 0x1005,
+    GL_TEXTURE_COMPONENTS                  = 0x1003,
+    GL_TEXTURE_RED_SIZE                    = 0x805C,
+    GL_TEXTURE_GREEN_SIZE                  = 0x805D,
+    GL_TEXTURE_BLUE_SIZE                   = 0x805E,
+    GL_TEXTURE_ALPHA_SIZE                  = 0x805F,
+    GL_TEXTURE_LUMINANCE_SIZE              = 0x8060,
+    GL_TEXTURE_INTENSITY_SIZE              = 0x8061,
+    GL_NEAREST_MIPMAP_NEAREST              = 0x2700,
+    GL_NEAREST_MIPMAP_LINEAR               = 0x2702,
+    GL_LINEAR_MIPMAP_NEAREST               = 0x2701,
+    GL_LINEAR_MIPMAP_LINEAR                = 0x2703,
+    GL_OBJECT_LINEAR                       = 0x2401,
+    GL_OBJECT_PLANE                        = 0x2501,
+    GL_EYE_LINEAR                          = 0x2400,
+    GL_EYE_PLANE                           = 0x2502,
+    GL_SPHERE_MAP                          = 0x2402,
+    GL_DECAL                               = 0x2101,
+    GL_MODULATE                            = 0x2100,
+    GL_NEAREST                             = 0x2600,
+    GL_REPEAT                              = 0x2901,
+    GL_CLAMP                               = 0x2900,
+    GL_S                                   = 0x2000,
+    GL_T                                   = 0x2001,
+    GL_R                                   = 0x2002,
+    GL_Q                                   = 0x2003,
+    GL_TEXTURE_GEN_R                       = 0x0C62,
+    GL_TEXTURE_GEN_Q                       = 0x0C63,
+
+    // Utility
+    GL_VENDOR                              = 0x1F00,
+    GL_RENDERER                            = 0x1F01,
+    GL_VERSION                             = 0x1F02,
+    GL_EXTENSIONS                          = 0x1F03,
+
+    // Errors
+    GL_NO_ERROR                            = 0x0,
+    GL_INVALID_VALUE                       = 0x0501,
+    GL_INVALID_ENUM                        = 0x0500,
+    GL_INVALID_OPERATION                   = 0x0502,
+    GL_STACK_OVERFLOW                      = 0x0503,
+    GL_STACK_UNDERFLOW                     = 0x0504,
+    GL_OUT_OF_MEMORY                       = 0x0505,
+}
+
+// glPush/PopAttrib bits
+enum : GLuint
+{
+    GL_CURRENT_BIT                         = 0x00000001,
+    GL_POINT_BIT                           = 0x00000002,
+    GL_LINE_BIT                            = 0x00000004,
+    GL_POLYGON_BIT                         = 0x00000008,
+    GL_POLYGON_STIPPLE_BIT                 = 0x00000010,
+    GL_PIXEL_MODE_BIT                      = 0x00000020,
+    GL_LIGHTING_BIT                        = 0x00000040,
+    GL_FOG_BIT                             = 0x00000080,
+    GL_DEPTH_BUFFER_BIT                    = 0x00000100,
+    GL_ACCUM_BUFFER_BIT                    = 0x00000200,
+    GL_STENCIL_BUFFER_BIT                  = 0x00000400,
+    GL_VIEWPORT_BIT                        = 0x00000800,
+    GL_TRANSFORM_BIT                       = 0x00001000,
+    GL_ENABLE_BIT                          = 0x00002000,
+    GL_COLOR_BUFFER_BIT                    = 0x00004000,
+    GL_HINT_BIT                            = 0x00008000,
+    GL_EVAL_BIT                            = 0x00010000,
+    GL_LIST_BIT                            = 0x00020000,
+    GL_TEXTURE_BIT                         = 0x00040000,
+    GL_SCISSOR_BIT                         = 0x00080000,
+    GL_ALL_ATTRIB_BITS                     = 0x000FFFFF,
+}
+
+// gl 1.1
+enum : GLenum
+{
+GL_PROXY_TEXTURE_1D                    = 0x8063,
+GL_PROXY_TEXTURE_2D                    = 0x8064,
+GL_TEXTURE_PRIORITY                    = 0x8066,
+GL_TEXTURE_RESIDENT                    = 0x8067,
+GL_TEXTURE_BINDING_1D                  = 0x8068,
+GL_TEXTURE_BINDING_2D                  = 0x8069,
+GL_TEXTURE_INTERNAL_FORMAT             = 0x1003,
+GL_ALPHA4                              = 0x803B,
+GL_ALPHA8                              = 0x803C,
+GL_ALPHA12                             = 0x803D,
+GL_ALPHA16                             = 0x803E,
+GL_LUMINANCE4                          = 0x803F,
+GL_LUMINANCE8                          = 0x8040,
+GL_LUMINANCE12                         = 0x8041,
+GL_LUMINANCE16                         = 0x8042,
+GL_LUMINANCE4_ALPHA4                   = 0x8043,
+GL_LUMINANCE6_ALPHA2                   = 0x8044,
+GL_LUMINANCE8_ALPHA8                   = 0x8045,
+GL_LUMINANCE12_ALPHA4                  = 0x8046,
+GL_LUMINANCE12_ALPHA12                 = 0x8047,
+GL_LUMINANCE16_ALPHA16                 = 0x8048,
+GL_INTENSITY                           = 0x8049,
+GL_INTENSITY4                          = 0x804A,
+GL_INTENSITY8                          = 0x804B,
+GL_INTENSITY12                         = 0x804C,
+GL_INTENSITY16                         = 0x804D,
+GL_R3_G3_B2                            = 0x2A10,
+GL_RGB4                                = 0x804F,
+GL_RGB5                                = 0x8050,
+GL_RGB8                                = 0x8051,
+GL_RGB10                               = 0x8052,
+GL_RGB12                               = 0x8053,
+GL_RGB16                               = 0x8054,
+GL_RGBA2                               = 0x8055,
+GL_RGBA4                               = 0x8056,
+GL_RGB5_A1                             = 0x8057,
+GL_RGBA8                               = 0x8058,
+GL_RGB10_A2                            = 0x8059,
+GL_RGBA12                              = 0x805A,
+GL_RGBA16                              = 0x805B,
+}
+
+enum : GLuint
+{
+    GL_CLIENT_PIXEL_STORE_BIT              = 0x00000001,
+    GL_CLIENT_VERTEX_ARRAY_BIT             = 0x00000002,
+    GL_ALL_CLIENT_ATTRIB_BITS              = 0xFFFFFFFF,
+    GL_CLIENT_ALL_ATTRIB_BITS              = 0xFFFFFFFF,
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/opengl/hellogl/opengl/glu.d	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,196 @@
+module opengl.glu;
+
+private import opengl.gltypes;
+
+//==============================================================================
+// CONSTANTS
+//==============================================================================
+enum : GLenum
+{
+    // StringName
+    GLU_VERSION                      = 100800,
+    GLU_EXTENSIONS                   = 100801,
+    // ErrorCode
+    GLU_INVALID_ENUM                 = 100900,
+    GLU_INVALID_VALUE                = 100901,
+    GLU_OUT_OF_MEMORY                = 100902,
+    GLU_INVALID_OPERATION            = 100904,
+    // NurbsDisplay
+    GLU_OUTLINE_POLYGON              = 100240,
+    GLU_OUTLINE_PATCH                = 100241,
+    // NurbsCallback
+    GLU_NURBS_ERROR                  = 100103,
+    GLU_ERROR                        = 100103,
+    GLU_NURBS_BEGIN                  = 100164,
+    GLU_NURBS_BEGIN_EXT              = 100164,
+    GLU_NURBS_VERTEX                 = 100165,
+    GLU_NURBS_VERTEX_EXT             = 100165,
+    GLU_NURBS_NORMAL                 = 100166,
+    GLU_NURBS_NORMAL_EXT             = 100166,
+    GLU_NURBS_COLOR                  = 100167,
+    GLU_NURBS_COLOR_EXT              = 100167,
+    GLU_NURBS_TEXTURE_COORD          = 100168,
+    GLU_NURBS_TEX_COORD_EXT          = 100168,
+    GLU_NURBS_END                    = 100169,
+    GLU_NURBS_END_EXT                = 100169,
+    GLU_NURBS_BEGIN_DATA             = 100170,
+    GLU_NURBS_BEGIN_DATA_EXT         = 100170,
+    GLU_NURBS_VERTEX_DATA            = 100171,
+    GLU_NURBS_VERTEX_DATA_EXT        = 100171,
+    GLU_NURBS_NORMAL_DATA            = 100172,
+    GLU_NURBS_NORMAL_DATA_EXT        = 100172,
+    GLU_NURBS_COLOR_DATA             = 100173,
+    GLU_NURBS_COLOR_DATA_EXT         = 100173,
+    GLU_NURBS_TEXTURE_COORD_DATA     = 100174,
+    GLU_NURBS_TEX_COORD_DATA_EXT     = 100174,
+    GLU_NURBS_END_DATA               = 100175,
+    GLU_NURBS_END_DATA_EXT           = 100175,
+    // NurbsError
+    GLU_NURBS_ERROR1                 = 100251,
+    GLU_NURBS_ERROR2                 = 100252,
+    GLU_NURBS_ERROR3                 = 100253,
+    GLU_NURBS_ERROR4                 = 100254,
+    GLU_NURBS_ERROR5                 = 100255,
+    GLU_NURBS_ERROR6                 = 100256,
+    GLU_NURBS_ERROR7                 = 100257,
+    GLU_NURBS_ERROR8                 = 100258,
+    GLU_NURBS_ERROR9                 = 100259,
+    GLU_NURBS_ERROR10                = 100260,
+    GLU_NURBS_ERROR11                = 100261,
+    GLU_NURBS_ERROR12                = 100262,
+    GLU_NURBS_ERROR13                = 100263,
+    GLU_NURBS_ERROR14                = 100264,
+    GLU_NURBS_ERROR15                = 100265,
+    GLU_NURBS_ERROR16                = 100266,
+    GLU_NURBS_ERROR17                = 100267,
+    GLU_NURBS_ERROR18                = 100268,
+    GLU_NURBS_ERROR19                = 100269,
+    GLU_NURBS_ERROR20                = 100270,
+    GLU_NURBS_ERROR21                = 100271,
+    GLU_NURBS_ERROR22                = 100272,
+    GLU_NURBS_ERROR23                = 100273,
+    GLU_NURBS_ERROR24                = 100274,
+    GLU_NURBS_ERROR25                = 100275,
+    GLU_NURBS_ERROR26                = 100276,
+    GLU_NURBS_ERROR27                = 100277,
+    GLU_NURBS_ERROR28                = 100278,
+    GLU_NURBS_ERROR29                = 100279,
+    GLU_NURBS_ERROR30                = 100280,
+    GLU_NURBS_ERROR31                = 100281,
+    GLU_NURBS_ERROR32                = 100282,
+    GLU_NURBS_ERROR33                = 100283,
+    GLU_NURBS_ERROR34                = 100284,
+    GLU_NURBS_ERROR35                = 100285,
+    GLU_NURBS_ERROR36                = 100286,
+    GLU_NURBS_ERROR37                = 100287,
+    // NurbsProperty
+    GLU_AUTO_LOAD_MATRIX             = 100200,
+    GLU_CULLING                      = 100201,
+    GLU_SAMPLING_TOLERANCE           = 100203,
+    GLU_DISPLAY_MODE                 = 100204,
+    GLU_PARAMETRIC_TOLERANCE         = 100202,
+    GLU_SAMPLING_METHOD              = 100205,
+    GLU_U_STEP                       = 100206,
+    GLU_V_STEP                       = 100207,
+    GLU_NURBS_MODE                   = 100160,
+    GLU_NURBS_MODE_EXT               = 100160,
+    GLU_NURBS_TESSELLATOR            = 100161,
+    GLU_NURBS_TESSELLATOR_EXT        = 100161,
+    GLU_NURBS_RENDERER               = 100162,
+    GLU_NURBS_RENDERER_EXT           = 100162,
+    // NurbsSampling
+    GLU_OBJECT_PARAMETRIC_ERROR      = 100208,
+    GLU_OBJECT_PARAMETRIC_ERROR_EXT  = 100208,
+    GLU_OBJECT_PATH_LENGTH           = 100209,
+    GLU_OBJECT_PATH_LENGTH_EXT       = 100209,
+    GLU_PATH_LENGTH                  = 100215,
+    GLU_PARAMETRIC_ERROR             = 100216,
+    GLU_DOMAIN_DISTANCE              = 100217,
+    // NurbsTrim
+    GLU_MAP1_TRIM_2                  = 100210,
+    GLU_MAP2_TRIM_3                  = 100211,
+    // QuadricDrawStyle
+    GLU_POINT                        = 100010,
+    GLU_LINE                         = 100011,
+    GLU_FILL                         = 100012,
+    GLU_SILHOUETTE                   = 100013,
+    // QuadricNormal
+    GLU_SMOOTH                       = 100000,
+    GLU_FLAT                         = 100001,
+    GLU_NONE                         = 100002,
+    // QuadricOrientation
+    GLU_OUTSIDE                      = 100020,
+    GLU_INSIDE                       = 100021,
+    // TessCallback
+    GLU_TESS_BEGIN                   = 100100,
+    GLU_BEGIN                        = 100100,
+    GLU_TESS_VERTEX                  = 100101,
+    GLU_VERTEX                       = 100101,
+    GLU_TESS_END                     = 100102,
+    GLU_END                          = 100102,
+    GLU_TESS_ERROR                   = 100103,
+    GLU_TESS_EDGE_FLAG               = 100104,
+    GLU_EDGE_FLAG                    = 100104,
+    GLU_TESS_COMBINE                 = 100105,
+    GLU_TESS_BEGIN_DATA              = 100106,
+    GLU_TESS_VERTEX_DATA             = 100107,
+    GLU_TESS_END_DATA                = 100108,
+    GLU_TESS_ERROR_DATA              = 100109,
+    GLU_TESS_EDGE_FLAG_DATA          = 100110,
+    GLU_TESS_COMBINE_DATA            = 100111,
+    // TessContour
+    GLU_CW                           = 100120,
+    GLU_CCW                          = 100121,
+    GLU_INTERIOR                     = 100122,
+    GLU_EXTERIOR                     = 100123,
+    GLU_UNKNOWN                      = 100124,
+    // TessProperty
+    GLU_TESS_WINDING_RULE            = 100140,
+    GLU_TESS_BOUNDARY_ONLY           = 100141,
+    GLU_TESS_TOLERANCE               = 100142,
+    // TessError
+    GLU_TESS_ERROR1                  = 100151,
+    GLU_TESS_ERROR2                  = 100152,
+    GLU_TESS_ERROR3                  = 100153,
+    GLU_TESS_ERROR4                  = 100154,
+    GLU_TESS_ERROR5                  = 100155,
+    GLU_TESS_ERROR6                  = 100156,
+    GLU_TESS_ERROR7                  = 100157,
+    GLU_TESS_ERROR8                  = 100158,
+    GLU_TESS_MISSING_BEGIN_POLYGON   = 100151,
+    GLU_TESS_MISSING_BEGIN_COUNTER   = 100152,
+    GLU_TESS_MISSING_END_POLYGON     = 100153,
+    GLU_TESS_MISSING_END_COUNTER     = 100154,
+    GLU_TESS_COORD_TOO_LARGE         = 100155,
+    GLU_TESS_NEED_COMBINE_CALLBACK   = 100156,
+    // TessWinding
+    GLU_TESS_WINDING_ODD             = 100130,
+    GLU_TESS_WINDING_NONZERO         = 100131,
+    GLU_TESS_WINDING_POSITIVE        = 100132,
+    GLU_TESS_WINDING_NEGATIVE        = 100133,
+    GLU_TESS_WINDING_ABS_GEQ_TWO     = 100134,
+}
+
+const GLdouble GLU_TESS_MAX_COORD           = 1.0e150;
+
+//==============================================================================
+// TYPES
+//==============================================================================
+struct GLUnurbs {}
+struct GLUquadric {}
+struct GLUtesselator {}
+
+typedef GLUnurbs GLUnurbsObj;
+typedef GLUquadric GLUquadricObj;
+typedef GLUtesselator GLUtesselatorObj;
+typedef GLUtesselator GLUtriangulatorObj;
+
+extern(C)
+{
+	void gluOrtho2D(GLdouble,GLdouble,GLdouble,GLdouble);
+	void gluPerspective(GLdouble,GLdouble,GLdouble,GLdouble);
+	void gluLookAt(GLdouble,GLdouble,GLdouble,GLdouble,GLdouble,GLdouble,GLdouble,GLdouble,GLdouble);
+	GLint gluProject(GLdouble,GLdouble,GLdouble,GLdouble*,GLdouble*,GLint*,GLdouble*,GLdouble*,GLdouble*);
+	GLint gluUnProject(GLdouble,GLdouble,GLdouble,GLdouble*,GLdouble*,GLint*,GLdouble*,GLdouble*,GLdouble*);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/opengl/hellogl/window.d	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,93 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the example classes of the Qt Toolkit.
+**
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+** exception, Nokia gives you certain additional rights. These rights
+** are described in the Nokia Qt GPL Exception version 1.3, included in
+** the file GPL_EXCEPTION.txt in this package.
+**
+** Qt for Windows(R) Licensees
+** As a special exception, Nokia, as the sole copyright holder for Qt
+** Designer, grants users of the Qt/Eclipse Integration plug-in the
+** right for the Qt/Eclipse Integration to link to functionality
+** provided by Qt Designer and its related libraries.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+****************************************************************************/
+
+import qt.gui.QWidget;
+import qt.gui.QSlider;
+import qt.gui.QHBoxLayout;
+
+import glwidget;
+
+class Window : public QWidget
+{
+//	Q_OBJECT
+	
+	public:
+		this()
+		{
+			glWidget = new GLWidget;
+			
+			xSlider = createSlider();
+			ySlider = createSlider();
+			zSlider = createSlider();
+			
+            xSlider.valueChanged.connect(&glWidget.setXRotation);
+            glWidget.xRotationChanged.connect(&xSlider.setValue);
+            ySlider.valueChanged.connect(&glWidget.setYRotation);
+            glWidget.yRotationChanged.connect(&ySlider.setValue);
+            zSlider.valueChanged.connect(&glWidget.setZRotation);
+            glWidget.zRotationChanged.connect(&zSlider.setValue);
+			
+			QHBoxLayout mainLayout = new QHBoxLayout;
+			mainLayout.addWidget(glWidget);
+			mainLayout.addWidget(xSlider);
+			mainLayout.addWidget(ySlider);
+			mainLayout.addWidget(zSlider);
+			setLayout(mainLayout);
+			
+			xSlider.setValue(15 * 16);
+			ySlider.setValue(345 * 16);
+			zSlider.setValue(0 * 16);
+			setWindowTitle(tr("Hello GL"));
+		}
+		
+	private:
+		QSlider createSlider()
+		{
+			auto slider = new QSlider(Qt.Vertical);
+			slider.setRange(0, 360 * 16);
+			slider.setSingleStep(16);
+			slider.setPageStep(15 * 16);
+			slider.setTickInterval(15 * 16);
+			slider.setTickPosition(QSlider.TicksRight);
+			return slider;
+		}
+		
+		GLWidget glWidget;
+		QSlider xSlider;
+		QSlider ySlider;
+		QSlider zSlider;
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/tutorials/tutorial/t1/build	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,3 @@
+#! /bin/bash
+
+dmd main.d -I../../../../ -L-L../../../../lib -L-lqtdgui -L-lqtdcore -L-lQtCore -L-lQtGui
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/tutorials/tutorial/t1/build.bat	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,1 @@
+dmd main.d libqtdcore.lib libqtdgui.lib -I../../../../
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/tutorials/tutorial/t1/main.d	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,47 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the example classes of the Qt Toolkit.
+**
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+** exception, Nokia gives you certain additional rights. These rights
+** are described in the Nokia Qt GPL Exception version 1.3, included in
+** the file GPL_EXCEPTION.txt in this package.
+**
+** Qt for Windows(R) Licensees
+** As a special exception, Nokia, as the sole copyright holder for Qt
+** Designer, grants users of the Qt/Eclipse Integration plug-in the
+** right for the Qt/Eclipse Integration to link to functionality
+** provided by Qt Designer and its related libraries.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+****************************************************************************/
+
+import qt.gui.QApplication;
+import qt.gui.QPushButton;
+
+int main(char[][] args)
+{
+    QApplication app = new QApplication(args);
+    QPushButton hello = new QPushButton("Hello world!");
+    hello.show();
+    return app.exec();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/tutorials/tutorial/t2/build	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,3 @@
+#! /bin/bash
+
+dmd main.d -I../../../../ -L-L../../../../lib -L-lqtdgui -L-lqtdcore -L-lQtCore -L-lQtGui
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/tutorials/tutorial/t2/build.bat	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,1 @@
+dmd main.d libqtdcore.lib libqtdgui.lib -I../../../../
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/tutorials/tutorial/t2/main.d	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the example classes of the Qt Toolkit.
+**
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+** exception, Nokia gives you certain additional rights. These rights
+** are described in the Nokia Qt GPL Exception version 1.3, included in
+** the file GPL_EXCEPTION.txt in this package.
+**
+** Qt for Windows(R) Licensees
+** As a special exception, Nokia, as the sole copyright holder for Qt
+** Designer, grants users of the Qt/Eclipse Integration plug-in the
+** right for the Qt/Eclipse Integration to link to functionality
+** provided by Qt Designer and its related libraries.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+****************************************************************************/
+
+import qt.gui.QApplication;
+import qt.gui.QFont;
+import qt.gui.QPushButton;
+
+
+int main(char[][] args)
+{
+    auto app = new QApplication(args);
+    auto quit = new QPushButton("Quit");
+
+    quit.resize(75, 30);
+    quit.setFont(new QFont("Times", 18, QFont.Bold));
+    quit.clicked.connect(&QApplication.quit);
+
+    quit.show();
+    return app.exec();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/tutorials/tutorial/t3/build	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,3 @@
+#! /bin/bash
+
+dmd main.d -I../../../../ -L-L../../../../lib -L-lqtdgui -L-lqtdcore -L-lQtCore -L-lQtGui
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/tutorials/tutorial/t3/build.bat	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,1 @@
+dmd main.d libqtdcore.lib libqtdgui.lib -I../../../../
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/tutorials/tutorial/t3/main.d	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the example classes of the Qt Toolkit.
+**
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+** exception, Nokia gives you certain additional rights. These rights
+** are described in the Nokia Qt GPL Exception version 1.3, included in
+** the file GPL_EXCEPTION.txt in this package.
+**
+** Qt for Windows(R) Licensees
+** As a special exception, Nokia, as the sole copyright holder for Qt
+** Designer, grants users of the Qt/Eclipse Integration plug-in the
+** right for the Qt/Eclipse Integration to link to functionality
+** provided by Qt Designer and its related libraries.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+****************************************************************************/
+
+import qt.gui.QApplication;
+import qt.gui.QFont;
+import qt.gui.QPushButton;
+import qt.gui.QWidget;
+
+import tango.io.Stdout;
+
+int main(char[][] args)
+{
+    QApplication app = new QApplication(args);
+    QWidget window = new QWidget();
+    window.resize(200, 120);
+    QPushButton quit = new QPushButton("Quit", window);
+
+    quit.setFont(new QFont("Times", 18, QFont.Light));
+    quit.setGeometry(10, 40, 180, 40);
+
+    quit.clicked.connect(&QApplication.quit);
+
+    window.show();
+    return app.exec();
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/tutorials/tutorial/t4/build	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,3 @@
+#! /bin/bash
+
+dmd main.d -I../../../../ -L-L../../../../lib -L-lqtdgui -L-lqtdcore -L-lQtCore -L-lQtGui
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/tutorials/tutorial/t4/build.bat	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,1 @@
+dmd main.d libqtdcore.lib libqtdgui.lib -I../../../../
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/tutorials/tutorial/t4/main.d	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the example classes of the Qt Toolkit.
+**
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+** exception, Nokia gives you certain additional rights. These rights
+** are described in the Nokia Qt GPL Exception version 1.3, included in
+** the file GPL_EXCEPTION.txt in this package.
+**
+** Qt for Windows(R) Licensees
+** As a special exception, Nokia, as the sole copyright holder for Qt
+** Designer, grants users of the Qt/Eclipse Integration plug-in the
+** right for the Qt/Eclipse Integration to link to functionality
+** provided by Qt Designer and its related libraries.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+****************************************************************************/
+
+import qt.gui.QApplication;
+import qt.gui.QFont;
+import qt.gui.QPushButton;
+import qt.gui.QWidget;
+
+class MyWidget : public QWidget
+{
+public:
+    this(QWidget parent = null)
+	{
+	    super(parent);
+		setFixedSize(200, 120);
+
+		auto quit = new QPushButton("Quit", this);
+		quit.setGeometry(62, 40, 75, 30);
+		quit.setFont(new QFont("Times", 18, QFont.Bold));
+		quit.clicked.connect(&QApplication.quit);
+	}
+}
+import tango.io.Stdout;
+int main(char[][] args)
+{
+    Stdout("hi!").newline;
+    auto app = new QApplication(args);
+    auto widget = new MyWidget;
+    widget.show();
+    return app.exec();
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/tutorials/tutorial/t5/build	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,3 @@
+#! /bin/bash
+
+dmd main.d -I../../../../ -L-L../../../../lib -L-lqtdgui -L-lqtdcore -L-lQtCore -L-lQtGui
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/tutorials/tutorial/t5/build.bat	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,1 @@
+dmd main.d libqtdcore.lib libqtdgui.lib -I../../../../
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/tutorials/tutorial/t5/main.d	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the example classes of the Qt Toolkit.
+**
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+** exception, Nokia gives you certain additional rights. These rights
+** are described in the Nokia Qt GPL Exception version 1.3, included in
+** the file GPL_EXCEPTION.txt in this package.
+**
+** Qt for Windows(R) Licensees
+** As a special exception, Nokia, as the sole copyright holder for Qt
+** Designer, grants users of the Qt/Eclipse Integration plug-in the
+** right for the Qt/Eclipse Integration to link to functionality
+** provided by Qt Designer and its related libraries.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+****************************************************************************/
+
+import qt.gui.QApplication;
+import qt.gui.QFont;
+import qt.gui.QLCDNumber;
+import qt.gui.QPushButton;
+import qt.gui.QSlider;
+import qt.gui.QVBoxLayout;
+import qt.gui.QWidget;
+
+
+class MyWidget : public QWidget
+{
+public:
+    this(QWidget parent = null)
+    {
+        super(parent);
+        auto quit = new QPushButton("Quit");
+        quit.setFont(new QFont("Times", 18, QFont.Bold));
+
+        auto lcd = new QLCDNumber(2);
+        lcd.setSegmentStyle(QLCDNumber.Filled);
+
+        auto slider = new QSlider(Qt.Horizontal);
+        slider.setRange(0, 99);
+        slider.setValue(0);
+
+        quit.clicked.connect(&QApplication.quit);
+        slider.valueChanged.connect(cast(void delegate(int)) &lcd.display);
+
+        auto layout = new QVBoxLayout;
+        layout.addWidget(quit);
+        layout.addWidget(lcd);
+        layout.addWidget(slider);
+        setLayout(layout);
+    }
+}
+
+int main(char[][] args)
+{
+    auto app = new QApplication(args);
+    auto widget = new MyWidget;
+    widget.show();
+    return app.exec();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/tutorials/tutorial/t6/build	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,3 @@
+#! /bin/bash
+
+dmd main.d -I../../../../ -L-L../../../../lib -L-lqtdgui -L-lqtdcore -L-lQtCore -L-lQtGui
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/tutorials/tutorial/t6/build.bat	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,1 @@
+dmd main.d libqtdcore.lib libqtdgui.lib -I../../../../
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/tutorials/tutorial/t6/main.d	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,103 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the example classes of the Qt Toolkit.
+**
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+** exception, Nokia gives you certain additional rights. These rights
+** are described in the Nokia Qt GPL Exception version 1.3, included in
+** the file GPL_EXCEPTION.txt in this package.
+**
+** Qt for Windows(R) Licensees
+** As a special exception, Nokia, as the sole copyright holder for Qt
+** Designer, grants users of the Qt/Eclipse Integration plug-in the
+** right for the Qt/Eclipse Integration to link to functionality
+** provided by Qt Designer and its related libraries.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+****************************************************************************/
+
+import qt.gui.QApplication;
+import qt.gui.QFont;
+import qt.gui.QGridLayout;
+import qt.gui.QLCDNumber;
+import qt.gui.QPushButton;
+import qt.gui.QSlider;
+import qt.gui.QVBoxLayout;
+import qt.gui.QWidget;
+
+
+class LCDRange : QWidget
+{
+public:
+    this(QWidget parent = null)
+	{
+	    super(parent);
+		
+		auto lcd = new QLCDNumber(2);
+		lcd.setSegmentStyle(QLCDNumber.Filled);
+
+		auto slider = new QSlider(Qt.Horizontal);
+		slider.setRange(0, 99);
+		slider.setValue(0);
+        slider.valueChanged.connect(cast(void delegate(int)) &lcd.display);
+
+		auto layout = new QVBoxLayout;
+		layout.addWidget(lcd);
+		layout.addWidget(slider);
+		setLayout(layout);
+	}
+}
+
+
+class MyWidget : QWidget
+{
+	this(QWidget parent = null)
+	{
+	    super(parent);
+		
+		auto quit = new QPushButton("Quit");
+		quit.setFont(new QFont("Times", 18, QFont.Bold));
+        quit.clicked.connect(&QApplication.quit);
+
+		auto grid = new QGridLayout;
+		for (int row = 0; row < 3; ++row) {
+			for (int column = 0; column < 3; ++column) {
+			    auto lcdRange = new LCDRange;
+				grid.addWidget(lcdRange, row, column);
+			}
+		}
+
+		auto layout = new QVBoxLayout;
+		layout.addWidget(quit);
+		layout.addLayout(grid);
+		setLayout(layout);
+	}
+}
+
+int main(char[][] args)
+{
+    auto app = new QApplication(args);
+    auto widget = new MyWidget;
+    widget.show();
+    return app.exec();
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/widgets/analogclock/AnalogClock.d	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,123 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the example classes of the Qt Toolkit.
+**
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+** exception, Nokia gives you certain additional rights. These rights
+** are described in the Nokia Qt GPL Exception version 1.3, included in
+** the file GPL_EXCEPTION.txt in this package.
+**
+** Qt for Windows(R) Licensees
+** As a special exception, Nokia, as the sole copyright holder for Qt
+** Designer, grants users of the Qt/Eclipse Integration plug-in the
+** right for the Qt/Eclipse Integration to link to functionality
+** provided by Qt Designer and its related libraries.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+****************************************************************************/
+
+module AnalogClock;
+
+import qt.core.QPoint;
+import qt.core.QTime;
+import qt.core.QTimer;
+
+import qt.gui.QWidget;
+import qt.gui.QPolygon;
+import qt.gui.QColor;
+import qt.gui.QPaintEvent;
+import qt.gui.QPainter;
+
+import tango.io.Stdout;
+
+class AnalogClock : public QWidget
+{
+public:
+    this(QWidget parent = null)
+    {
+        super(parent);
+        auto timer = new QTimer(this);
+        timer.timeout.connect(&this.update);
+        timer.start(1000);
+        setWindowTitle("Analog Clock");
+        resize(200, 200);
+    }
+
+    void paintEvent(QPaintEvent event)
+    {
+        static const QPoint[3] hourHand = [
+            QPoint(7, 8),
+            QPoint(-7, 8),
+            QPoint(0, -40)
+        ];
+        static const QPoint[3] minuteHand = [
+            QPoint(7, 8),
+            QPoint(-7, 8),
+            QPoint(0, -70)
+        ];
+
+        scope hourColor = new QColor(127, 0, 127);
+        scope minuteColor = new QColor(0, 127, 127, 191);
+
+        int side = qMin(width(), height());
+        QTime time = QTime.currentTime();
+
+        // !! it is important that QPainter object should be scoped
+        // !! in order to be destroyed after painting
+        scope painter = new QPainter(this);
+
+        painter.setRenderHint(QPainter.Antialiasing);
+        painter.translate(width() / 2, height() / 2);
+        painter.scale(side / 200.0, side / 200.0);
+
+        painter.setPen(Qt.NoPen);
+        painter.setBrush(hourColor);
+
+        painter.save();
+        painter.rotate(30.0 * ((time.hour() + time.minute() / 60.0)));
+        painter.drawConvexPolygon(hourHand);
+        painter.restore();
+
+        painter.setPen(hourColor);
+
+        for (int i = 0; i < 12; ++i) {
+            painter.drawLine(88, 0, 96, 0);
+            painter.rotate(30.0);
+        }
+
+        painter.setPen(Qt.NoPen);
+        painter.setBrush(minuteColor);
+
+        painter.save();
+        painter.rotate(6.0 * (time.minute() + time.second() / 60.0));
+        painter.drawConvexPolygon(minuteHand);
+        painter.restore();
+
+        painter.setPen(minuteColor);
+
+        for (int j = 0; j < 60; ++j) {
+            if ((j % 5) != 0)
+                painter.drawLine(92, 0, 96, 0);
+            painter.rotate(6.0);
+        }
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/widgets/analogclock/build	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,3 @@
+#! /bin/bash
+
+dmd main.d AnalogClock.d -I../../../ -L-L../../../lib -L-lqtdgui -L-lqtdcore -L-lQtCore -L-lQtGui
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/widgets/analogclock/main.d	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,50 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the example classes of the Qt Toolkit.
+**
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+** exception, Nokia gives you certain additional rights. These rights
+** are described in the Nokia Qt GPL Exception version 1.3, included in
+** the file GPL_EXCEPTION.txt in this package.
+**
+** Qt for Windows(R) Licensees
+** As a special exception, Nokia, as the sole copyright holder for Qt
+** Designer, grants users of the Qt/Eclipse Integration plug-in the
+** right for the Qt/Eclipse Integration to link to functionality
+** provided by Qt Designer and its related libraries.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+****************************************************************************/
+
+module main;
+
+import qt.gui.QApplication;
+import AnalogClock;
+
+
+int main(char[][] args)
+{
+    scope app = new QApplication(args);
+    scope clock = new AnalogClock;
+    clock.show();
+    return app.exec();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/widgets/calculator/build	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,3 @@
+#! /bin/bash
+
+dmd main.d button.d calculator.d -I../../../ -L-L../../../lib -L-lqtdgui -L-lqtdcore -L-lQtCore -L-lQtGui
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/widgets/calculator/build.bat	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,2 @@
+set LIB=..\..\..\lib
+dmd -I..\..\..\ main.d button.d calculator.d %LIB%\libqtdgui.lib %LIB%\libqtdcore.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/widgets/calculator/button.d	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the example classes of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+** 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 qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+module button;
+
+import qt.gui.QToolButton;
+import qt.gui.QSizePolicy;
+import qt.core.QSize;
+
+
+class Button : public QToolButton
+{
+public:
+        
+        this(char[] text, QWidget parent = null)
+        {
+                super(parent);
+                setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Preferred);
+                setText(text);
+        }
+
+        QSize sizeHint()
+        {
+                QSize size = super.sizeHint();
+                size.height = size.height + 20;
+                size.width= qMax(size.width(), size.height());
+                return size;
+        }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/widgets/calculator/calculator.d	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,389 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the example classes of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+** 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 qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+module calculator;
+
+import qt.gui.QDialog;
+import qt.gui.QGridLayout;
+import qt.gui.QLineEdit;
+import qt.gui.QFont;
+
+import tango.math.Math : pow, sqrt;
+import Float = tango.text.convert.Float;
+import Integer = tango.text.convert.Integer;
+import tango.core.Array;
+
+import button;
+
+
+class Calculator : public QDialog
+{
+        
+public:
+        
+        this(QWidget parent = null)
+        {
+                super(parent);
+
+                sumInMemory = 0.0;
+                sumSoFar = 0.0;
+                factorSoFar = 0.0;
+                waitingForOperand = true;
+
+                display = new QLineEdit("0");
+                display.setReadOnly(true);
+                display.setAlignment(Qt.AlignRight);
+                display.setMaxLength(15);
+
+                QFont font = display.font();
+                font.setPointSize(font.pointSize() + 8);
+                display.setFont(font);
+
+                for (int i = 0; i < NumDigitButtons; ++i) {
+                        digitButtons[i] = createButton(Integer.toString(i), &digitClicked);
+                }
+
+                Button pointButton = createButton(tr("."), &pointClicked);
+                Button changeSignButton = createButton(tr("+/-"), &changeSignClicked);
+
+                Button backspaceButton = createButton(tr("Backspace"), &backspaceClicked);
+                Button clearButton = createButton(tr("Clear"), &clear);
+                Button clearAllButton = createButton(tr("Clear All"), &clearAll);
+
+                Button clearMemoryButton = createButton(tr("MC"), &clearMemory);
+                Button readMemoryButton = createButton(tr("MR"), &readMemory);
+                Button setMemoryButton = createButton(tr("MS"), &setMemory);
+                Button addToMemoryButton = createButton(tr("M+"), &addToMemory);
+
+                Button divisionButton = createButton(tr("/"), &multiplicativeOperatorClicked);
+                Button timesButton = createButton(tr("*"), &multiplicativeOperatorClicked);
+                Button minusButton = createButton(tr("-"), &additiveOperatorClicked);
+                Button plusButton = createButton(tr("+"), &additiveOperatorClicked);
+
+                Button squareRootButton = createButton(tr("Sqrt"), &unaryOperatorClicked);
+                Button powerButton = createButton(tr("x^2"), &unaryOperatorClicked);
+                Button reciprocalButton = createButton(tr("1/x"), &unaryOperatorClicked);
+                Button equalButton = createButton(tr("="), &equalClicked);
+
+                QGridLayout mainLayout = new QGridLayout();
+
+                mainLayout.setSizeConstraint(QLayout.SetFixedSize);
+
+                mainLayout.addWidget(display, 0, 0, 1, 6);
+                mainLayout.addWidget(backspaceButton, 1, 0, 1, 2);
+                mainLayout.addWidget(clearButton, 1, 2, 1, 2);
+                mainLayout.addWidget(clearAllButton, 1, 4, 1, 2);
+
+                mainLayout.addWidget(clearMemoryButton, 2, 0);
+                mainLayout.addWidget(readMemoryButton, 3, 0);
+                mainLayout.addWidget(setMemoryButton, 4, 0);
+                mainLayout.addWidget(addToMemoryButton, 5, 0);
+
+                for (int i = 1; i < NumDigitButtons; ++i) {
+                        int row = ((9 - i) / 3) + 2;
+                        int column = ((i - 1) % 3) + 1;
+                        mainLayout.addWidget(digitButtons[i], row, column);
+                }
+
+                mainLayout.addWidget(digitButtons[0], 5, 1);
+                mainLayout.addWidget(pointButton, 5, 2);
+                mainLayout.addWidget(changeSignButton, 5, 3);
+
+                mainLayout.addWidget(divisionButton, 2, 4);
+                mainLayout.addWidget(timesButton, 3, 4);
+                mainLayout.addWidget(minusButton, 4, 4);
+                mainLayout.addWidget(plusButton, 5, 4);
+
+                mainLayout.addWidget(squareRootButton, 2, 5);
+                mainLayout.addWidget(powerButton, 3, 5);
+                mainLayout.addWidget(reciprocalButton, 4, 5);
+                mainLayout.addWidget(equalButton, 5, 5);
+                setLayout(mainLayout);
+
+                setWindowTitle(tr("Calculator"));
+        }
+
+//private slots:
+        void digitClicked()
+        {
+                Button clickedButton = cast(Button) signalSender();
+                int digitValue = Integer.toInt(clickedButton.text);
+                if (display.text() == "0" && digitValue == 0.0)
+                        return;
+
+                if (waitingForOperand) {
+                        display.clear();
+                        waitingForOperand = false;
+                }
+                display.setText(display.text() ~ Integer.toString(digitValue));
+        }
+
+        void unaryOperatorClicked()
+        {
+                Button clickedButton = cast(Button) signalSender();
+                char[] clickedOperator = clickedButton.text();
+                double operand = Float.toFloat(display.text);
+                double result = 0.0;
+
+                if (clickedOperator == tr("Sqrt")) {
+                        if (operand < 0.0) {
+                                abortOperation();
+                                return;
+                        }
+                        result = sqrt(operand);
+                } else if (clickedOperator == tr("x^2")) {
+                        result = pow(operand, 2.0);
+                } else if (clickedOperator == tr("1/x")) {
+                        if (operand == 0.0) {
+                                abortOperation();
+                                return;
+                        }
+                        result = 1.0 / operand;
+                }
+                display.setText(Float.toString(result, 4));
+                waitingForOperand = true;
+        }
+
+        void additiveOperatorClicked()
+        {
+                Button clickedButton = cast(Button) signalSender();
+                char[] clickedOperator = clickedButton.text();
+                double operand = Float.toFloat(display.text);
+
+                if (pendingMultiplicativeOperator.length) {
+                        if (!calculate(operand, pendingMultiplicativeOperator)) {
+                                abortOperation();
+                                return;
+                        }
+                        display.setText(Float.toString(factorSoFar, 4));
+                        operand = factorSoFar;
+                        factorSoFar = 0.0;
+                        pendingMultiplicativeOperator = null;
+                }
+
+                if (pendingAdditiveOperator.length) {
+                        if (!calculate(operand, pendingAdditiveOperator)) {
+                                abortOperation();
+                                return;
+                        }
+                        display.setText(Float.toString(sumSoFar, 4));
+                } else {
+                        sumSoFar = operand;
+                }
+
+                pendingAdditiveOperator = clickedOperator;
+                waitingForOperand = true;
+        }
+
+        void multiplicativeOperatorClicked()
+        {
+                Button clickedButton = cast(Button) signalSender();
+                char[] clickedOperator = clickedButton.text();
+                double operand = Float.toFloat(display.text);
+
+                if (pendingMultiplicativeOperator.length) {
+                        if (!calculate(operand, pendingMultiplicativeOperator)) {
+                                abortOperation();
+                                return;
+                        }
+                        display.setText(Float.toString(factorSoFar, 4));
+                } else {
+                        factorSoFar = operand;
+                }
+
+                pendingMultiplicativeOperator = clickedOperator;
+                waitingForOperand = true;
+        }
+
+        void equalClicked()
+        {
+                double operand = Float.toFloat(display.text);
+
+                if (pendingMultiplicativeOperator.length) {
+                        if (!calculate(operand, pendingMultiplicativeOperator)) {
+                                abortOperation();
+                                return;
+                        }
+                        operand = factorSoFar;
+                        factorSoFar = 0.0;
+                        pendingMultiplicativeOperator = null;
+                }
+                if (pendingAdditiveOperator.length) {
+                        if (!calculate(operand, pendingAdditiveOperator)) {
+                                abortOperation();
+                                return;
+                        }
+                        pendingAdditiveOperator = null;
+                } else {
+                        sumSoFar = operand;
+                }
+
+                display.setText(Float.toString(sumSoFar, 4));
+                sumSoFar = 0.0;
+                waitingForOperand = true;
+        }
+
+        void pointClicked()
+        {
+                char[] text = display.text;
+
+                if (waitingForOperand)
+                        display.setText("0");
+
+                if (find(text, '.') >= text.length)
+                        display.setText(text ~ tr("."));
+                
+                waitingForOperand = false;
+        }
+
+        void changeSignClicked()
+        {
+                char[] text = display.text();
+                double value = Float.toFloat(text);
+
+                if (value > 0.0) {
+                        text = "-" ~ text;
+                } else if (value < 0.0) {
+                        text = text[1..$];
+                }
+                display.setText(text);
+        }
+
+        void backspaceClicked()
+        {
+                if (waitingForOperand)
+                        return;
+
+                char[] text = display.text();
+                text = text[0..$-1];
+                if (text.length == 0) {
+                        text = "0";
+                        waitingForOperand = true;
+                }
+                display.setText(text);
+        }
+
+
+        void clear()
+        {
+                if (waitingForOperand)
+                        return;
+
+                display.setText("0");
+                waitingForOperand = true;
+        }
+
+        void clearAll()
+        {
+                sumSoFar = 0.0;
+                factorSoFar = 0.0;
+                pendingAdditiveOperator = null;
+                pendingMultiplicativeOperator = null;
+                display.setText("0");
+                waitingForOperand = true;
+        }
+
+        void clearMemory()
+        {
+                sumInMemory = 0.0;
+        }
+
+        void readMemory()
+        {
+                display.setText(Float.toString(sumInMemory, 4));
+                waitingForOperand = true;
+        }
+
+        void setMemory()
+        {
+                equalClicked();
+                sumInMemory = Float.toFloat(display.text);
+        }
+
+        void addToMemory()
+        {
+                equalClicked();
+                sumInMemory += Float.toFloat(display.text);
+        }
+
+private:
+
+        Button createButton(char[] text, void delegate() member)
+        {
+                Button button = new Button(text);
+                button.clicked.connect(member);
+                return button;
+        }
+
+        void abortOperation()
+        {
+                clearAll();
+                display.setText(tr("####"));
+        }
+
+        bool calculate(double rightOperand, char[] pendingOperator)
+        {
+                if (pendingOperator == tr("+")) {
+                        sumSoFar += rightOperand;
+                } else if (pendingOperator == tr("-")) {
+                        sumSoFar -= rightOperand;
+                } else if (pendingOperator == tr("*")) {
+                        factorSoFar *= rightOperand;
+                } else if (pendingOperator == tr("/")) {
+                        if (rightOperand == 0.0)
+                                return false;
+                        factorSoFar /= rightOperand;
+                }
+                return true;
+        }
+
+        double sumInMemory;
+        double sumSoFar;
+        double factorSoFar;
+        char[] pendingAdditiveOperator;
+        char[] pendingMultiplicativeOperator;
+        bool waitingForOperand;
+
+        QLineEdit display;
+
+        enum { NumDigitButtons = 10 };
+        Button[NumDigitButtons] digitButtons;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/widgets/calculator/main.d	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the example classes of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+** 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 qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+module main;
+
+import qt.gui.QApplication;
+
+import calculator;
+
+
+int main(char[][] args)
+{
+        scope app = new QApplication(args);
+        scope calc = new Calculator();
+        calc.show();
+        return app.exec();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/abstractmetabuilder.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,2601 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#include "abstractmetabuilder.h"
+#include "reporthandler.h"
+
+#include "ast.h"
+#include "binder.h"
+#include "control.h"
+#include "default_visitor.h"
+#include "dumptree.h"
+#include "lexer.h"
+#include "parser.h"
+#include "tokens.h"
+
+#include <QtCore/QDebug>
+#include <QtCore/QFile>
+#include <QtCore/QFileInfo>
+#include <QtCore/QTextCodec>
+#include <QtCore/QTextStream>
+#include <QtCore/QVariant>
+
+static QString strip_template_args(const QString &name)
+{
+    int pos = name.indexOf('<');
+    return pos < 0 ? name : name.left(pos);
+}
+
+static QHash<QString, QString> *operator_names;
+QString rename_operator(const QString &oper)
+{
+    QString op = oper.trimmed();
+    if (!operator_names) {
+        operator_names = new QHash<QString, QString>;
+
+        operator_names->insert("+", "add");
+        operator_names->insert("-", "subtract");
+        operator_names->insert("*", "multiply");
+        operator_names->insert("/", "divide");
+        operator_names->insert("%", "modulo");
+        operator_names->insert("&", "and");
+        operator_names->insert("|", "or");
+        operator_names->insert("^", "xor");
+        operator_names->insert("~", "negate");
+        operator_names->insert("<<", "shift_left");
+        operator_names->insert(">>", "shift_right");
+
+        // assigments
+        operator_names->insert("=", "assign");
+        operator_names->insert("+=", "add_assign");
+        operator_names->insert("-=", "subtract_assign");
+        operator_names->insert("*=", "multiply_assign");
+        operator_names->insert("/=", "divide_assign");
+        operator_names->insert("%=", "modulo_assign");
+        operator_names->insert("&=", "and_assign");
+        operator_names->insert("|=", "or_assign");
+        operator_names->insert("^=", "xor_assign");
+        operator_names->insert("<<=", "shift_left_assign");
+        operator_names->insert(">>=", "shift_right_assign");
+
+        // Logical
+        operator_names->insert("&&", "logical_and");
+        operator_names->insert("||", "logical_or");
+        operator_names->insert("!", "not");
+
+        // incr/decr
+        operator_names->insert("++", "increment");
+        operator_names->insert("--", "decrement");
+
+        // compare
+        operator_names->insert("<", "less");
+        operator_names->insert(">", "greater");
+        operator_names->insert("<=", "less_or_equal");
+        operator_names->insert(">=", "greater_or_equal");
+        operator_names->insert("!=", "not_equal");
+        operator_names->insert("==", "equal");
+
+        // other
+        operator_names->insert("[]", "subscript");
+        operator_names->insert("->", "pointer");
+    }
+
+    if (!operator_names->contains(op)) {
+        TypeDatabase *tb = TypeDatabase::instance();
+
+        TypeParser::Info typeInfo = TypeParser::parse(op);
+        QString cast_to_name = typeInfo.qualified_name.join("::");
+        TypeEntry *te = tb->findType(cast_to_name);
+        if ((te && te->codeGeneration() == TypeEntry::GenerateNothing)
+            || tb->isClassRejected(cast_to_name)) {
+            return QString();
+        } else if (te) {
+            return "operator_cast_" + typeInfo.qualified_name.join("_");
+        } else {
+            ReportHandler::warning(QString("unknown operator '%1'").arg(op));
+            return "operator " + op;
+        }
+    }
+
+    return "operator_" + operator_names->value(op);
+}
+
+AbstractMetaBuilder::AbstractMetaBuilder()
+    : m_current_class(0)
+{
+}
+
+void AbstractMetaBuilder::checkFunctionModifications()
+{
+    TypeDatabase *types = TypeDatabase::instance();
+    SingleTypeEntryHash entryHash = types->entries();
+    QList<TypeEntry *> entries = entryHash.values();
+    foreach (TypeEntry *entry, entries) {
+        if (entry == 0)
+            continue;
+        if (!entry->isComplex() || entry->codeGeneration() == TypeEntry::GenerateNothing)
+            continue;
+
+        ComplexTypeEntry *centry = static_cast<ComplexTypeEntry *>(entry);
+        FunctionModificationList modifications = centry->functionModifications();
+
+        foreach (FunctionModification modification, modifications) {
+            QString signature = modification.signature;
+
+            QString name = signature.trimmed();
+            name = name.mid(0, signature.indexOf("("));
+
+            AbstractMetaClass *clazz = m_meta_classes.findClass(centry->qualifiedCppName());
+            if (clazz == 0)
+                continue;
+
+            AbstractMetaFunctionList functions = clazz->functions();
+            bool found = false;
+            QStringList possibleSignatures;
+            foreach (AbstractMetaFunction *function, functions) {
+                if (function->minimalSignature() == signature && function->implementingClass() == clazz) {
+                    found = true;
+                    break;
+                }
+
+                if (function->originalName() == name)
+                    possibleSignatures.append(function->minimalSignature() + " in " + function->implementingClass()->name());
+            }
+
+            if (!found) {
+                QString warning
+                    = QString("signature '%1' for function modification in '%2' not found. Possible candidates: %3")
+                        .arg(signature)
+                        .arg(clazz->qualifiedCppName())
+                        .arg(possibleSignatures.join(", "));
+
+                ReportHandler::warning(warning);
+            }
+        }
+    }
+}
+
+AbstractMetaClass *AbstractMetaBuilder::argumentToClass(ArgumentModelItem argument)
+{
+    AbstractMetaClass *returned = 0;
+    bool ok = false;
+    AbstractMetaType *type = translateType(argument->type(), &ok);
+    if (ok && type != 0 && type->typeEntry() != 0 && type->typeEntry()->isComplex()) {
+        const TypeEntry *entry = type->typeEntry();
+        returned = m_meta_classes.findClass(entry->name());
+    }
+    delete type;
+    return returned;
+}
+
+/**
+ * Checks the argument of a hash function and flags the type if it is a complex type
+ */
+void AbstractMetaBuilder::registerHashFunction(FunctionModelItem function_item)
+{
+    ArgumentList arguments = function_item->arguments();
+    if (arguments.size() == 1) {
+        if (AbstractMetaClass *cls = argumentToClass(arguments.at(0)))
+            cls->setHasHashFunction(true);
+    }
+}
+
+/**
+ * Check if a class has a debug stream operator that can be used as toString
+ */
+
+void AbstractMetaBuilder::registerToStringCapability(FunctionModelItem function_item)
+{
+    ArgumentList arguments = function_item->arguments();
+    if (arguments.size() == 2) {
+        if (arguments.at(0)->type().toString() == "QDebug"){
+            ArgumentModelItem arg = arguments.at(1);
+            if (AbstractMetaClass *cls = argumentToClass(arg)) {
+                if (arg->type().indirections() < 2) {
+                    cls->setToStringCapability(function_item);
+                }
+            }
+        }
+    }
+}
+
+void AbstractMetaBuilder::traverseCompareOperator(FunctionModelItem item) {
+    ArgumentList arguments = item->arguments();
+    if (arguments.size() == 2 && item->accessPolicy() == CodeModel::Public) {
+        AbstractMetaClass *comparer_class = argumentToClass(arguments.at(0));
+        AbstractMetaClass *compared_class = argumentToClass(arguments.at(1));
+        if (comparer_class != 0 && compared_class != 0) {
+            AbstractMetaClass *old_current_class = m_current_class;
+            m_current_class = comparer_class;
+
+            AbstractMetaFunction *meta_function = traverseFunction(item);
+            if (meta_function != 0 && !meta_function->isInvalid()) {
+                // Strip away first argument, since that is the containing object
+                AbstractMetaArgumentList arguments = meta_function->arguments();
+                arguments.pop_front();
+                meta_function->setArguments(arguments);
+
+                meta_function->setFunctionType(AbstractMetaFunction::GlobalScopeFunction);
+
+                meta_function->setOriginalAttributes(meta_function->attributes());
+                setupFunctionDefaults(meta_function, comparer_class);
+
+                comparer_class->addFunction(meta_function);
+            } else if (meta_function != 0) {
+                delete meta_function;
+            }
+
+            m_current_class = old_current_class;
+        }
+    }
+}
+
+void AbstractMetaBuilder::traverseStreamOperator(FunctionModelItem item)
+{
+    ArgumentList arguments = item->arguments();
+    if (arguments.size() == 2 && item->accessPolicy() == CodeModel::Public) {
+        AbstractMetaClass *streamClass = argumentToClass(arguments.at(0));
+        AbstractMetaClass *streamedClass = argumentToClass(arguments.at(1));
+
+        if (streamClass != 0 && streamedClass != 0
+            && (streamClass->name() == "QDataStream" || streamClass->name() == "QTextStream")) {
+            AbstractMetaClass *old_current_class = m_current_class;
+            m_current_class = streamedClass;
+            AbstractMetaFunction *streamFunction = traverseFunction(item);
+
+            if (streamFunction != 0 && !streamFunction->isInvalid()) {
+                QString name = item->name();
+                streamFunction->setFunctionType(AbstractMetaFunction::GlobalScopeFunction);
+
+                if (name.endsWith("<<"))
+                    streamFunction->setName("writeTo");
+                else
+                    streamFunction->setName("readFrom");
+
+                // Strip away last argument, since that is the containing object
+                AbstractMetaArgumentList arguments = streamFunction->arguments();
+                arguments.pop_back();
+                streamFunction->setArguments(arguments);
+
+                *streamFunction += AbstractMetaAttributes::Final;
+                *streamFunction += AbstractMetaAttributes::Public;
+                streamFunction->setOriginalAttributes(streamFunction->attributes());
+
+                streamFunction->setType(0);
+
+                setupFunctionDefaults(streamFunction, streamedClass);
+
+                streamedClass->addFunction(streamFunction);
+                streamedClass->typeEntry()->addExtraInclude(streamClass->typeEntry()->include());
+
+                m_current_class = old_current_class;
+            }
+        }
+    }
+}
+
+void AbstractMetaBuilder::fixQObjectForScope(TypeDatabase *types,
+                     NamespaceModelItem scope)
+{
+    foreach (ClassModelItem item, scope->classes()) {
+        QString qualified_name = item->qualifiedName().join("::");
+        TypeEntry *entry = types->findType(qualified_name);
+        if (entry) {
+        if (isQObject(qualified_name) && entry->isComplex()) {
+                ((ComplexTypeEntry *) entry)->setQObject(true);
+        }
+    }
+    }
+
+    foreach (NamespaceModelItem item, scope->namespaceMap().values()) {
+        if (scope != item)
+      fixQObjectForScope(types, item);
+    }
+}
+
+static bool class_less_than(AbstractMetaClass *a, AbstractMetaClass *b)
+{
+    return a->name() < b->name();
+}
+
+
+void AbstractMetaBuilder::sortLists()
+{
+   qSort(m_meta_classes.begin(), m_meta_classes.end(), class_less_than);
+   foreach (AbstractMetaClass *cls, m_meta_classes) {
+        cls->sortFunctions();
+   }
+}
+
+bool AbstractMetaBuilder::build()
+{
+    Q_ASSERT(!m_file_name.isEmpty());
+    ReportHandler::setContext("Parser");
+
+    QFile file(m_file_name);
+
+    if (!file.open(QFile::ReadOnly))
+        return false;
+
+    QTextStream stream(&file);
+    stream.setCodec(QTextCodec::codecForName("UTF-8"));
+    QByteArray contents = stream.readAll().toUtf8();
+    file.close();
+
+    Control control;
+    Parser p(&control);
+    pool __pool;
+
+    TranslationUnitAST *ast = p.parse(contents, contents.size(), &__pool);
+
+    CodeModel model;
+    Binder binder(&model, p.location());
+    m_dom = binder.run(ast);
+
+
+    ReportHandler::setContext("MetaJavaBuilder");
+
+
+    pushScope(model_dynamic_cast<ScopeModelItem>(m_dom));
+
+    QHash<QString, ClassModelItem> typeMap = m_dom->classMap();
+
+
+    // fix up QObject's in the type system..
+    TypeDatabase *types = TypeDatabase::instance();
+    fixQObjectForScope(types, model_dynamic_cast<NamespaceModelItem>(m_dom));
+
+
+    // Start the generation...
+    foreach (ClassModelItem item, typeMap.values()) {
+        AbstractMetaClass *cls = traverseClass(item);
+        addAbstractMetaClass(cls);
+    }
+
+
+    QHash<QString, NamespaceModelItem> namespaceMap = m_dom->namespaceMap();
+    foreach (NamespaceModelItem item, namespaceMap.values()) {
+        AbstractMetaClass *meta_class = traverseNamespace(item);
+        if (meta_class)
+            m_meta_classes << meta_class;
+    }
+
+
+    // Some trickery to support global-namespace enums...
+    QHash<QString, EnumModelItem> enumMap = m_dom->enumMap();
+    m_current_class = 0;
+    foreach (EnumModelItem item, enumMap) {
+        AbstractMetaEnum *meta_enum = traverseEnum(item, 0, QSet<QString>());
+
+        if (meta_enum) {
+            QString package = meta_enum->typeEntry()->javaPackage();
+            QString globalName = TypeDatabase::globalNamespaceClassName(meta_enum->typeEntry());
+
+            AbstractMetaClass *global = m_meta_classes.findClass(package + "." + globalName);
+            if (!global) {
+                ComplexTypeEntry *gte = new ObjectTypeEntry(globalName);
+                gte->setTargetLangPackage(meta_enum->typeEntry()->javaPackage());
+                gte->setCodeGeneration(meta_enum->typeEntry()->codeGeneration());
+                global = createMetaClass();
+                global->setTypeEntry(gte);
+                *global += AbstractMetaAttributes::Final;
+                *global += AbstractMetaAttributes::Public;
+                *global += AbstractMetaAttributes::Fake;
+
+                m_meta_classes << global;
+            }
+
+            global->addEnum(meta_enum);
+            meta_enum->setEnclosingClass(global);
+            meta_enum->typeEntry()->setQualifier(globalName);
+        }
+
+
+    }
+
+
+    // Go through all typedefs to see if we have defined any
+    // specific typedefs to be used as classes.
+    TypeAliasList typeAliases = m_dom->typeAliases();
+    foreach (TypeAliasModelItem typeAlias, typeAliases) {
+        AbstractMetaClass *cls = traverseTypeAlias(typeAlias);
+        addAbstractMetaClass(cls);
+    }
+
+
+
+
+    foreach (AbstractMetaClass *cls, m_meta_classes) {
+        if (!cls->isInterface() && !cls->isNamespace()) {
+            setupInheritance(cls);
+        }
+    }
+
+
+    foreach (AbstractMetaClass *cls, m_meta_classes) {
+        cls->fixFunctions();
+
+        if (cls->typeEntry() == 0) {
+            ReportHandler::warning(QString("class '%1' does not have an entry in the type system")
+                                   .arg(cls->name()));
+        } else {
+            if (!cls->hasConstructors() && !cls->isFinalInCpp() && !cls->isInterface() && !cls->isNamespace())
+                cls->addDefaultConstructor();
+        }
+
+        if (cls->isAbstract() && !cls->isInterface()) {
+            cls->typeEntry()->setLookupName(cls->typeEntry()->targetLangName() + "_ConcreteWrapper");
+        }
+    }
+
+    QList<TypeEntry *> entries = TypeDatabase::instance()->entries().values();
+    foreach (const TypeEntry *entry, entries) {
+        if (entry->isPrimitive())
+            continue;
+
+        if ((entry->isValue() || entry->isObject())
+            && !entry->isString()
+            && !entry->isChar()
+            && !entry->isContainer()
+            && !entry->isCustom()
+            && !entry->isVariant()
+            && !m_meta_classes.findClass(entry->qualifiedCppName())) {
+            ReportHandler::warning(QString("type '%1' is specified in typesystem, but not defined. This could potentially lead to compilation errors.")
+                                   .arg(entry->qualifiedCppName()));
+        }
+
+        if (entry->isEnum()) {
+            QString pkg = entry->javaPackage();
+            QString name = (pkg.isEmpty() ? QString() : pkg + ".")
+                           + ((EnumTypeEntry *) entry)->javaQualifier();
+            AbstractMetaClass *cls = m_meta_classes.findClass(name);
+
+            if (!cls) {
+                ReportHandler::warning(QString("namespace '%1' for enum '%2' is not declared")
+                                       .arg(name).arg(entry->targetLangName()));
+            } else {
+                AbstractMetaEnum *e = cls->findEnum(entry->targetLangName());
+                if (!e)
+                    ReportHandler::warning(QString("enum '%1' is specified in typesystem, "
+                                                   "but not declared")
+                                           .arg(entry->qualifiedCppName()));
+            }
+        }
+    }
+
+    {
+        FunctionList hash_functions = m_dom->findFunctions("qHash");
+        foreach (FunctionModelItem item, hash_functions) {
+            registerHashFunction(item);
+        }
+    }
+
+    {
+        FunctionList hash_functions = m_dom->findFunctions("operator<<");
+        foreach (FunctionModelItem item, hash_functions) {
+            registerToStringCapability(item);
+        }
+    }
+
+    {
+        FunctionList compare_operators = m_dom->findFunctions("operator==")
+                                         + m_dom->findFunctions("operator<=")
+                                         + m_dom->findFunctions("operator>=")
+                                         + m_dom->findFunctions("operator<")
+                                         + m_dom->findFunctions("operator>");
+        foreach (FunctionModelItem item, compare_operators) {
+            traverseCompareOperator(item);
+        }
+    }
+
+    {
+        FunctionList stream_operators = m_dom->findFunctions("operator<<") + m_dom->findFunctions("operator>>");
+        foreach (FunctionModelItem item, stream_operators) {
+            traverseStreamOperator(item);
+        }
+    }
+
+    figureOutEnumValues();
+    figureOutDefaultEnumArguments();
+    checkFunctionModifications();
+
+    foreach (AbstractMetaClass *cls, m_meta_classes) {
+        setupEquals(cls);
+        setupComparable(cls);
+        setupClonable(cls);
+    }
+
+    dumpLog();
+
+    sortLists();
+
+    return true;
+}
+
+
+void AbstractMetaBuilder::addAbstractMetaClass(AbstractMetaClass *cls)
+{
+    if (!cls)
+        return;
+
+    cls->setOriginalAttributes(cls->attributes());
+    if (cls->typeEntry()->isContainer()) {
+        m_templates << cls;
+    } else {
+        m_meta_classes << cls;
+        if (cls->typeEntry()->designatedInterface()) {
+            AbstractMetaClass *interface = cls->extractInterface();
+            m_meta_classes << interface;
+            ReportHandler::debugSparse(QString(" -> interface '%1'").arg(interface->name()));
+        }
+    }
+}
+
+
+AbstractMetaClass *AbstractMetaBuilder::traverseNamespace(NamespaceModelItem namespace_item)
+{
+    QString namespace_name = (!m_namespace_prefix.isEmpty() ? m_namespace_prefix + "::" : QString()) + namespace_item->name();
+    NamespaceTypeEntry *type = TypeDatabase::instance()->findNamespaceType(namespace_name);
+
+    if (TypeDatabase::instance()->isClassRejected(namespace_name)) {
+        m_rejected_classes.insert(namespace_name, GenerationDisabled);
+        return 0;
+    }
+
+    if (!type) {
+        ReportHandler::warning(QString("namespace '%1' does not have a type entry")
+                               .arg(namespace_name));
+        return 0;
+    }
+
+    AbstractMetaClass *meta_class = createMetaClass();
+    meta_class->setTypeEntry(type);
+
+    *meta_class += AbstractMetaAttributes::Public;
+
+    m_current_class = meta_class;
+
+    ReportHandler::debugSparse(QString("namespace '%1.%2'")
+                               .arg(meta_class->package())
+                               .arg(namespace_item->name()));
+
+    traverseEnums(model_dynamic_cast<ScopeModelItem>(namespace_item), meta_class, namespace_item->enumsDeclarations());
+    traverseFunctions(model_dynamic_cast<ScopeModelItem>(namespace_item), meta_class);
+//     traverseClasses(model_dynamic_cast<ScopeModelItem>(namespace_item));
+
+    pushScope(model_dynamic_cast<ScopeModelItem>(namespace_item));
+    m_namespace_prefix = currentScope()->qualifiedName().join("::");
+
+
+    ClassList classes = namespace_item->classes();
+    foreach (ClassModelItem cls, classes) {
+        AbstractMetaClass *mjc = traverseClass(cls);
+        addAbstractMetaClass(mjc);
+    }
+
+    // Go through all typedefs to see if we have defined any
+    // specific typedefs to be used as classes.
+    TypeAliasList typeAliases = namespace_item->typeAliases();
+    foreach (TypeAliasModelItem typeAlias, typeAliases) {
+        AbstractMetaClass *cls = traverseTypeAlias(typeAlias);
+        addAbstractMetaClass(cls);
+    }
+
+
+
+    // Traverse namespaces recursively
+    QList<NamespaceModelItem> inner_namespaces = namespace_item->namespaceMap().values();
+    foreach (const NamespaceModelItem &ni, inner_namespaces) {
+        AbstractMetaClass *mjc = traverseNamespace(ni);
+        addAbstractMetaClass(mjc);
+    }
+
+    m_current_class = 0;
+
+
+    popScope();
+    m_namespace_prefix = currentScope()->qualifiedName().join("::");
+
+    if (!type->include().isValid()) {
+        QFileInfo info(namespace_item->fileName());
+        type->setInclude(Include(Include::IncludePath, info.fileName()));
+    }
+
+    return meta_class;
+}
+
+struct Operator
+{
+    enum Type { Plus, ShiftLeft, None };
+
+    Operator() : type(None) { }
+
+    int calculate(int x) {
+        switch (type) {
+        case Plus: return x + value;
+        case ShiftLeft: return x << value;
+        case None: return x;
+        }
+        return x;
+    }
+
+    Type type;
+    int value;
+};
+
+
+
+Operator findOperator(QString *s) {
+    const char *names[] = {
+        "+",
+        "<<"
+    };
+
+    for (int i=0; i<Operator::None; ++i) {
+        QString name = QLatin1String(names[i]);
+        QString str = *s;
+        int splitPoint = str.indexOf(name);
+        if (splitPoint > 0) {
+            bool ok;
+            QString right = str.mid(splitPoint + name.length());
+            Operator op;
+            op.value = right.toInt(&ok);
+            if (ok) {
+                op.type = Operator::Type(i);
+                *s = str.left(splitPoint).trimmed();
+                return op;
+            }
+        }
+    }
+    return Operator();
+}
+
+int AbstractMetaBuilder::figureOutEnumValue(const QString &stringValue,
+                                        int oldValuevalue,
+                                        AbstractMetaEnum *meta_enum,
+                                        AbstractMetaFunction *meta_function)
+{
+    if (stringValue.isEmpty())
+        return oldValuevalue;
+
+    QStringList stringValues = stringValue.split("|");
+
+    int returnValue = 0;
+
+    bool matched = false;
+
+    for (int i=0; i<stringValues.size(); ++i) {
+        QString s = stringValues.at(i).trimmed();
+
+        bool ok;
+        int v;
+
+        Operator op = findOperator(&s);
+
+        if (s.length() > 0 && s.at(0) == QLatin1Char('0'))
+            v = s.toUInt(&ok, 0);
+        else
+            v = s.toInt(&ok);
+
+        if (ok) {
+            matched = true;
+
+        } else if (m_enum_values.contains(s)) {
+            v = m_enum_values[s]->value();
+            matched = true;
+
+        } else {
+            AbstractMetaEnumValue *ev = 0;
+
+            if (meta_enum && (ev = meta_enum->values().find(s))) {
+                v = ev->value();
+                matched = true;
+
+            } else if (meta_enum && (ev = meta_enum->enclosingClass()->findEnumValue(s, meta_enum))) {
+                v = ev->value();
+                matched = true;
+
+            } else {
+                if (meta_enum)
+                    ReportHandler::warning("unhandled enum value: " + s + " in "
+                                           + meta_enum->enclosingClass()->name() + "::"
+                                           + meta_enum->name());
+                else
+                    ReportHandler::warning("unhandled enum value: Unknown enum");
+            }
+        }
+
+        if (matched)
+            returnValue |= op.calculate(v);
+    }
+
+    if (!matched) {
+        QString warn = QString("unmatched enum %1").arg(stringValue);
+
+        if (meta_function != 0) {
+            warn += QString(" when parsing default value of '%1' in class '%2'")
+                .arg(meta_function->name())
+                .arg(meta_function->implementingClass()->name());
+        }
+
+        ReportHandler::warning(warn);
+        returnValue = oldValuevalue;
+    }
+
+    return returnValue;
+}
+
+void AbstractMetaBuilder::figureOutEnumValuesForClass(AbstractMetaClass *meta_class,
+                                                  QSet<AbstractMetaClass *> *classes)
+{
+    AbstractMetaClass *base = meta_class->baseClass();
+
+    if (base != 0 && !classes->contains(base))
+        figureOutEnumValuesForClass(base, classes);
+
+    if (classes->contains(meta_class))
+        return;
+
+    AbstractMetaEnumList enums = meta_class->enums();
+    foreach (AbstractMetaEnum *e, enums) {
+        if (!e)
+            ReportHandler::warning("bad enum in class " + meta_class->name());
+        AbstractMetaEnumValueList lst = e->values();
+        int value = 0;
+        for (int i=0; i<lst.size(); ++i) {
+            value = figureOutEnumValue(lst.at(i)->stringValue(), value, e);
+            lst.at(i)->setValue(value);
+            value++;
+        }
+
+        // Check for duplicate values...
+        EnumTypeEntry *ete = e->typeEntry();
+        if (!ete->forceInteger()) {
+            QHash<int, AbstractMetaEnumValue *> entries;
+            foreach (AbstractMetaEnumValue *v, lst) {
+
+                bool vRejected = ete->isEnumValueRejected(v->name());
+
+                AbstractMetaEnumValue *current = entries.value(v->value());
+                if (current) {
+                    bool currentRejected = ete->isEnumValueRejected(current->name());
+                    if (!currentRejected && !vRejected) {
+                        ReportHandler::warning(
+                            QString("duplicate enum values: %1::%2, %3 and %4 are %5, already rejected: (%6)")
+                            .arg(meta_class->name())
+                            .arg(e->name())
+                            .arg(v->name())
+                            .arg(entries[v->value()]->name())
+                            .arg(v->value())
+                            .arg(ete->enumValueRejections().join(", ")));
+                        continue;
+                    }
+                }
+
+                if (!vRejected)
+                    entries[v->value()] = v;
+            }
+
+            // Entries now contain all the original entries, no
+            // rejected ones... Use this to generate the enumValueRedirection table.
+            foreach (AbstractMetaEnumValue *reject, lst) {
+                if (!ete->isEnumValueRejected(reject->name()))
+                    continue;
+
+                AbstractMetaEnumValue *used = entries.value(reject->value());
+                if (!used) {
+                    ReportHandler::warning(
+                        QString::fromLatin1("Rejected enum has no alternative...: %1::%2\n")
+                        .arg(meta_class->name())
+                        .arg(reject->name()));
+                    continue;
+                }
+                ete->addEnumValueRedirection(reject->name(), used->name());
+            }
+
+        }
+    }
+
+
+
+    *classes += meta_class;
+}
+
+
+void AbstractMetaBuilder::figureOutEnumValues()
+{
+    // Keep a set of classes that we already traversed. We use this to
+    // enforce that we traverse base classes prior to subclasses.
+    QSet<AbstractMetaClass *> classes;
+    foreach (AbstractMetaClass *c, m_meta_classes) {
+        figureOutEnumValuesForClass(c, &classes);
+    }
+}
+
+void AbstractMetaBuilder::figureOutDefaultEnumArguments()
+{
+    foreach (AbstractMetaClass *meta_class, m_meta_classes) {
+        foreach (AbstractMetaFunction *meta_function, meta_class->functions()) {
+            foreach (AbstractMetaArgument *arg, meta_function->arguments()) {
+
+                QString expr = arg->defaultValueExpression();
+                if (expr.isEmpty())
+                    continue;
+
+                if (!meta_function->replacedDefaultExpression(meta_function->implementingClass(),
+                    arg->argumentIndex()+1).isEmpty()) {
+                    continue;
+                }
+
+                QString new_expr = expr;
+                if (arg->type()->isEnum()) {
+                    QStringList lst = expr.split(QLatin1String("::"));
+                    if (lst.size() == 1) {
+                        QVector<AbstractMetaClass *> classes(1, meta_class);
+                        AbstractMetaEnum *e = 0;
+                        while (!classes.isEmpty() && e == 0) {
+                            if (classes.front() != 0) {
+                                classes << classes.front()->baseClass();
+
+                                AbstractMetaClassList interfaces = classes.front()->interfaces();
+                                foreach (AbstractMetaClass *interface, interfaces)
+                                    classes << interface->primaryInterfaceImplementor();
+
+                                e = classes.front()->findEnumForValue(expr);
+                            }
+
+                            classes.pop_front();
+                        }
+
+                        if (e != 0) {
+/* qtd                           new_expr = QString("%1.%2")
+                                    .arg(e->typeEntry()->qualifiedTargetLangName())
+                                    .arg(expr);
+                                    */
+//                            new_expr = arg->type()->typeEntry()->targetLangName() + "." + expr;
+                            new_expr = arg->type()->typeEntry()->qualifiedTargetLangName() + "." + expr;
+                        } else {
+                            ReportHandler::warning("Cannot find enum constant for value '" + expr + "' in '" + meta_class->name() + "' or any of its super classes");
+                        }
+                    } else if (lst.size() == 2) {
+                        AbstractMetaClass *cl = m_meta_classes.findClass(lst.at(0));
+                        if (!cl) {
+                            ReportHandler::warning("missing required class for enums: " + lst.at(0));
+                            continue;
+                        }
+/* qtd                        new_expr = QString("%1.%2.%3")
+                                   .arg(cl->typeEntry()->qualifiedTargetLangName())
+                                   .arg(arg->type()->name())
+                                   .arg(lst.at(1));
+                                   */
+//                        new_expr = arg->type()->typeEntry()->targetLangName() + "." + lst.at(1);
+                        new_expr = arg->type()->typeEntry()->qualifiedTargetLangName() + "." + lst.at(1);
+                    } else {
+                        ReportHandler::warning("bad default value passed to enum " + expr);
+                    }
+
+                } else if(arg->type()->isFlags()) {
+                    const FlagsTypeEntry *flagsEntry =
+                        static_cast<const FlagsTypeEntry *>(arg->type()->typeEntry());
+                    EnumTypeEntry *enumEntry = flagsEntry->originator();
+                    AbstractMetaEnum *meta_enum = m_meta_classes.findEnum(enumEntry);
+                    if (!meta_enum) {
+                        ReportHandler::warning("unknown required enum " + enumEntry->qualifiedCppName());
+                        continue;
+                    }
+
+                    int value = figureOutEnumValue(expr, 0, meta_enum, meta_function);
+                    new_expr = QString::number(value);
+
+                } else if (arg->type()->isPrimitive()) {
+                    AbstractMetaEnumValue *value = 0;
+                    if (expr.contains("::"))
+                        value = m_meta_classes.findEnumValue(expr);
+                    if (!value)
+                        value = meta_class->findEnumValue(expr, 0);
+
+                    if (value) {
+                        new_expr = QString::number(value->value());
+                    } else if (expr.contains(QLatin1Char('+'))) {
+                        new_expr = QString::number(figureOutEnumValue(expr, 0, 0));
+
+                    }
+
+
+
+                }
+
+                arg->setDefaultValueExpression(new_expr);
+            }
+        }
+    }
+}
+
+
+AbstractMetaEnum *AbstractMetaBuilder::traverseEnum(EnumModelItem enum_item, AbstractMetaClass *enclosing, const QSet<QString> &enumsDeclarations)
+{
+    // Skipping private enums.
+    if (enum_item->accessPolicy() == CodeModel::Private) {
+        return 0;
+    }
+
+    QString qualified_name = enum_item->qualifiedName().join("::");
+
+    TypeEntry *type_entry = TypeDatabase::instance()->findType(qualified_name);
+    QString enum_name = enum_item->name();
+
+    QString class_name;
+    if (m_current_class)
+        class_name = m_current_class->typeEntry()->qualifiedCppName();
+
+    if (TypeDatabase::instance()->isEnumRejected(class_name, enum_name)) {
+        m_rejected_enums.insert(qualified_name, GenerationDisabled);
+        return 0;
+    }
+
+    if (!type_entry || !type_entry->isEnum()) {
+        QString context = m_current_class ? m_current_class->name() : QLatin1String("");
+        ReportHandler::warning(QString("enum '%1' does not have a type entry or is not an enum")
+                               .arg(qualified_name));
+        m_rejected_enums.insert(qualified_name, NotInTypeSystem);
+       return 0;
+    }
+
+    AbstractMetaEnum *meta_enum = createMetaEnum();
+    if (   enumsDeclarations.contains(qualified_name)
+        || enumsDeclarations.contains(enum_name)) {
+        meta_enum->setHasQEnumsDeclaration(true);
+    }
+
+    meta_enum->setTypeEntry((EnumTypeEntry *) type_entry);
+    switch (enum_item->accessPolicy()) {
+    case CodeModel::Public: *meta_enum += AbstractMetaAttributes::Public; break;
+    case CodeModel::Protected: *meta_enum += AbstractMetaAttributes::Protected; break;
+//     case CodeModel::Private: *meta_enum += AbstractMetaAttributes::Private; break;
+    default: break;
+    }
+
+    ReportHandler::debugMedium(QString(" - traversing enum %1").arg(meta_enum->fullName()));
+
+    foreach (EnumeratorModelItem value, enum_item->enumerators()) {
+
+        AbstractMetaEnumValue *meta_enum_value = createMetaEnumValue();
+        meta_enum_value->setName(value->name());
+        // Deciding the enum value...
+
+        meta_enum_value->setStringValue(value->value());
+        meta_enum->addEnumValue(meta_enum_value);
+
+        ReportHandler::debugFull("   - " + meta_enum_value->name() + " = "
+                                 + meta_enum_value->value());
+
+        // Add into global register...
+        if (enclosing)
+            m_enum_values[enclosing->name() + "::" + meta_enum_value->name()] = meta_enum_value;
+        else
+            m_enum_values[meta_enum_value->name()] = meta_enum_value;
+    }
+
+    m_enums << meta_enum;
+
+    return meta_enum;
+}
+
+AbstractMetaClass *AbstractMetaBuilder::traverseTypeAlias(TypeAliasModelItem typeAlias)
+{
+    QString class_name = strip_template_args(typeAlias->name());
+
+    QString full_class_name = class_name;
+    // we have an inner class
+    if (m_current_class) {
+        full_class_name = strip_template_args(m_current_class->typeEntry()->qualifiedCppName())
+                          + "::" + full_class_name;
+    }
+
+    // If we haven't specified anything for the typedef, then we don't care
+    ComplexTypeEntry *type = TypeDatabase::instance()->findComplexType(full_class_name);
+    if (type == 0)
+        return 0;
+
+    if (type->isObject())
+        static_cast<ObjectTypeEntry *>(type)->setQObject(isQObject(strip_template_args(typeAlias->type().qualifiedName().join("::"))));
+
+    AbstractMetaClass *meta_class = createMetaClass();
+    meta_class->setTypeAlias(true);
+    meta_class->setTypeEntry(type);
+    meta_class->setBaseClassNames(QStringList() << typeAlias->type().qualifiedName().join("::"));
+    *meta_class += AbstractMetaAttributes::Public;
+
+    // Set the default include file name
+    if (!type->include().isValid()) {
+        QFileInfo info(typeAlias->fileName());
+        type->setInclude(Include(Include::IncludePath, info.fileName()));
+    }
+
+    return meta_class;
+}
+
+AbstractMetaClass *AbstractMetaBuilder::traverseClass(ClassModelItem class_item)
+{
+    QString class_name = strip_template_args(class_item->name());
+    QString full_class_name = class_name;
+
+    // we have inner an class
+    if (m_current_class) {
+        full_class_name = strip_template_args(m_current_class->typeEntry()->qualifiedCppName())
+                          + "::" + full_class_name;
+    }
+
+    ComplexTypeEntry *type = TypeDatabase::instance()->findComplexType(full_class_name);
+    RejectReason reason = NoReason;
+
+
+    if (TypeDatabase::instance()->isClassRejected(full_class_name)) {
+        reason = GenerationDisabled;
+    } else if (!type) {
+        TypeEntry *te = TypeDatabase::instance()->findType(full_class_name);
+        if (te && !te->isComplex())
+            reason = RedefinedToNotClass;
+        else
+            reason = NotInTypeSystem;
+    } else if (type->codeGeneration() == TypeEntry::GenerateNothing) {
+        reason = GenerationDisabled;
+    }
+
+    if (reason != NoReason) {
+        m_rejected_classes.insert(full_class_name, reason);
+        return 0;
+    }
+
+    if (type->isObject()) {
+        ((ObjectTypeEntry *)type)->setQObject(isQObject(full_class_name));
+    }
+
+    AbstractMetaClass *meta_class = createMetaClass();
+    meta_class->setTypeEntry(type);
+    meta_class->setBaseClassNames(class_item->baseClasses());
+    *meta_class += AbstractMetaAttributes::Public;
+
+    AbstractMetaClass *old_current_class = m_current_class;
+    m_current_class = meta_class;
+
+    if (type->isContainer()) {
+        ReportHandler::debugSparse(QString("container: '%1'").arg(full_class_name));
+    } else {
+        ReportHandler::debugSparse(QString("class: '%1'").arg(meta_class->fullName()));
+    }
+
+    TemplateParameterList template_parameters = class_item->templateParameters();
+    QList<TypeEntry *> template_args;
+    template_args.clear();
+    for (int i=0; i<template_parameters.size(); ++i) {
+        const TemplateParameterModelItem &param = template_parameters.at(i);
+        TemplateArgumentEntry *param_type = new TemplateArgumentEntry(param->name());
+        param_type->setOrdinal(i);
+        template_args.append(param_type);
+    }
+    meta_class->setTemplateArguments(template_args);
+
+    parseQ_Property(meta_class, class_item->propertyDeclarations());
+
+    traverseFunctions(model_dynamic_cast<ScopeModelItem>(class_item), meta_class);
+    traverseEnums(model_dynamic_cast<ScopeModelItem>(class_item), meta_class, class_item->enumsDeclarations());
+    traverseFields(model_dynamic_cast<ScopeModelItem>(class_item), meta_class);
+
+    // Inner classes
+    {
+        QList<ClassModelItem> inner_classes = class_item->classMap().values();
+        foreach (const ClassModelItem &ci, inner_classes) {
+            AbstractMetaClass *cl = traverseClass(ci);
+            if (cl) {
+                cl->setEnclosingClass(meta_class);
+                m_meta_classes << cl;
+            }
+        }
+
+    }
+
+    // Go through all typedefs to see if we have defined any
+    // specific typedefs to be used as classes.
+    TypeAliasList typeAliases = class_item->typeAliases();
+    foreach (TypeAliasModelItem typeAlias, typeAliases) {
+        AbstractMetaClass *cls = traverseTypeAlias(typeAlias);
+        if (cls != 0) {
+            cls->setEnclosingClass(meta_class);
+            addAbstractMetaClass(cls);
+        }
+    }
+
+
+    m_current_class = old_current_class;
+
+    // Set the default include file name
+    if (!type->include().isValid()) {
+        QFileInfo info(class_item->fileName());
+        type->setInclude(Include(Include::IncludePath, info.fileName()));
+    }
+
+    return meta_class;
+}
+
+AbstractMetaField *AbstractMetaBuilder::traverseField(VariableModelItem field, const AbstractMetaClass *cls)
+{
+    QString field_name = field->name();
+    QString class_name = m_current_class->typeEntry()->qualifiedCppName();
+
+    // Ignore friend decl.
+    if (field->isFriend())
+        return 0;
+
+    if (field->accessPolicy() == CodeModel::Private)
+        return 0;
+
+    if (TypeDatabase::instance()->isFieldRejected(class_name, field_name)) {
+        m_rejected_fields.insert(class_name + "::" + field_name, GenerationDisabled);
+        return 0;
+    }
+
+
+    AbstractMetaField *meta_field = createMetaField();
+    meta_field->setName(field_name);
+    meta_field->setEnclosingClass(cls);
+
+    bool ok;
+    TypeInfo field_type = field->type();
+    AbstractMetaType *meta_type = translateType(field_type, &ok);
+
+    if (!meta_type || !ok) {
+        ReportHandler::warning(QString("skipping field '%1::%2' with unmatched type '%3'")
+                               .arg(m_current_class->name())
+                               .arg(field_name)
+                               .arg(TypeInfo::resolveType(field_type, currentScope()->toItem()).qualifiedName().join("::")));
+        delete meta_field;
+        return 0;
+    }
+
+    meta_field->setType(meta_type);
+
+    uint attr = 0;
+    if (field->isStatic())
+        attr |= AbstractMetaAttributes::Static;
+
+    CodeModel::AccessPolicy policy = field->accessPolicy();
+    if (policy == CodeModel::Public)
+        attr |= AbstractMetaAttributes::Public;
+    else if (policy == CodeModel::Protected)
+        attr |= AbstractMetaAttributes::Protected;
+    else
+        attr |= AbstractMetaAttributes::Private;
+    meta_field->setAttributes(attr);
+
+    return meta_field;
+}
+
+void AbstractMetaBuilder::traverseFields(ScopeModelItem scope_item, AbstractMetaClass *meta_class)
+{
+    foreach (VariableModelItem field, scope_item->variables()) {
+        AbstractMetaField *meta_field = traverseField(field, meta_class);
+
+        if (meta_field) {
+            meta_field->setOriginalAttributes(meta_field->attributes());
+            meta_class->addField(meta_field);
+        }
+    }
+}
+
+void AbstractMetaBuilder::setupFunctionDefaults(AbstractMetaFunction *meta_function, AbstractMetaClass *meta_class)
+{
+    // Set the default value of the declaring class. This may be changed
+    // in fixFunctions later on
+    meta_function->setDeclaringClass(meta_class);
+
+    // Some of the queries below depend on the implementing class being set
+    // to function properly. Such as function modifications
+    meta_function->setImplementingClass(meta_class);
+
+    if (meta_function->name() == "operator_equal")
+        meta_class->setHasEqualsOperator(true);
+
+    if (!meta_function->isFinalInTargetLang()
+        && meta_function->isRemovedFrom(meta_class, TypeSystem::TargetLangCode)) {
+        *meta_function += AbstractMetaAttributes::FinalInCpp;
+    }
+}
+
+void AbstractMetaBuilder::traverseFunctions(ScopeModelItem scope_item, AbstractMetaClass *meta_class)
+{
+    foreach (FunctionModelItem function, scope_item->functions()) {
+        AbstractMetaFunction *meta_function = traverseFunction(function);
+
+        if (meta_function) {
+            meta_function->setOriginalAttributes(meta_function->attributes());
+            if (meta_class->isNamespace())
+                *meta_function += AbstractMetaAttributes::Static;
+
+            if (!meta_function->isInvalid()) {
+                if (QPropertySpec *read = meta_class->propertySpecForRead(meta_function->name())) {
+                    if (read->type() == meta_function->type()->typeEntry()) {
+                        *meta_function += AbstractMetaAttributes::PropertyReader;
+                        meta_function->setPropertySpec(read);
+//                     printf("%s is reader for %s\n",
+//                            qPrintable(meta_function->name()),
+//                            qPrintable(read->name()));
+                    }
+                } else if (QPropertySpec *write =
+                           meta_class->propertySpecForWrite(meta_function->name())) {
+                    if (write->type() == meta_function->arguments().at(0)->type()->typeEntry()) {
+                    *meta_function += AbstractMetaAttributes::PropertyWriter;
+                    meta_function->setPropertySpec(write);
+/*
+                    // qtd D properties syntax, rename setter from setPropertyName to just propertyName
+                    AbstractMetaFunction *f_copy = new AbstractMetaFunction();
+                    *f_copy = *meta_function;
+
+                    QString f_name = meta_function->name();
+                    QString new_name = f_name.midRef(3, 1).toString().toLower() + f_name.right(f_name.length() - 4);
+                    meta_function->setName(new_name);
+                    // f_copy->setOwnerClass(meta_function->ownerClass());
+                    ((AbstractMetaClass*)(meta_function->ownerClass()))->addFunction(f_copy); // hack qtd2
+                    //
+*/
+//                     printf("%s is writer for %s\n",
+//                            qPrintable(meta_function->name()),
+//                            qPrintable(write->name()));
+                    }
+                } else if (QPropertySpec *reset =
+                           meta_class->propertySpecForReset(meta_function->name())) {
+                    *meta_function += AbstractMetaAttributes::PropertyResetter;
+                    meta_function->setPropertySpec(reset);
+//                     printf("%s is resetter for %s\n",
+//                            qPrintable(meta_function->name()),
+//                            qPrintable(reset->name()));
+                }
+            }
+
+
+            bool isInvalidDestructor = meta_function->isDestructor() && meta_function->isPrivate();
+            bool isInvalidConstructor = meta_function->isConstructor()
+                && (meta_function->isPrivate() || meta_function->isInvalid());
+            if ((isInvalidDestructor || isInvalidConstructor)
+                && !meta_class->hasNonPrivateConstructor()) {
+                *meta_class += AbstractMetaAttributes::Final;
+            } else if (meta_function->isConstructor() && !meta_function->isPrivate()) {
+                *meta_class -= AbstractMetaAttributes::Final;
+                meta_class->setHasNonPrivateConstructor(true);
+            }
+
+            // Classes with virtual destructors should always have a shell class
+            // (since we aren't registering the destructors, we need this extra check)
+            if (meta_function->isDestructor() && !meta_function->isFinal())
+                meta_class->setForceShellClass(true);
+
+            if (!meta_function->isDestructor()
+                && !meta_function->isInvalid()
+                && (!meta_function->isConstructor() || !meta_function->isPrivate())) {
+
+                if (meta_class->typeEntry()->designatedInterface() && !meta_function->isPublic()
+                    && !meta_function->isPrivate()) {
+                    QString warn = QString("non-public function '%1' in interface '%2'")
+                        .arg(meta_function->name()).arg(meta_class->name());
+                    ReportHandler::warning(warn);
+
+                    meta_function->setVisibility(AbstractMetaClass::Public);
+                }
+
+                setupFunctionDefaults(meta_function, meta_class);
+
+                if (meta_function->isSignal() && meta_class->hasSignal(meta_function)) {
+                    QString warn = QString("signal '%1' in class '%2' is overloaded.")
+                        .arg(meta_function->name()).arg(meta_class->name());
+                    ReportHandler::warning(warn);
+                }
+
+                if (meta_function->isSignal() && !meta_class->isQObject()) {
+                    QString warn = QString("signal '%1' in non-QObject class '%2'")
+                        .arg(meta_function->name()).arg(meta_class->name());
+                    ReportHandler::warning(warn);
+                }
+
+                meta_class->addFunction(meta_function);
+            } else if (meta_function->isDestructor() && !meta_function->isPublic()) {
+                meta_class->setHasPublicDestructor(false);
+            }
+        }
+    }
+}
+
+bool AbstractMetaBuilder::setupInheritance(AbstractMetaClass *meta_class)
+{
+    Q_ASSERT(!meta_class->isInterface());
+
+    if (m_setup_inheritance_done.contains(meta_class))
+        return true;
+    m_setup_inheritance_done.insert(meta_class);
+
+    QStringList base_classes = meta_class->baseClassNames();
+
+    TypeDatabase *types = TypeDatabase::instance();
+
+    // we only support our own containers and ONLY if there is only one baseclass
+    if (base_classes.size() == 1 && base_classes.first().count('<') == 1) {
+        QStringList scope = meta_class->typeEntry()->qualifiedCppName().split("::");
+        scope.removeLast();
+        for (int i=scope.size(); i>=0; --i) {
+            QString prefix = i > 0 ? QStringList(scope.mid(0, i)).join("::") + "::" : QString();
+            QString complete_name = prefix + base_classes.first();
+            TypeParser::Info info = TypeParser::parse(complete_name);
+            QString base_name = info.qualified_name.join("::");
+
+            AbstractMetaClass *templ = 0;
+            foreach (AbstractMetaClass *c, m_templates) {
+                if (c->typeEntry()->name() == base_name) {
+                    templ = c;
+                    break;
+                }
+            }
+
+            if (templ == 0)
+                templ = m_meta_classes.findClass(base_name);
+
+            if (templ) {
+                setupInheritance(templ);
+                inheritTemplate(meta_class, templ, info);
+                return true;
+            }
+        }
+
+        ReportHandler::warning(QString("template baseclass '%1' of '%2' is not known")
+                                .arg(base_classes.first())
+                                .arg(meta_class->name()));
+        return false;
+    }
+
+    int primary = -1;
+    int primaries = 0;
+    for (int i=0; i<base_classes.size(); ++i) {
+
+        if (types->isClassRejected(base_classes.at(i)))
+            continue;
+
+        TypeEntry *base_class_entry = types->findType(base_classes.at(i));
+        if (!base_class_entry) {
+            ReportHandler::warning(QString("class '%1' inherits from unknown base class '%2'")
+                                   .arg(meta_class->name()).arg(base_classes.at(i)));
+        }
+
+        // true for primary base class
+        else if (!base_class_entry->designatedInterface()) {
+            if (primaries > 0) {
+                ReportHandler::warning(QString("class '%1' has multiple primary base classes"
+                                               " '%2' and '%3'")
+                                       .arg(meta_class->name())
+                                       .arg(base_classes.at(primary))
+                                       .arg(base_class_entry->name()));
+                return false;
+            }
+            primaries++;
+            primary = i;
+        }
+    }
+
+    if (primary >= 0) {
+        AbstractMetaClass *base_class = m_meta_classes.findClass(base_classes.at(primary));
+        if (!base_class) {
+            ReportHandler::warning(QString("unknown baseclass for '%1': '%2'")
+                                   .arg(meta_class->name())
+                                   .arg(base_classes.at(primary)));
+            return false;
+        }
+        meta_class->setBaseClass(base_class);
+
+        if (meta_class->typeEntry()->designatedInterface() != 0 && meta_class->isQObject()) {
+            ReportHandler::warning(QString("QObject extended by interface type '%1'. This is not supported and the generated Java code will not compile.")
+                                   .arg(meta_class->name()));
+        } else if (meta_class->typeEntry()->designatedInterface() != 0 && base_class != 0 && !base_class->isInterface()) {
+            ReportHandler::warning(QString("object type '%1' extended by interface type '%2'. The resulting API will be less expressive than the original.")
+                                   .arg(base_class->name())
+                                   .arg(meta_class->name()));
+        }
+
+    }
+
+    for (int i=0; i<base_classes.size(); ++i) {
+        if (types->isClassRejected(base_classes.at(i)))
+            continue;
+
+        if (i != primary) {
+            AbstractMetaClass *base_class = m_meta_classes.findClass(base_classes.at(i));
+            if (base_class == 0) {
+                ReportHandler::warning(QString("class not found for setup inheritance '%1'").arg(base_classes.at(i)));
+                return false;
+            }
+
+            setupInheritance(base_class);
+
+            QString interface_name = InterfaceTypeEntry::interfaceName(base_class->name());
+            AbstractMetaClass *iface = m_meta_classes.findClass(interface_name);
+            if (!iface) {
+                ReportHandler::warning(QString("unknown interface for '%1': '%2'")
+                                       .arg(meta_class->name())
+                                       .arg(interface_name));
+                return false;
+            }
+            meta_class->addInterface(iface);
+
+            AbstractMetaClassList interfaces = iface->interfaces();
+            foreach (AbstractMetaClass *iface, interfaces)
+                meta_class->addInterface(iface);
+        }
+    }
+
+    return true;
+}
+
+void AbstractMetaBuilder::traverseEnums(ScopeModelItem scope_item, AbstractMetaClass *meta_class, const QStringList &enumsDeclarations)
+{
+    EnumList enums = scope_item->enums();
+    foreach (EnumModelItem enum_item, enums) {
+        AbstractMetaEnum *meta_enum = traverseEnum(enum_item, meta_class, QSet<QString>::fromList(enumsDeclarations));
+        if (meta_enum) {
+            meta_enum->setOriginalAttributes(meta_enum->attributes());
+            meta_class->addEnum(meta_enum);
+            meta_enum->setEnclosingClass(meta_class);
+        }
+    }
+}
+
+AbstractMetaFunction *AbstractMetaBuilder::traverseFunction(FunctionModelItem function_item)
+{
+    QString function_name = function_item->name();
+    QString class_name = m_current_class->typeEntry()->qualifiedCppName();
+
+    if (TypeDatabase::instance()->isFunctionRejected(class_name, function_name)) {
+        m_rejected_functions.insert(class_name + "::" + function_name, GenerationDisabled);
+        return 0;
+    }
+
+
+    Q_ASSERT(function_item->functionType() == CodeModel::Normal
+             || function_item->functionType() == CodeModel::Signal
+             || function_item->functionType() == CodeModel::Slot);
+
+    if (function_item->isFriend())
+        return 0;
+
+
+    QString cast_type;
+
+    if (function_name.startsWith("operator")) {
+        function_name = rename_operator(function_name.mid(8));
+        if (function_name.isEmpty()) {
+            m_rejected_functions.insert(class_name + "::" + function_name,
+                                        GenerationDisabled);
+            return 0;
+        }
+        if (function_name.contains("_cast_"))
+            cast_type = function_name.mid(14).trimmed();
+    }
+
+    AbstractMetaFunction *meta_function = createMetaFunction();
+    meta_function->setConstant(function_item->isConstant());
+
+    ReportHandler::debugMedium(QString(" - %2()").arg(function_name));
+
+    meta_function->setName(function_name);
+    meta_function->setOriginalName(function_item->name());
+
+    if (function_item->isAbstract())
+        *meta_function += AbstractMetaAttributes::Abstract;
+
+    if (!meta_function->isAbstract())
+        *meta_function += AbstractMetaAttributes::Native;
+
+    if (!function_item->isVirtual())
+        *meta_function += AbstractMetaAttributes::Final;
+
+    if (function_item->isInvokable())
+        *meta_function += AbstractMetaAttributes::Invokable;
+
+    if (function_item->isStatic()) {
+        *meta_function += AbstractMetaAttributes::Static;
+        *meta_function += AbstractMetaAttributes::Final;
+    }
+
+    // Access rights
+    if (function_item->accessPolicy() == CodeModel::Public)
+        *meta_function += AbstractMetaAttributes::Public;
+    else if (function_item->accessPolicy() == CodeModel::Private)
+        *meta_function += AbstractMetaAttributes::Private;
+    else
+        *meta_function += AbstractMetaAttributes::Protected;
+
+
+    QString stripped_class_name = class_name;
+    int cc_pos = stripped_class_name.lastIndexOf("::");
+    if (cc_pos > 0)
+        stripped_class_name = stripped_class_name.mid(cc_pos + 2);
+
+    TypeInfo function_type = function_item->type();
+    if (function_name.startsWith('~')) {
+        meta_function->setFunctionType(AbstractMetaFunction::DestructorFunction);
+        meta_function->setInvalid(true);
+    } else if (strip_template_args(function_name) == stripped_class_name) {
+        meta_function->setFunctionType(AbstractMetaFunction::ConstructorFunction);
+        meta_function->setName(m_current_class->name());
+    } else {
+        bool ok;
+        AbstractMetaType *type = 0;
+
+        if (!cast_type.isEmpty()) {
+            TypeInfo info;
+            info.setQualifiedName(QStringList(cast_type));
+            type = translateType(info, &ok);
+        } else {
+            type = translateType(function_type, &ok);
+        }
+
+        if (!ok) {
+            ReportHandler::warning(QString("skipping function '%1::%2', unmatched return type '%3'")
+                                   .arg(class_name)
+                                   .arg(function_item->name())
+                                   .arg(function_item->type().toString()));
+            m_rejected_functions[class_name + "::" + function_name] =
+                UnmatchedReturnType;
+            meta_function->setInvalid(true);
+            return meta_function;
+        }
+        meta_function->setType(type);
+
+        if (function_item->functionType() == CodeModel::Signal)
+            meta_function->setFunctionType(AbstractMetaFunction::SignalFunction);
+        else if (function_item->functionType() == CodeModel::Slot)
+            meta_function->setFunctionType(AbstractMetaFunction::SlotFunction);
+    }
+
+    ArgumentList arguments = function_item->arguments();
+    AbstractMetaArgumentList meta_arguments;
+
+    int first_default_argument = 0;
+    for (int i=0; i<arguments.size(); ++i) {
+        ArgumentModelItem arg = arguments.at(i);
+
+        bool ok;
+        AbstractMetaType *meta_type = translateType(arg->type(), &ok);
+        if (!meta_type || !ok) {
+            ReportHandler::warning(QString("skipping function '%1::%2', "
+                                           "unmatched parameter type '%3'")
+                                   .arg(class_name)
+                                   .arg(function_item->name())
+                                   .arg(arg->type().toString()));
+            m_rejected_functions[class_name + "::" + function_name] =
+                UnmatchedArgumentType;
+            meta_function->setInvalid(true);
+            return meta_function;
+        }
+        AbstractMetaArgument *meta_argument = createMetaArgument();
+        meta_argument->setType(meta_type);
+        meta_argument->setName(arg->name());
+        meta_argument->setArgumentIndex(i);
+        meta_arguments << meta_argument;
+    }
+
+    meta_function->setArguments(meta_arguments);
+
+    // Find the correct default values
+    for (int i=0; i<arguments.size(); ++i) {
+        ArgumentModelItem arg = arguments.at(i);
+        AbstractMetaArgument *meta_arg = meta_arguments.at(i);
+        if (arg->defaultValue()) {
+            QString expr = arg->defaultValueExpression();
+            if (!expr.isEmpty())
+                meta_arg->setOriginalDefaultValueExpression(expr);
+
+            expr = translateDefaultValue(arg, meta_arg->type(), meta_function, m_current_class, i);
+            if (expr.isEmpty()) {
+                first_default_argument = i;
+            } else {
+                meta_arg->setDefaultValueExpression(expr);
+            }
+
+            if (meta_arg->type()->isEnum() || meta_arg->type()->isFlags()) {
+                m_enum_default_arguments
+                    << QPair<AbstractMetaArgument *, AbstractMetaFunction *>(meta_arg, meta_function);
+            }
+
+        }
+    }
+
+    // If we where not able to translate the default argument make it
+    // reset all default arguments before this one too.
+    for (int i=0; i<first_default_argument; ++i)
+        meta_arguments[i]->setDefaultValueExpression(QString());
+
+    if (ReportHandler::debugLevel() == ReportHandler::FullDebug)
+        foreach(AbstractMetaArgument *arg, meta_arguments)
+            ReportHandler::debugFull("   - " + arg->toString());
+
+    return meta_function;
+}
+
+
+AbstractMetaType *AbstractMetaBuilder::translateType(const TypeInfo &_typei, bool *ok, bool resolveType, bool resolveScope)
+{
+    Q_ASSERT(ok);
+    *ok = true;
+
+    // 1. Test the type info without resolving typedefs in case this is present in the
+    //    type system
+    TypeInfo typei;
+    if (resolveType) {
+        bool ok;
+        AbstractMetaType *t = translateType(_typei, &ok, false, resolveScope);
+        if (t != 0 && ok)
+            return t;
+    }
+
+    if (!resolveType)
+        typei = _typei;
+    else {
+        // Go through all parts of the current scope (including global namespace)
+        // to resolve typedefs. The parser does not properly resolve typedefs in
+        // the global scope when they are referenced from inside a namespace.
+        // This is a work around to fix this bug since fixing it in resolveType
+        // seemed non-trivial
+        int i = m_scopes.size() - 1;
+        while (i >= 0) {
+            typei = TypeInfo::resolveType(_typei, m_scopes.at(i--)->toItem());
+            if (typei.qualifiedName().join("::") != _typei.qualifiedName().join("::"))
+                break;
+        }
+
+    }
+
+    if (typei.isFunctionPointer()) {
+        *ok = false;
+        return 0;
+    }
+
+    TypeParser::Info typeInfo = TypeParser::parse(typei.toString());
+    if (typeInfo.is_busted) {
+        *ok = false;
+        return 0;
+    }
+
+    // 2. Handle pointers specified as arrays with unspecified size
+    bool array_of_unspecified_size = false;
+    if (typeInfo.arrays.size() > 0) {
+        array_of_unspecified_size = true;
+        for (int i=0; i<typeInfo.arrays.size(); ++i)
+            array_of_unspecified_size = array_of_unspecified_size && typeInfo.arrays.at(i).isEmpty();
+
+        if (!array_of_unspecified_size) {
+            TypeInfo newInfo;
+            //newInfo.setArguments(typei.arguments());
+            newInfo.setIndirections(typei.indirections());
+            newInfo.setConstant(typei.isConstant());
+            newInfo.setFunctionPointer(typei.isFunctionPointer());
+            newInfo.setQualifiedName(typei.qualifiedName());
+            newInfo.setReference(typei.isReference());
+            newInfo.setVolatile(typei.isVolatile());
+
+            AbstractMetaType *elementType = translateType(newInfo, ok);
+            if (!ok)
+                return 0;
+
+            for (int i=typeInfo.arrays.size()-1; i>=0; --i) {
+                QString s = typeInfo.arrays.at(i);
+                bool ok;
+
+                int elems = s.toInt(&ok);
+                if (!ok)
+                    return 0;
+
+                AbstractMetaType *arrayType = createMetaType();
+                arrayType->setArrayElementCount(elems);
+                arrayType->setArrayElementType(elementType);
+                arrayType->setTypeEntry(new ArrayTypeEntry(elementType->typeEntry()));
+                decideUsagePattern(arrayType);
+
+                elementType = arrayType;
+            }
+
+            return elementType;
+        }  else {
+            typeInfo.indirections += typeInfo.arrays.size();
+        }
+    }
+
+    QStringList qualifier_list = typeInfo.qualified_name;
+    if (qualifier_list.isEmpty()) {
+        ReportHandler::warning(QString("horribly broken type '%1'").arg(_typei.toString()));
+        *ok = false;
+        return 0;
+    }
+
+    QString qualified_name = qualifier_list.join("::");
+    QString name = qualifier_list.takeLast();
+
+    // 3. Special case 'void' type
+    if (name == "void" && typeInfo.indirections == 0) {
+        return 0;
+    }
+
+    // 4. Special case QFlags (include instantiation in name)
+    if (qualified_name == "QFlags")
+        qualified_name = typeInfo.toString();
+
+    // 5. Try to find the type
+    const TypeEntry *type = TypeDatabase::instance()->findType(qualified_name);
+
+    // 6. No? Try looking it up as a flags type
+    if (!type)
+        type = TypeDatabase::instance()->findFlagsType(qualified_name);
+
+    // 7. No? Try looking it up as a container type
+    if (!type)
+        type = TypeDatabase::instance()->findContainerType(name);
+
+    // 8. No? Check if the current class is a template and this type is one
+    //    of the parameters.
+    if (type == 0 && m_current_class != 0) {
+        QList<TypeEntry *> template_args = m_current_class->templateArguments();
+        foreach (TypeEntry *te, template_args) {
+            if (te->name() == qualified_name)
+                type = te;
+        }
+    }
+
+    // 9. Try finding the type by prefixing it with the current
+    //    context and all baseclasses of the current context
+    if (!type && !TypeDatabase::instance()->isClassRejected(qualified_name) && m_current_class != 0 && resolveScope) {
+        QStringList contexts;
+        contexts.append(m_current_class->qualifiedCppName());
+        contexts.append(currentScope()->qualifiedName().join("::"));
+
+
+        TypeInfo info = typei;
+        bool subclasses_done = false;
+        while (!contexts.isEmpty() && type == 0) {
+            //type = TypeDatabase::instance()->findType(contexts.at(0) + "::" + qualified_name);
+
+            bool ok;
+            info.setQualifiedName(QStringList() << contexts.at(0) << qualified_name);
+            AbstractMetaType *t = translateType(info, &ok, true, false);
+            if (t != 0 && ok)
+                return t;
+
+            ClassModelItem item = m_dom->findClass(contexts.at(0));
+            if (item != 0)
+                contexts += item->baseClasses();
+            contexts.pop_front();
+
+            // 10. Last resort: Special cased prefix of Qt namespace since the meta object implicitly inherits this, so
+            //     enum types from there may be addressed without any scope resolution in properties.
+            if (contexts.size() == 0 && !subclasses_done) {
+                contexts << "Qt";
+                subclasses_done = true;
+            }
+        }
+
+    }
+
+    if (!type) {
+        *ok = false;
+        return 0;
+    }
+
+    // Used to for diagnostics later...
+    m_used_types << type;
+
+    // These are only implicit and should not appear in code...
+    Q_ASSERT(!type->isInterface());
+
+    AbstractMetaType *meta_type = createMetaType();
+    meta_type->setTypeEntry(type);
+    meta_type->setIndirections(typeInfo.indirections);
+    meta_type->setReference(typeInfo.is_reference);
+    meta_type->setConstant(typeInfo.is_constant);
+    meta_type->setOriginalTypeDescription(_typei.toString());
+    decideUsagePattern(meta_type);
+
+    if (meta_type->typeEntry()->isContainer()) {
+        ContainerTypeEntry::Type container_type = static_cast<const ContainerTypeEntry *>(type)->type();
+
+        if (container_type == ContainerTypeEntry::StringListContainer) {
+            TypeInfo info;
+            info.setQualifiedName(QStringList() << "QString");
+            AbstractMetaType *targ_type = translateType(info, ok);
+
+            Q_ASSERT(*ok);
+            Q_ASSERT(targ_type);
+
+            meta_type->addInstantiation(targ_type);
+            meta_type->setInstantiationInCpp(false);
+
+        } else {
+            foreach (const TypeParser::Info &ta, typeInfo.template_instantiations) {
+                TypeInfo info;
+                info.setConstant(ta.is_constant);
+                info.setReference(ta.is_reference);
+                info.setIndirections(ta.indirections);
+
+                info.setFunctionPointer(false);
+                info.setQualifiedName(ta.instantiationName().split("::"));
+
+                AbstractMetaType *targ_type = translateType(info, ok);
+                if (!(*ok)) {
+                    delete meta_type;
+                    return 0;
+                }
+
+                meta_type->addInstantiation(targ_type);
+            }
+        }
+
+        if (container_type == ContainerTypeEntry::ListContainer
+            || container_type == ContainerTypeEntry::VectorContainer
+            || container_type == ContainerTypeEntry::StringListContainer) {
+            Q_ASSERT(meta_type->instantiations().size() == 1);
+        }
+    }
+
+    return meta_type;
+}
+
+void AbstractMetaBuilder::decideUsagePattern(AbstractMetaType *meta_type)
+{
+    const TypeEntry *type = meta_type->typeEntry();
+
+    if (type->isPrimitive() && (meta_type->actualIndirections() == 0
+                                || (meta_type->isConstant() && meta_type->isReference() && meta_type->indirections() == 0))) {
+        meta_type->setTypeUsagePattern(AbstractMetaType::PrimitivePattern);
+
+    } else if (type->isVoid()) {
+        meta_type->setTypeUsagePattern(AbstractMetaType::NativePointerPattern);
+
+    } else if (type->isString()
+               && meta_type->indirections() == 0
+               && (meta_type->isConstant() == meta_type->isReference()
+                   || meta_type->isConstant())) {
+        meta_type->setTypeUsagePattern(AbstractMetaType::StringPattern);
+
+    } else if (type->isChar()
+        && meta_type->indirections() == 0
+        && meta_type->isConstant() == meta_type->isReference()) {
+        meta_type->setTypeUsagePattern(AbstractMetaType::CharPattern);
+
+    } else if (type->isJObjectWrapper()
+        && meta_type->indirections() == 0
+        && meta_type->isConstant() == meta_type->isReference()) {
+        meta_type->setTypeUsagePattern(AbstractMetaType::JObjectWrapperPattern);
+
+    } else if (type->isVariant()
+        && meta_type->indirections() == 0
+        && meta_type->isConstant() == meta_type->isReference()) {
+        meta_type->setTypeUsagePattern(AbstractMetaType::VariantPattern);
+
+    } else if (type->isEnum() && meta_type->actualIndirections() == 0) {
+        meta_type->setTypeUsagePattern(AbstractMetaType::EnumPattern);
+
+    } else if (type->isObject()
+                && meta_type->indirections() == 0
+                && meta_type->isReference()) {
+        if (((ComplexTypeEntry *) type)->isQObject())
+            meta_type->setTypeUsagePattern(AbstractMetaType::QObjectPattern);
+        else
+            meta_type->setTypeUsagePattern(AbstractMetaType::ObjectPattern);
+
+    } else if (type->isObject()
+               && meta_type->indirections() == 1) {
+        if (((ComplexTypeEntry *) type)->isQObject())
+            meta_type->setTypeUsagePattern(AbstractMetaType::QObjectPattern);
+        else
+            meta_type->setTypeUsagePattern(AbstractMetaType::ObjectPattern);
+
+        // const-references to pointers can be passed as pointers
+        if (meta_type->isReference() && meta_type->isConstant()) {
+            meta_type->setReference(false);
+            meta_type->setConstant(false);
+        }
+
+    } else if (type->isContainer() && meta_type->indirections() == 0) {
+        meta_type->setTypeUsagePattern(AbstractMetaType::ContainerPattern);
+
+    } else if (type->isTemplateArgument()) {
+
+    } else if (type->isFlags()
+               && meta_type->indirections() == 0
+               && (meta_type->isConstant() == meta_type->isReference())) {
+        meta_type->setTypeUsagePattern(AbstractMetaType::FlagsPattern);
+
+    } else if (type->isArray()) {
+        meta_type->setTypeUsagePattern(AbstractMetaType::ArrayPattern);
+
+    } else if (type->isThread()) {
+        Q_ASSERT(meta_type->indirections() == 1);
+        meta_type->setTypeUsagePattern(AbstractMetaType::ThreadPattern);
+
+    } else if (type->isValue()
+               && meta_type->indirections() == 0
+               && (meta_type->isConstant() == meta_type->isReference()
+                   || !meta_type->isReference())) {
+        meta_type->setTypeUsagePattern(AbstractMetaType::ValuePattern);
+
+    } else if (type->isObject() && meta_type->actualIndirections() == 0) {
+
+        ReportHandler::warning(QString("Object type '%1' passed as value. Resulting code will not compile.")
+                               .arg(meta_type->cppSignature()));
+        meta_type->setTypeUsagePattern(AbstractMetaType::NativePointerPattern);
+
+    } else {
+        meta_type->setTypeUsagePattern(AbstractMetaType::NativePointerPattern);
+        ReportHandler::debugFull(QString("native pointer pattern for '%1'")
+                                 .arg(meta_type->cppSignature()));
+    }
+}
+
+QString AbstractMetaBuilder::translateDefaultValue(ArgumentModelItem item, AbstractMetaType *type,
+                                               AbstractMetaFunction *fnc, AbstractMetaClass *implementing_class,
+                                               int argument_index)
+{
+    QString function_name = fnc->name();
+    QString class_name = implementing_class->name();
+
+    QString replaced_expression = fnc->replacedDefaultExpression(implementing_class, argument_index + 1);
+    if (fnc->removedDefaultExpression(implementing_class, argument_index +1))
+        return "";
+    if (!replaced_expression.isEmpty())
+        return replaced_expression;
+
+    QString expr = item->defaultValueExpression();
+    if (type->isPrimitive()) {
+        if (type->name() == "boolean") {
+            if (expr == "false" || expr=="true") {
+                return expr;
+            } else {
+                bool ok = false;
+                int number = expr.toInt(&ok);
+                if (ok && number)
+                    return "true";
+                else
+                    return "false";
+            }
+        } else if (expr == "ULONG_MAX") {
+            return "Long.MAX_VALUE";
+        } else if (expr == "QVariant::Invalid") {
+            return QString::number(QVariant::Invalid);
+        } else {
+            // This can be an enum or flag so I need to delay the
+            // translation untill all namespaces are completly
+            // processed. This is done in figureOutEnumValues()
+            return expr;
+        }
+    } else if (type != 0 && (type->isFlags() || type->isEnum())) {
+        // Same as with enum explanation above...
+        return expr;
+
+    } else {
+
+        // constructor or functioncall can be a bit tricky...
+        if (expr == "QVariant()" /* qtd || expr == "QModelIndex()"*/) {
+            return "null";
+        } else if (expr == "QString()") {
+            return "null";
+        } else if (expr.endsWith(")") && expr.contains("::")) {
+            TypeEntry *typeEntry = TypeDatabase::instance()->findType(expr.left(expr.indexOf("::")));
+            if (typeEntry)
+                return typeEntry->qualifiedTargetLangName() + "." + expr.right(expr.length() - expr.indexOf("::") - 2);
+        } else if (expr.endsWith(")") && type->isValue()) {
+            int pos = expr.indexOf("(");
+
+            TypeEntry *typeEntry = TypeDatabase::instance()->findType(expr.left(pos));
+            if (typeEntry) { // qtd
+                if(typeEntry->isStructInD())
+                    return typeEntry->qualifiedCppName() + expr.right(expr.length() - pos);
+                else
+                    return "new " + typeEntry->qualifiedCppName() + expr.right(expr.length() - pos);
+            } else
+                return expr;
+        } else if (expr == "0") {
+            return "null";
+        } else if (type->isObject() || type->isValue() || expr.contains("::")) { // like Qt::black passed to a QColor
+            TypeEntry *typeEntry = TypeDatabase::instance()->findType(expr.left(expr.indexOf("::")));
+
+            expr = expr.right(expr.length() - expr.indexOf("::") - 2);
+            if (typeEntry) {
+                return "new " + type->typeEntry()->qualifiedCppName() +
+                       "(" + typeEntry->qualifiedCppName() + "." + expr + ")";
+            }
+        }
+    }
+
+    QString warn = QString("unsupported default value '%3' of argument in function '%1', class '%2'")
+        .arg(function_name).arg(class_name).arg(item->defaultValueExpression());
+    ReportHandler::warning(warn);
+
+    return QString();
+}
+
+
+bool AbstractMetaBuilder::isQObject(const QString &qualified_name)
+{
+    if (qualified_name == "QObject")
+        return true;
+
+    ClassModelItem class_item = m_dom->findClass(qualified_name);
+
+    if (!class_item) {
+      QStringList names = qualified_name.split(QLatin1String("::"));
+      NamespaceModelItem ns = model_dynamic_cast<NamespaceModelItem>(m_dom);
+      for (int i=0; i<names.size() - 1 && ns; ++i)
+          ns = ns->namespaceMap().value(names.at(i));
+      if (ns && names.size() >= 2)
+          class_item = ns->findClass(names.at(names.size() - 1));
+    }
+
+    bool isqobject = class_item && class_item->extendsClass("QObject");
+
+    if (class_item && !isqobject) {
+        QStringList baseClasses = class_item->baseClasses();
+        for (int i=0; i<baseClasses.count(); ++i) {
+
+            isqobject = isQObject(baseClasses.at(i));
+            if (isqobject)
+                break;
+        }
+    }
+
+    return isqobject;
+}
+
+
+bool AbstractMetaBuilder::isEnum(const QStringList &qualified_name)
+{
+    CodeModelItem item = m_dom->model()->findItem(qualified_name, m_dom->toItem());
+    return item && item->kind() == _EnumModelItem::__node_kind;
+}
+
+AbstractMetaType *AbstractMetaBuilder::inheritTemplateType(const QList<AbstractMetaType *> &template_types,
+                                                   AbstractMetaType *meta_type, bool *ok)
+{
+    if (ok != 0)
+        *ok = true;
+    if (!meta_type || (!meta_type->typeEntry()->isTemplateArgument() && !meta_type->hasInstantiations()))
+        return meta_type ? meta_type->copy() : 0;
+
+    AbstractMetaType *returned = meta_type->copy();
+    returned->setOriginalTemplateType(meta_type->copy());
+
+    if (returned->typeEntry()->isTemplateArgument()) {
+        const TemplateArgumentEntry *tae = static_cast<const TemplateArgumentEntry *>(returned->typeEntry());
+
+        // If the template is intantiated with void we special case this as rejecting the functions that use this
+        // parameter from the instantiation.
+        if (template_types.size() <= tae->ordinal() || template_types.at(tae->ordinal())->typeEntry()->name() == "void") {
+            if (ok != 0)
+                *ok = false;
+            return 0;
+        }
+
+        AbstractMetaType *t = returned->copy();
+        t->setTypeEntry(template_types.at(tae->ordinal())->typeEntry());
+        t->setIndirections(template_types.at(tae->ordinal())->indirections() + t->indirections()
+                           ? 1
+                           : 0);
+        decideUsagePattern(t);
+
+        delete returned;
+        returned = inheritTemplateType(template_types, t, ok);
+        if (ok != 0 && !(*ok))
+            return 0;
+    }
+
+    if (returned->hasInstantiations()) {
+        QList<AbstractMetaType *> instantiations = returned->instantiations();
+        for (int i=0; i<instantiations.count(); ++i) {
+            instantiations[i] = inheritTemplateType(template_types, instantiations.at(i), ok);
+            if (ok != 0 && !(*ok))
+                return 0;
+        }
+        returned->setInstantiations(instantiations);
+    }
+
+    return returned;
+}
+
+bool AbstractMetaBuilder::inheritTemplate(AbstractMetaClass *subclass,
+                                      const AbstractMetaClass *template_class,
+                                      const TypeParser::Info &info)
+{
+    QList<TypeParser::Info> targs = info.template_instantiations;
+
+    QList<AbstractMetaType *> template_types;
+    foreach (const TypeParser::Info &i, targs) {
+        TypeEntry *t = TypeDatabase::instance()->findType(i.qualified_name.join("::"));
+
+        if (t != 0) {
+            AbstractMetaType *temporary_type = createMetaType();
+            temporary_type->setTypeEntry(t);
+            temporary_type->setConstant(i.is_constant);
+            temporary_type->setReference(i.is_reference);
+            temporary_type->setIndirections(i.indirections);
+            template_types << temporary_type;
+        }
+    }
+
+    AbstractMetaFunctionList funcs = subclass->functions();
+    foreach (const AbstractMetaFunction *function, template_class->functions()) {
+
+        if (function->isModifiedRemoved(TypeSystem::All))
+            continue;
+
+        AbstractMetaFunction *f = function->copy();
+        f->setArguments(AbstractMetaArgumentList());
+
+        bool ok = true;
+        AbstractMetaType *ftype = function->type();
+        f->setType(inheritTemplateType(template_types, ftype, &ok));
+        if (!ok) {
+            delete f;
+            continue;
+        }
+
+        foreach (AbstractMetaArgument *argument, function->arguments()) {
+            AbstractMetaType *atype = argument->type();
+
+            AbstractMetaArgument *arg = argument->copy();
+            arg->setType(inheritTemplateType(template_types, atype, &ok));
+            if (!ok)
+                break;
+            f->addArgument(arg);
+        }
+
+        if (!ok) {
+            delete f;
+            continue ;
+        }
+
+        // There is no base class in java to inherit from here, so the
+        // template instantiation is the class that implements the function..
+        f->setImplementingClass(subclass);
+
+        // We also set it as the declaring class, since the superclass is
+        // supposed to disappear. This allows us to make certain function modifications
+        // on the inherited functions.
+        f->setDeclaringClass(subclass);
+
+
+        if (f->isConstructor() && subclass->isTypeAlias()) {
+            f->setName(subclass->name());
+        } else if (f->isConstructor()) {
+            delete f;
+            continue;
+        }
+
+        // if the instantiation has a function named the same as an existing
+        // function we have shadowing so we need to skip it.
+        bool found = false;
+        for (int i=0; i<funcs.size(); ++i) {
+            if (funcs.at(i)->name() == f->name()) {
+                found = true;
+                continue;
+            }
+        }
+        if (found) {
+            delete f;
+            continue;
+        }
+
+        ComplexTypeEntry *te = subclass->typeEntry();
+        FunctionModificationList mods = function->modifications(template_class);
+        for (int i=0; i<mods.size(); ++i) {
+            FunctionModification mod = mods.at(i);
+            mod.signature = f->minimalSignature();
+
+            // If we ever need it... Below is the code to do
+            // substitution of the template instantation type inside
+            // injected code..
+#if 0
+            if (mod.modifiers & Modification::CodeInjection) {
+                for (int j=0; j<template_types.size(); ++j) {
+                    CodeSnip &snip = mod.snips.last();
+                    QString code = snip.code();
+                    code.replace(QString::fromLatin1("$$QT_TEMPLATE_%1$$").arg(j),
+                                 template_types.at(j)->typeEntry()->qualifiedCppName());
+                    snip.codeList.clear();
+                    snip.addCode(code);
+                }
+            }
+#endif
+            te->addFunctionModification(mod);
+        }
+
+        subclass->addFunction(f);
+    }
+
+    // Clean up
+    foreach (AbstractMetaType *type, template_types) {
+        delete type;
+    }
+
+
+    {
+        subclass->setTemplateBaseClass(template_class);
+
+        subclass->setInterfaces(template_class->interfaces());
+        subclass->setBaseClass(template_class->baseClass());
+    }
+
+    return true;
+}
+
+void AbstractMetaBuilder::parseQ_Property(AbstractMetaClass *meta_class, const QStringList &declarations)
+{
+    for (int i=0; i<declarations.size(); ++i) {
+        QString p = declarations.at(i);
+
+        QStringList l = p.split(QLatin1String(" "));
+
+
+        QStringList qualifiedScopeName = currentScope()->qualifiedName();
+        bool ok = false;
+        AbstractMetaType *type = 0;
+        QString scope;
+        for (int j=qualifiedScopeName.size(); j>=0; --j) {
+            scope = j > 0 ? QStringList(qualifiedScopeName.mid(0, j)).join("::") + "::" : QString();
+            TypeInfo info;
+            info.setQualifiedName((scope + l.at(0)).split("::"));
+
+            type = translateType(info, &ok);
+            if (type != 0 && ok) {
+                break;
+            }
+        }
+
+        if (type == 0 || !ok) {
+            ReportHandler::warning(QString("Unable to decide type of property: '%1' in class '%2'")
+                                   .arg(l.at(0)).arg(meta_class->name()));
+            continue;
+        }
+
+        QString typeName = scope + l.at(0);
+
+        QPropertySpec *spec = new QPropertySpec(type->typeEntry());
+        spec->setName(l.at(1));
+        spec->setIndex(i);
+
+        for (int pos=2; pos+1<l.size(); pos+=2) {
+            if (l.at(pos) == QLatin1String("READ"))
+                spec->setRead(l.at(pos+1));
+            else if (l.at(pos) == QLatin1String("WRITE"))
+                spec->setWrite(l.at(pos+1));
+            else if (l.at(pos) == QLatin1String("DESIGNABLE"))
+                spec->setDesignable(l.at(pos+1));
+            else if (l.at(pos) == QLatin1String("RESET"))
+                spec->setReset(l.at(pos+1));
+        }
+
+        meta_class->addPropertySpec(spec);
+        delete type;
+    }
+}
+
+static void hide_functions(const AbstractMetaFunctionList &l) {
+    foreach (AbstractMetaFunction *f, l) {
+        FunctionModification mod;
+        mod.signature = f->minimalSignature();
+        mod.modifiers = FunctionModification::Private;
+        ((ComplexTypeEntry *) f->implementingClass()->typeEntry())->addFunctionModification(mod);
+    }
+}
+
+static void remove_function(AbstractMetaFunction *f) {
+    FunctionModification mod;
+    mod.removal = TypeSystem::All;
+    mod.signature = f->minimalSignature();
+    ((ComplexTypeEntry *) f->implementingClass()->typeEntry())->addFunctionModification(mod);
+}
+
+static AbstractMetaFunctionList filter_functions(const AbstractMetaFunctionList &lst, QSet<QString> *signatures)
+{
+    AbstractMetaFunctionList functions;
+    foreach (AbstractMetaFunction *f, lst) {
+        QString signature = f->minimalSignature();
+        int start = signature.indexOf(QLatin1Char('(')) + 1;
+        int end = signature.lastIndexOf(QLatin1Char(')'));
+        signature = signature.mid(start, end - start);
+        if (signatures->contains(signature)) {
+            remove_function(f);
+            continue;
+        }
+        (*signatures) << signature;
+        functions << f;
+    }
+    return functions;
+}
+
+void AbstractMetaBuilder::setupEquals(AbstractMetaClass *cls)
+{
+    AbstractMetaFunctionList equals;
+    AbstractMetaFunctionList nequals;
+
+    QString op_equals = QLatin1String("operator_equal");
+    QString op_nequals = QLatin1String("operator_not_equal");
+
+    AbstractMetaFunctionList functions = cls->queryFunctions(AbstractMetaClass::ClassImplements
+                                                         | AbstractMetaClass::NotRemovedFromTargetLang);
+    foreach (AbstractMetaFunction *f, functions) {
+        if (f->name() == op_equals)
+            equals << f;
+        else if (f->name() == op_nequals)
+            nequals << f;
+    }
+
+    if (equals.size() || nequals.size()) {
+        if (!cls->hasHashFunction()) {
+            ReportHandler::warning(QString::fromLatin1("Class '%1' has equals operators but no qHash() function")
+                                   .arg(cls->name()));
+        }
+
+        hide_functions(equals);
+        hide_functions(nequals);
+
+        // We only need == if we have both == and !=, and one == for
+        // each signature type, like QDateTime::==(QDate) and (QTime)
+        // if such a thing exists...
+        QSet<QString> func_signatures;
+        cls->setEqualsFunctions(filter_functions(equals, &func_signatures));
+        cls->setNotEqualsFunctions(filter_functions(nequals, &func_signatures));
+    }
+}
+
+void AbstractMetaBuilder::setupComparable(AbstractMetaClass *cls)
+{
+    AbstractMetaFunctionList greater;
+    AbstractMetaFunctionList greaterEquals;
+    AbstractMetaFunctionList less;
+    AbstractMetaFunctionList lessEquals;
+
+    QString op_greater = QLatin1String("operator_greater");
+    QString op_greater_eq = QLatin1String("operator_greater_or_equal");
+    QString op_less = QLatin1String("operator_less");
+    QString op_less_eq = QLatin1String("operator_less_or_equal");
+
+    AbstractMetaFunctionList functions = cls->queryFunctions(AbstractMetaClass::ClassImplements
+                                                         | AbstractMetaClass::NotRemovedFromTargetLang);
+    foreach (AbstractMetaFunction *f, functions) {
+        if (f->name() == op_greater)
+            greater << f;
+        else if (f->name() == op_greater_eq)
+            greaterEquals << f;
+        else if (f->name() == op_less)
+            less << f;
+        else if (f->name() == op_less_eq)
+            lessEquals << f;
+    }
+
+    bool hasEquals = cls->equalsFunctions().size() || cls->notEqualsFunctions().size();
+
+    // Conditions for comparable is:
+    //     >, ==, <             - The basic case
+    //     >, ==                - Less than becomes else case
+    //     <, ==                - Greater than becomes else case
+    //     >=, <=               - if (<= && >=) -> equal
+    bool mightBeComparable = greater.size() || greaterEquals.size() || less.size() || lessEquals.size()
+                        || greaterEquals.size() == 1 || lessEquals.size() == 1;
+
+    if (mightBeComparable) {
+        QSet<QString> signatures;
+
+        // We only hide the original functions if we are able to make a compareTo() method
+        bool wasComparable = false;
+
+        // The three upper cases, prefer the <, == approach
+        if (hasEquals && (greater.size() || less.size())) {
+            cls->setLessThanFunctions(filter_functions(less, &signatures));
+            cls->setGreaterThanFunctions(filter_functions(greater, &signatures));
+            filter_functions(greaterEquals, &signatures);
+            filter_functions(lessEquals, &signatures);
+            wasComparable = true;
+        } else if (hasEquals && (greaterEquals.size() || lessEquals.size())) {
+            cls->setLessThanEqFunctions(filter_functions(lessEquals, &signatures));
+            cls->setGreaterThanEqFunctions(filter_functions(greaterEquals, &signatures));
+            wasComparable = true;
+        } else if (greaterEquals.size() == 1 || lessEquals.size() == 1) {
+            cls->setGreaterThanEqFunctions(greaterEquals);
+            cls->setLessThanEqFunctions(lessEquals);
+            filter_functions(less, &signatures);
+            filter_functions(greater, &signatures);
+            wasComparable = true;
+        }
+
+        if (wasComparable) {
+            hide_functions(greater);
+            hide_functions(greaterEquals);
+            hide_functions(less);
+            hide_functions(lessEquals);
+        }
+    }
+
+}
+
+void AbstractMetaBuilder::setupClonable(AbstractMetaClass *cls)
+{
+    // All value types are required to have a copy constructor,
+    // or they will not work as value types (it won't even compile,
+    // because of calls to qRegisterMetaType(). Thus all value types
+    // should be cloneable.
+    if (cls->typeEntry()->isValue()) {
+        cls->setHasCloneOperator(true);
+        return;
+    } else {
+        QString op_assign = QLatin1String("operator_assign");
+
+        AbstractMetaFunctionList functions = cls->queryFunctions(AbstractMetaClass::ClassImplements);
+        foreach (AbstractMetaFunction *f, functions) {
+            if ((f->name() == op_assign || f->isConstructor()) && f->isPublic()) {
+                AbstractMetaArgumentList arguments = f->arguments();
+                if (f->actualMinimumArgumentCount() == 1) {
+                    if (cls->typeEntry()->qualifiedCppName() == arguments.at(0)->type()->typeEntry()->qualifiedCppName()) {
+                        if (cls->typeEntry()->isValue()) {
+                            cls->setHasCloneOperator(true);
+                            return;
+                        }
+                    }
+                }
+            }
+        }
+    }
+}
+
+static void write_reject_log_file(const QString &name,
+                                  const QMap<QString, AbstractMetaBuilder::RejectReason> &rejects)
+{
+    QFile f(name);
+    if (!f.open(QIODevice::WriteOnly | QIODevice::Text)) {
+        ReportHandler::warning(QString("failed to write log file: '%1'")
+                               .arg(f.fileName()));
+        return;
+    }
+
+    QTextStream s(&f);
+
+
+    for (int reason=0; reason<AbstractMetaBuilder::NoReason; ++reason) {
+        s << QString(72, '*') << endl;
+        switch (reason) {
+        case AbstractMetaBuilder::NotInTypeSystem:
+            s << "Not in type system";
+            break;
+        case AbstractMetaBuilder::GenerationDisabled:
+            s << "Generation disabled by type system";
+            break;
+        case AbstractMetaBuilder::RedefinedToNotClass:
+            s << "Type redefined to not be a class";
+            break;
+
+        case AbstractMetaBuilder::UnmatchedReturnType:
+            s << "Unmatched return type";
+            break;
+
+        case AbstractMetaBuilder::UnmatchedArgumentType:
+            s << "Unmatched argument type";
+            break;
+
+        default:
+            s << "unknown reason";
+            break;
+        }
+
+        s << endl;
+
+        for (QMap<QString, AbstractMetaBuilder::RejectReason>::const_iterator it = rejects.constBegin();
+             it != rejects.constEnd(); ++it) {
+            if (it.value() != reason)
+                continue;
+            s << " - " << it.key() << endl;
+        }
+
+        s << QString(72, '*') << endl << endl;
+    }
+
+}
+
+
+void AbstractMetaBuilder::dumpLog()
+{
+    write_reject_log_file("mjb_rejected_classes.log", m_rejected_classes);
+    write_reject_log_file("mjb_rejected_enums.log", m_rejected_enums);
+    write_reject_log_file("mjb_rejected_functions.log", m_rejected_functions);
+    write_reject_log_file("mjb_rejected_fields.log", m_rejected_fields);
+}
+
+AbstractMetaClassList AbstractMetaBuilder::classesTopologicalSorted() const
+{
+    AbstractMetaClassList res;
+
+    AbstractMetaClassList classes = m_meta_classes;
+    qSort(classes);
+
+    QSet<AbstractMetaClass*> noDependency;
+    QHash<AbstractMetaClass*, QSet<AbstractMetaClass* >* > hash;
+    foreach (AbstractMetaClass *cls, classes) {
+        QSet<AbstractMetaClass* > *depends = new QSet<AbstractMetaClass* >();
+
+        if (cls->baseClass())
+            depends->insert(cls->baseClass());
+
+        foreach (AbstractMetaClass *interface, cls->interfaces()) {
+            depends->insert(interface);
+        }
+
+        if (depends->empty()) {
+            noDependency.insert(cls);
+        } else {
+            hash.insert(cls, depends);
+        }
+    }
+
+    while (!noDependency.empty()) {
+        foreach (AbstractMetaClass *cls, noDependency.values()) {
+            if(!cls->isInterface())
+                res.append(cls);
+            noDependency.remove(cls);
+            QHashIterator<AbstractMetaClass*, QSet<AbstractMetaClass* >* > i(hash);
+            while (i.hasNext()) {
+                i.next();
+                i.value()->remove(cls);
+                if (i.value()->empty()) {
+                    AbstractMetaClass *key = i.key();
+                    noDependency.insert(key);
+                    hash.remove(key);
+                    delete(i.value());
+                }
+            }
+        }
+    }
+
+    if (!noDependency.empty() || !hash.empty()) {
+        qWarning("dependency graph was cyclic.");
+    }
+
+    return res;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/abstractmetabuilder.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,170 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#ifndef ABSTRACTMETABUILDER_H
+#define ABSTRACTMETABUILDER_H
+
+#include "codemodel.h"
+#include "abstractmetalang.h"
+#include "typesystem.h"
+#include "typeparser.h"
+
+#include <QtCore/QSet>
+
+class AbstractMetaBuilder
+{
+public:
+    enum RejectReason {
+        NotInTypeSystem,
+        GenerationDisabled,
+        RedefinedToNotClass,
+        UnmatchedArgumentType,
+        UnmatchedReturnType,
+        NoReason
+    };
+
+    AbstractMetaBuilder();
+    virtual ~AbstractMetaBuilder() {};
+
+    AbstractMetaClassList classes() const { return m_meta_classes; }
+    AbstractMetaClassList classesTopologicalSorted() const;
+
+    FileModelItem model() const { return m_dom; }
+    void setModel(FileModelItem item) { m_dom = item; }
+
+
+    ScopeModelItem popScope() { return m_scopes.takeLast(); }
+    void pushScope(ScopeModelItem item) { m_scopes << item; }
+    ScopeModelItem currentScope() const { return m_scopes.last(); }
+
+    QString fileName() const { return m_file_name; }
+    void setFileName(const QString &fileName) { m_file_name = fileName; }
+
+    void dumpLog();
+
+    bool build();
+
+    void figureOutEnumValuesForClass(AbstractMetaClass *meta_class, QSet<AbstractMetaClass *> *classes);
+    int figureOutEnumValue(const QString &name, int value, AbstractMetaEnum *meta_enum, AbstractMetaFunction *meta_function = 0);
+    void figureOutEnumValues();
+    void figureOutDefaultEnumArguments();
+
+    void addAbstractMetaClass(AbstractMetaClass *cls);
+    AbstractMetaClass *traverseTypeAlias(TypeAliasModelItem item);
+    AbstractMetaClass *traverseClass(ClassModelItem item);
+    bool setupInheritance(AbstractMetaClass *meta_class);
+    AbstractMetaClass *traverseNamespace(NamespaceModelItem item);
+    AbstractMetaEnum *traverseEnum(EnumModelItem item, AbstractMetaClass *enclosing, const QSet<QString> &enumsDeclarations);
+    void traverseEnums(ScopeModelItem item, AbstractMetaClass *parent, const QStringList &enumsDeclarations);
+    void traverseFunctions(ScopeModelItem item, AbstractMetaClass *parent);
+    void traverseFields(ScopeModelItem item, AbstractMetaClass *parent);
+    void traverseStreamOperator(FunctionModelItem function_item);
+    void traverseCompareOperator(FunctionModelItem item);
+    AbstractMetaFunction *traverseFunction(FunctionModelItem function);
+    AbstractMetaField *traverseField(VariableModelItem field, const AbstractMetaClass *cls);
+    void checkFunctionModifications();
+    void registerHashFunction(FunctionModelItem function_item);
+    void registerToStringCapability(FunctionModelItem function_item);
+
+    void parseQ_Property(AbstractMetaClass *meta_class, const QStringList &declarations);
+    void setupEquals(AbstractMetaClass *meta_class);
+    void setupComparable(AbstractMetaClass *meta_class);
+    void setupClonable(AbstractMetaClass *cls);
+    void setupFunctionDefaults(AbstractMetaFunction *meta_function, AbstractMetaClass *meta_class);
+
+    QString translateDefaultValue(ArgumentModelItem item, AbstractMetaType *type,
+                                               AbstractMetaFunction *fnc, AbstractMetaClass *,
+                                               int argument_index);
+    AbstractMetaType *translateType(const TypeInfo &type, bool *ok, bool resolveType = true, bool resolveScope = true);
+
+    void decideUsagePattern(AbstractMetaType *type);
+
+    bool inheritTemplate(AbstractMetaClass *subclass,
+                         const AbstractMetaClass *template_class,
+                         const TypeParser::Info &info);
+    AbstractMetaType *inheritTemplateType(const QList<AbstractMetaType *> &template_types, AbstractMetaType *meta_type, bool *ok = 0);
+
+    bool isQObject(const QString &qualified_name);
+    bool isEnum(const QStringList &qualified_name);
+
+    void fixQObjectForScope  (TypeDatabase *types,
+                  NamespaceModelItem item);
+protected:
+    AbstractMetaClass *argumentToClass(ArgumentModelItem);
+
+    virtual AbstractMetaClass *createMetaClass() = 0;
+    virtual AbstractMetaEnum *createMetaEnum() = 0;
+    virtual AbstractMetaEnumValue *createMetaEnumValue() = 0;
+    virtual AbstractMetaField *createMetaField() = 0;
+    virtual AbstractMetaFunction *createMetaFunction() = 0;
+    virtual AbstractMetaArgument *createMetaArgument() = 0;
+    virtual AbstractMetaType *createMetaType() = 0;
+
+private:
+    void sortLists();
+
+    QString m_file_name;
+
+    AbstractMetaClassList m_meta_classes;
+    AbstractMetaClassList m_templates;
+    FileModelItem m_dom;
+
+    QSet<const TypeEntry *> m_used_types;
+
+    QMap<QString, RejectReason> m_rejected_classes;
+    QMap<QString, RejectReason> m_rejected_enums;
+    QMap<QString, RejectReason> m_rejected_functions;
+    QMap<QString, RejectReason> m_rejected_fields;
+
+    QList<AbstractMetaEnum *> m_enums;
+
+    QList<QPair<AbstractMetaArgument *, AbstractMetaFunction *> > m_enum_default_arguments;
+
+    QHash<QString, AbstractMetaEnumValue *> m_enum_values;
+
+    AbstractMetaClass *m_current_class;
+    QList<ScopeModelItem> m_scopes;
+    QString m_namespace_prefix;
+
+    QSet<AbstractMetaClass *> m_setup_inheritance_done;
+};
+
+#endif // ABSTRACTMETBUILDER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/abstractmetalang.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,2035 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#include "abstractmetalang.h"
+#include "reporthandler.h"
+#include "jumptable.h"
+
+/*******************************************************************************
+ * AbstractMetaType
+ */
+AbstractMetaType *AbstractMetaType::copy() const
+{
+    AbstractMetaType *cpy = new AbstractMetaType;
+
+    cpy->setTypeUsagePattern(typeUsagePattern());
+    cpy->setConstant(isConstant());
+    cpy->setReference(isReference());
+    cpy->setIndirections(indirections());
+    cpy->setInstantiations(instantiations());
+    cpy->setArrayElementCount(arrayElementCount());
+    cpy->setOriginalTypeDescription(originalTypeDescription());
+    cpy->setOriginalTemplateType(originalTemplateType() ? originalTemplateType()->copy() : 0);
+
+    cpy->setArrayElementType(arrayElementType() ? arrayElementType()->copy() : 0);
+
+    cpy->setTypeEntry(typeEntry());
+
+    return cpy;
+}
+
+QString AbstractMetaType::cppSignature() const
+{
+    QString s;
+
+    if (isConstant())
+        s += "const ";
+
+    s += typeEntry()->qualifiedCppName();
+
+    if (hasInstantiationInCpp()) {
+        QList<AbstractMetaType *> types = instantiations();
+        s += "<";
+        for (int i=0; i<types.count(); ++i) {
+            if (i > 0)
+                s += ", ";
+            s += types.at(i)->cppSignature();
+        }
+        s += " >";
+    }
+
+    if (actualIndirections()) {
+        s += ' ';
+        if (indirections())
+            s += QString(indirections(), '*');
+        if (isReference())
+            s += '&';
+    }
+    return s;
+}
+
+/*******************************************************************************
+ * AbstractMetaArgument
+ */
+AbstractMetaArgument *AbstractMetaArgument::copy() const
+{
+    AbstractMetaArgument *cpy = new AbstractMetaArgument;
+    cpy->setName(AbstractMetaVariable::name());
+    cpy->setDefaultValueExpression(defaultValueExpression());
+    cpy->setType(type()->copy());
+    cpy->setArgumentIndex(argumentIndex());
+
+    return cpy;
+}
+
+
+QString AbstractMetaArgument::argumentName() const
+{
+    QString n = AbstractMetaVariable::name();
+    // replace for arguments which are D keywords such as "version"
+    n = ArgumentReplace::translate(n);
+
+    if (n.isEmpty()) {
+        return QString("arg__%2").arg(m_argument_index + 1);
+    }
+    return n;
+}
+
+
+QString AbstractMetaArgument::indexedName() const
+{
+    QString n = AbstractMetaVariable::name();
+    if (n.isEmpty())
+        return argumentName();
+    return QString("%1%2").arg(n).arg(m_argument_index);
+}
+
+QString AbstractMetaArgument::name() const
+{
+    Q_ASSERT_X(0, "AbstractMetaArgument::name()", "use argumentName() or indexedName() instead");
+    return QString();
+}
+
+
+/*******************************************************************************
+ * AbstractMetaFunction
+ */
+AbstractMetaFunction::~AbstractMetaFunction()
+{
+    qDeleteAll(m_arguments);
+    delete m_type;
+}
+
+/*******************************************************************************
+ * Indicates that this function has a modification that removes it
+ */
+bool AbstractMetaFunction::isModifiedRemoved(int types) const
+{
+    FunctionModificationList mods = modifications(implementingClass());
+    foreach (FunctionModification mod, mods) {
+        if (!mod.isRemoveModifier())
+            continue;
+
+        if ((mod.removal & types) == types)
+            return true;
+    }
+
+    return false;
+}
+
+bool AbstractMetaFunction::needsCallThrough() const
+{
+    if (ownerClass()->isInterface())
+        return false;
+    if (referenceCounts(implementingClass()).size() > 0)
+        return true;
+    if (argumentsHaveNativeId() || !isStatic())
+        return true;
+    if (JumpTableGenerator::isJumpTableActive())
+        return true;
+
+    foreach (const AbstractMetaArgument *arg, arguments()) {
+        if (arg->type()->isArray() || arg->type()->isTargetLangEnum() || arg->type()->isTargetLangFlags())
+            return true;
+    }
+
+    if (type() && (type()->isArray() || type()->isTargetLangEnum() || type()->isTargetLangFlags()))
+        return true;
+
+    for (int i=-1; i<=arguments().size(); ++i) {
+        TypeSystem::Ownership owner = this->ownership(implementingClass(), TypeSystem::TargetLangCode, i);
+        if (owner != TypeSystem::InvalidOwnership)
+            return true;
+    }
+
+    return false;
+}
+
+bool AbstractMetaFunction::needsSuppressUncheckedWarning() const
+{
+    for (int i=-1; i<=arguments().size(); ++i) {
+        QList<ReferenceCount> referenceCounts = this->referenceCounts(implementingClass(), i);
+        foreach (ReferenceCount referenceCount, referenceCounts) {
+            if (referenceCount.action != ReferenceCount::Set)
+                return true;
+        }
+    }
+    return false;
+}
+
+QString AbstractMetaFunction::marshalledName(bool classIsOwner) const
+{
+    QString returned = "qtd_";
+    if(classIsOwner)
+        returned += ownerClass()->name();
+    else
+        returned += declaringClass()->name();
+
+    returned += "_" + name();
+    AbstractMetaArgumentList arguments = this->arguments();
+    foreach (const AbstractMetaArgument *arg, arguments) {
+        returned += "_";
+        if (arg->type()->isNativePointer()) {
+            returned += "nativepointer" + arg->type()->name().replace("[]", "_3").replace(".", "_");
+        } else if (arg->type()->isIntegerEnum() || arg->type()->isIntegerFlags()) {
+            returned += "int";
+        } else {
+            returned += arg->type()->name().replace("[]", "_3").replace(".", "_");
+        }
+    }
+    return returned;
+}
+
+bool AbstractMetaFunction::operator<(const AbstractMetaFunction &other) const
+{
+    uint result = compareTo(&other);
+    return result & NameLessThan;
+}
+
+
+/*!
+    Returns a mask of CompareResult describing how this function is
+    compares to another function
+*/
+uint AbstractMetaFunction::compareTo(const AbstractMetaFunction *other) const
+{
+    uint result = 0;
+
+    // Enclosing class...
+    if (ownerClass() == other->ownerClass()) {
+        result |= EqualImplementor;
+    }
+
+    // Attributes
+    if (attributes() == other->attributes()) {
+        result |= EqualAttributes;
+    }
+
+    // Compare types
+    AbstractMetaType *t = type();
+    AbstractMetaType *ot = other->type();
+    if ((!t && !ot) || ((t && ot && t->name() == ot->name()))) {
+        result |= EqualReturnType;
+    }
+
+    // Compare names
+    int cmp = originalName().compare(other->originalName());
+
+    if (cmp < 0) {
+        result |= NameLessThan;
+    } else if (cmp == 0) {
+        result |= EqualName;
+    }
+
+    // compare name after modification...
+    cmp = modifiedName().compare(other->modifiedName());
+    if (cmp == 0)
+        result |= EqualModifiedName;
+
+    // Compare arguments...
+    AbstractMetaArgumentList min_arguments;
+    AbstractMetaArgumentList max_arguments;
+    if (arguments().size() < other->arguments().size()) {
+        min_arguments = arguments();
+        max_arguments = other->arguments();
+    } else {
+        min_arguments = other->arguments();
+        max_arguments = arguments();
+    }
+
+    int min_count = min_arguments.size();
+    int max_count = max_arguments.size();
+    bool same = true;
+    for (int i=0; i<max_count; ++i) {
+        if (i < min_count) {
+            const AbstractMetaArgument *min_arg = min_arguments.at(i);
+            const AbstractMetaArgument *max_arg = max_arguments.at(i);
+            if (min_arg->type()->name() != max_arg->type()->name()
+                && (min_arg->defaultValueExpression().isEmpty() || max_arg->defaultValueExpression().isEmpty())) {
+                same = false;
+                break;
+            }
+        } else {
+            if (max_arguments.at(i)->defaultValueExpression().isEmpty()) {
+                same = false;
+                break;
+            }
+        }
+    }
+
+    if (same)
+        result |= min_count == max_count ? EqualArguments : EqualDefaultValueOverload;
+
+    return result;
+}
+
+AbstractMetaFunction *AbstractMetaFunction::copy() const
+{
+    AbstractMetaFunction *cpy = new AbstractMetaFunction;
+    cpy->setName(name());
+    cpy->setOriginalName(originalName());
+    cpy->setOwnerClass(ownerClass());
+    cpy->setImplementingClass(implementingClass());
+    cpy->setInterfaceClass(interfaceClass());
+    cpy->setFunctionType(functionType());
+    cpy->setAttributes(attributes());
+    cpy->setDeclaringClass(declaringClass());
+    if (type())
+        cpy->setType(type()->copy());
+    cpy->setConstant(isConstant());
+    cpy->setOriginalAttributes(originalAttributes());
+
+    foreach (AbstractMetaArgument *arg, arguments())
+        cpy->addArgument(arg->copy());
+
+    Q_ASSERT((!type() && !cpy->type())
+             || (type()->instantiations() == cpy->type()->instantiations()));
+
+    return cpy;
+}
+
+QStringList AbstractMetaFunction::introspectionCompatibleSignatures(const QStringList &resolvedArguments) const
+{
+    AbstractMetaArgumentList arguments = this->arguments();
+    if (arguments.size() == resolvedArguments.size()) {
+        return (QStringList() << QMetaObject::normalizedSignature((name() + "(" + resolvedArguments.join(",") + ")").toUtf8().constData()));
+    } else {
+        QStringList returned;
+
+        AbstractMetaArgument *argument = arguments.at(resolvedArguments.size());
+        QStringList minimalTypeSignature = argument->type()->minimalSignature().split("::");
+        for (int i=0; i<minimalTypeSignature.size(); ++i) {
+            returned += introspectionCompatibleSignatures(QStringList(resolvedArguments)
+                << QStringList(minimalTypeSignature.mid(minimalTypeSignature.size() - i - 1)).join("::"));
+        }
+
+        return returned;
+    }
+}
+
+QString AbstractMetaFunction::signature() const
+{
+    QString s(m_original_name);
+
+    s += "(";
+
+    for (int i=0; i<m_arguments.count(); ++i) {
+        if (i > 0)
+            s += ", ";
+        AbstractMetaArgument *a = m_arguments.at(i);
+        s += a->type()->cppSignature();
+
+        // We need to have the argument names in the qdoc files
+        s += " ";
+        s += a->argumentName();
+    }
+    s += ")";
+
+    if (isConstant())
+        s += " const";
+
+    return s;
+}
+
+int AbstractMetaFunction::actualMinimumArgumentCount() const
+{
+    AbstractMetaArgumentList arguments = this->arguments();
+
+    int count = 0;
+    for (int i=0; i<arguments.size(); ++i && ++count) {
+        if (argumentRemoved(i + 1)) --count;
+        else if (!arguments.at(i)->defaultValueExpression().isEmpty()) break;
+    }
+
+    return count;
+}
+
+// Returns reference counts for argument at idx, or all arguments if idx == -2
+QList<ReferenceCount> AbstractMetaFunction::referenceCounts(const AbstractMetaClass *cls, int idx) const
+{
+    QList<ReferenceCount> returned;
+
+    FunctionModificationList mods = this->modifications(cls);
+    foreach (FunctionModification mod, mods) {
+        QList<ArgumentModification> argument_mods = mod.argument_mods;
+        foreach (ArgumentModification argument_mod, argument_mods) {
+            if (argument_mod.index != idx && idx != -2)
+                continue;
+            returned += argument_mod.referenceCounts;
+        }
+    }
+
+    return returned;
+}
+
+QString AbstractMetaFunction::replacedDefaultExpression(const AbstractMetaClass *cls, int key) const
+{
+    FunctionModificationList modifications = this->modifications(cls);
+    foreach (FunctionModification modification, modifications) {
+        QList<ArgumentModification> argument_modifications = modification.argument_mods;
+        foreach (ArgumentModification argument_modification, argument_modifications) {
+            if (argument_modification.index == key
+                && !argument_modification.replaced_default_expression.isEmpty()) {
+                return argument_modification.replaced_default_expression;
+            }
+        }
+    }
+
+    return QString();
+}
+
+bool AbstractMetaFunction::removedDefaultExpression(const AbstractMetaClass *cls, int key) const
+{
+    FunctionModificationList modifications = this->modifications(cls);
+    foreach (FunctionModification modification, modifications) {
+        QList<ArgumentModification> argument_modifications = modification.argument_mods;
+        foreach (ArgumentModification argument_modification, argument_modifications) {
+            if (argument_modification.index == key
+                && argument_modification.removed_default_expression) {
+                return true;
+            }
+        }
+    }
+
+    return false;
+}
+
+bool AbstractMetaFunction::resetObjectAfterUse(int argument_idx) const
+{
+    const AbstractMetaClass *cls = declaringClass();
+    FunctionModificationList modifications = this->modifications(cls);
+    foreach (FunctionModification modification, modifications) {
+        QList<ArgumentModification> argumentModifications = modification.argument_mods;
+        foreach (ArgumentModification argumentModification, argumentModifications) {
+            if (argumentModification.index == argument_idx && argumentModification.reset_after_use)
+                return true;
+        }
+    }
+
+    return false;
+}
+
+QString AbstractMetaFunction::nullPointerDefaultValue(const AbstractMetaClass *mainClass, int argument_idx) const
+{
+    Q_ASSERT(nullPointersDisabled(mainClass, argument_idx));
+
+    const AbstractMetaClass *cls = mainClass;
+    if (cls == 0)
+        cls = implementingClass();
+
+    do {
+        FunctionModificationList modifications = this->modifications(cls);
+        foreach (FunctionModification modification, modifications) {
+            QList<ArgumentModification> argument_modifications = modification.argument_mods;
+            foreach (ArgumentModification argument_modification, argument_modifications) {
+                if (argument_modification.index == argument_idx
+                    && argument_modification.no_null_pointers) {
+                    return argument_modification.null_pointer_default_value;
+                }
+            }
+        }
+
+        cls = cls->baseClass();
+    } while (cls != 0 && mainClass == 0); // Once when mainClass != 0, or once for all base classes of implementing class
+
+    return QString();
+
+}
+
+bool AbstractMetaFunction::nullPointersDisabled(const AbstractMetaClass *mainClass, int argument_idx) const
+{
+    const AbstractMetaClass *cls = mainClass;
+    if (cls == 0)
+        cls = implementingClass();
+
+    do {
+        FunctionModificationList modifications = this->modifications(cls);
+        foreach (FunctionModification modification, modifications) {
+            QList<ArgumentModification> argument_modifications = modification.argument_mods;
+            foreach (ArgumentModification argument_modification, argument_modifications) {
+                if (argument_modification.index == argument_idx
+                    && argument_modification.no_null_pointers) {
+                    return true;
+                }
+            }
+        }
+
+        cls = cls->baseClass();
+    } while (cls != 0 && mainClass == 0); // Once when mainClass != 0, or once for all base classes of implementing class
+
+    return false;
+}
+
+QString AbstractMetaFunction::conversionRule(TypeSystem::Language language, int key) const
+{
+    FunctionModificationList modifications = this->modifications(declaringClass());
+    foreach (FunctionModification modification, modifications) {
+        QList<ArgumentModification> argument_modifications = modification.argument_mods;
+        foreach (ArgumentModification argument_modification, argument_modifications) {
+            if (argument_modification.index != key)
+                continue;
+
+            foreach (CodeSnip snip, argument_modification.conversion_rules) {
+                if (snip.language == language && !snip.code().isEmpty())
+                    return snip.code();
+            }
+        }
+    }
+
+    return QString();
+}
+
+QString AbstractMetaFunction::argumentReplaced(int key) const
+{
+    FunctionModificationList modifications = this->modifications(declaringClass());
+    foreach (FunctionModification modification, modifications) {
+        QList<ArgumentModification> argument_modifications = modification.argument_mods;
+        foreach (ArgumentModification argument_modification, argument_modifications) {
+            if (argument_modification.index == key && !argument_modification.replace_value.isEmpty()) {
+                return argument_modification.replace_value;
+            }
+        }
+    }
+
+    return "";
+}
+
+bool AbstractMetaFunction::argumentRemoved(int key) const
+{
+    FunctionModificationList modifications = this->modifications(declaringClass());
+    foreach (FunctionModification modification, modifications) {
+        QList<ArgumentModification> argument_modifications = modification.argument_mods;
+        foreach (ArgumentModification argument_modification, argument_modifications) {
+            if (argument_modification.index == key) {
+                if (argument_modification.removed) {
+                    return true;
+                }
+            }
+        }
+    }
+
+    return false;
+}
+
+bool AbstractMetaFunction::storeResult() const
+{
+    if (m_store_result == 2)
+        return true;
+    else
+        return false;
+}
+
+void AbstractMetaFunction::checkStoreResult()
+{
+    FunctionModificationList modifications = this->modifications(declaringClass());
+    foreach (FunctionModification modification, modifications) {
+        if (modification.store_result) {
+            m_store_result = 2;
+            return;
+        }
+    }
+
+    m_store_result = 1;
+}
+
+bool AbstractMetaFunction::isVirtualSlot() const
+{
+    FunctionModificationList modifications = this->modifications(declaringClass());
+    foreach (FunctionModification modification, modifications) {
+        if (modification.isVirtualSlot())
+            return true;
+    }
+
+    return false;
+}
+
+bool AbstractMetaFunction::disabledGarbageCollection(const AbstractMetaClass *cls, int key) const
+{
+    FunctionModificationList modifications = this->modifications(cls);
+    foreach (FunctionModification modification, modifications) {
+        QList<ArgumentModification> argument_modifications = modification.argument_mods;
+        foreach (ArgumentModification argument_modification, argument_modifications) {
+            if (argument_modification.index != key)
+                continue;
+
+            foreach (TypeSystem::Ownership ownership, argument_modification.ownerships.values()) {
+                if (ownership == TypeSystem::CppOwnership)
+                    return true;
+            }
+
+        }
+    }
+
+    return false;
+}
+
+bool AbstractMetaFunction::isDeprecated() const
+{
+    FunctionModificationList modifications = this->modifications(declaringClass());
+    foreach (FunctionModification modification, modifications) {
+        if (modification.isDeprecated())
+            return true;
+    }
+    return false;
+}
+
+TypeSystem::Ownership AbstractMetaFunction::ownership(const AbstractMetaClass *cls, TypeSystem::Language language, int key) const
+{
+    FunctionModificationList modifications = this->modifications(cls);
+    foreach (FunctionModification modification, modifications) {
+        QList<ArgumentModification> argument_modifications = modification.argument_mods;
+        foreach (ArgumentModification argument_modification, argument_modifications) {
+            if (argument_modification.index == key)
+                return argument_modification.ownerships.value(language, TypeSystem::InvalidOwnership);
+        }
+    }
+
+    return TypeSystem::InvalidOwnership;
+}
+
+bool AbstractMetaFunction::isRemovedFromAllLanguages(const AbstractMetaClass *cls) const
+{
+    return isRemovedFrom(cls, TypeSystem::All);
+}
+
+bool AbstractMetaFunction::isRemovedFrom(const AbstractMetaClass *cls, TypeSystem::Language language) const
+{
+    FunctionModificationList modifications = this->modifications(cls);
+    foreach (FunctionModification modification, modifications) {
+        if ((modification.removal & language) == language)
+            return true;
+    }
+
+    return false;
+
+}
+
+QString AbstractMetaFunction::typeReplaced(int key) const
+{
+    FunctionModificationList modifications = this->modifications(declaringClass());
+    foreach (FunctionModification modification, modifications) {
+        QList<ArgumentModification> argument_modifications = modification.argument_mods;
+        foreach (ArgumentModification argument_modification, argument_modifications) {
+            if (argument_modification.index == key
+                && !argument_modification.modified_type.isEmpty()) {
+                return argument_modification.modified_type;
+            }
+        }
+    }
+
+    return QString();
+}
+
+QString AbstractMetaFunction::minimalSignature() const
+{
+    if (!m_cached_minimal_signature.isEmpty())
+        return m_cached_minimal_signature;
+
+    QString minimalSignature = originalName() + "(";
+    AbstractMetaArgumentList arguments = this->arguments();
+
+    for (int i=0; i<arguments.count(); ++i) {
+        AbstractMetaType *t = arguments.at(i)->type();
+
+        if (i > 0)
+            minimalSignature += ",";
+
+        minimalSignature += t->minimalSignature();
+    }
+    minimalSignature += ")";
+    if (isConstant())
+        minimalSignature += "const";
+
+    minimalSignature = QMetaObject::normalizedSignature(minimalSignature.toLocal8Bit().constData());
+    m_cached_minimal_signature = minimalSignature;
+
+    return minimalSignature;
+}
+
+FunctionModificationList AbstractMetaFunction::modifications(const AbstractMetaClass *implementor) const
+{
+    Q_ASSERT(implementor);
+    return implementor->typeEntry()->functionModifications(minimalSignature());
+}
+
+bool AbstractMetaFunction::hasModifications(const AbstractMetaClass *implementor) const
+{
+    FunctionModificationList mods = modifications(implementor);
+    return mods.count() > 0;
+}
+
+QString AbstractMetaFunction::modifiedName() const
+{
+    if (m_cached_modified_name.isEmpty()) {
+        FunctionModificationList mods = modifications(implementingClass());
+        foreach (FunctionModification mod, mods) {
+            if (mod.isRenameModifier()) {
+                m_cached_modified_name = mod.renamedToName;
+                break;
+            }
+        }
+        if (m_cached_modified_name.isEmpty())
+            m_cached_modified_name = name();
+    }
+    return m_cached_modified_name;
+}
+
+QString AbstractMetaFunction::targetLangSignature(bool minimal) const
+{
+    QString s;
+
+    // Attributes...
+    if (!minimal) {
+        if (isPublic()) s += "public ";
+        else if (isProtected()) s += "protected ";
+        else if (isPrivate()) s += "private ";
+
+//     if (isNative()) s += "native ";
+//     else
+        if (isFinalInTargetLang()) s += "final ";
+        else if (isAbstract()) s += "abstract ";
+
+        if (isStatic()) s += "static ";
+
+        // Return type
+        if (type())
+            s += type()->fullName() + " ";
+        else
+            s += "void ";
+    }
+
+    s += name();
+    s += "(";
+
+    for (int i=0; i<m_arguments.size(); ++i) {
+        if (i != 0) {
+            s += ",";
+            if (!minimal)
+                s += QLatin1Char(' ');
+        }
+        s += m_arguments.at(i)->type()->fullName();
+
+        if (!minimal) {
+            s += " ";
+            s += m_arguments.at(i)->argumentName();
+        }
+    }
+
+    s += ")";
+
+    return s;
+}
+
+
+bool function_sorter(AbstractMetaFunction *a, AbstractMetaFunction *b)
+{
+    return a->signature() < b->signature();
+}
+
+/*******************************************************************************
+ * AbstractMetaClass
+ */
+AbstractMetaClass::~AbstractMetaClass()
+{
+    qDeleteAll(m_functions);
+    qDeleteAll(m_fields);
+}
+
+/*AbstractMetaClass *AbstractMetaClass::copy() const
+{
+    AbstractMetaClass *cls = new AbstractMetaClass;
+    cls->setAttributes(attributes());
+    cls->setBaseClass(baseClass());
+    cls->setTypeEntry(typeEntry());
+    foreach (AbstractMetaFunction *function, functions()) {
+        AbstractMetaFunction *copy = function->copy();
+        function->setImplementingClass(cls);
+        cls->addFunction(copy);
+    }
+    cls->setEnums(enums());
+    foreach (const AbstractMetaField *field, fields()) {
+        AbstractMetaField *copy = field->copy();
+        copy->setEnclosingClass(cls);
+        cls->addField(copy);
+    }
+    cls->setInterfaces(interfaces());
+
+    return cls;
+}*/
+
+/*******************************************************************************
+ * Returns true if this class is a subclass of the given class
+ */
+bool AbstractMetaClass::inheritsFrom(const AbstractMetaClass *cls) const
+{
+    Q_ASSERT(cls != 0);
+
+    const AbstractMetaClass *clazz = this;
+    while (clazz != 0) {
+        if (clazz == cls)
+            return true;
+
+        clazz = clazz->baseClass();
+    }
+
+    return false;
+}
+
+/*******************************************************************************
+ * Constructs an interface based on the functions and enums in this
+ * class and returns it...
+ */
+AbstractMetaClass *AbstractMetaClass::extractInterface()
+{
+    Q_ASSERT(typeEntry()->designatedInterface());
+
+    if (m_extracted_interface == 0) {
+        AbstractMetaClass *iface = new AbstractMetaClass;
+        iface->setAttributes(attributes());
+        iface->setBaseClass(0);
+        iface->setPrimaryInterfaceImplementor(this);
+
+        iface->setTypeEntry(typeEntry()->designatedInterface());
+
+        foreach (AbstractMetaFunction *function, functions()) {
+            if (!function->isConstructor())
+                iface->addFunction(function->copy());
+        }
+
+//         iface->setEnums(enums());
+//         setEnums(AbstractMetaEnumList());
+
+        foreach (const AbstractMetaField *field, fields()) {
+            if (field->isPublic()) {
+                AbstractMetaField *new_field = field->copy();
+                new_field->setEnclosingClass(iface);
+                iface->addField(new_field);
+            }
+        }
+
+        m_extracted_interface = iface;
+        addInterface(iface);
+    }
+
+    return m_extracted_interface;
+}
+
+/*******************************************************************************
+ * Returns a list of all the functions with a given name
+ */
+AbstractMetaFunctionList AbstractMetaClass::queryFunctionsByName(const QString &name) const
+{
+    AbstractMetaFunctionList returned;
+    AbstractMetaFunctionList functions = this->functions();
+    foreach (AbstractMetaFunction *function, functions) {
+        if (function->name() == name)
+            returned.append(function);
+    }
+
+    return returned;
+}
+
+/*******************************************************************************
+ * Returns all reference count modifications for any function in the class
+ */
+QList<ReferenceCount> AbstractMetaClass::referenceCounts() const
+{
+    QList<ReferenceCount> returned;
+
+    AbstractMetaFunctionList functions = this->functions();
+    foreach (AbstractMetaFunction *function, functions) {
+        returned += function->referenceCounts(this);
+    }
+
+    return returned;
+}
+
+/*******************************************************************************
+ * Returns a list of all the functions retrieved during parsing which should
+ * be added to the Java API.
+ */
+AbstractMetaFunctionList AbstractMetaClass::functionsInTargetLang() const
+{
+    int default_flags = NormalFunctions | Visible | NotRemovedFromTargetLang;
+
+    // Interfaces don't implement functions
+    default_flags |= isInterface() ? 0 : ClassImplements;
+
+    // Only public functions in final classes
+    // default_flags |= isFinal() ? WasPublic : 0;
+    int public_flags = isFinal() ? WasPublic : 0;
+
+    // Constructors
+    AbstractMetaFunctionList returned = queryFunctions(Constructors | default_flags | public_flags);
+
+    // Final functions
+    returned += queryFunctions(FinalInTargetLangFunctions | NonStaticFunctions | default_flags | public_flags);
+
+    // Virtual functions
+    returned += queryFunctions(VirtualInTargetLangFunctions | NonStaticFunctions | default_flags | public_flags);
+
+    // Static functions
+    returned += queryFunctions(StaticFunctions | default_flags | public_flags);
+
+    // Empty, private functions, since they aren't caught by the other ones
+    returned += queryFunctions(Empty | Invisible);
+
+    return returned;
+}
+
+AbstractMetaFunctionList AbstractMetaClass::virtualFunctions() const
+{
+    AbstractMetaFunctionList list = functionsInShellClass();
+
+    AbstractMetaFunctionList returned;
+    foreach (AbstractMetaFunction *f, list) {
+        if (!f->isFinalInCpp() || f->isVirtualSlot())
+            returned += f;
+    }
+
+    return returned;
+}
+
+AbstractMetaFunctionList AbstractMetaClass::nonVirtualShellFunctions() const
+{
+    AbstractMetaFunctionList list = functionsInShellClass();
+    AbstractMetaFunctionList returned;
+    foreach (AbstractMetaFunction *f, list) {
+        if (f->isFinalInCpp() && !f->isVirtualSlot())
+            returned += f;
+    }
+
+    return returned;
+}
+
+/*******************************************************************************
+ * Returns a list of all functions that should be declared and implemented in
+ * the shell class which is generated as a wrapper on top of the actual C++ class
+ */
+AbstractMetaFunctionList AbstractMetaClass::functionsInShellClass() const
+{
+    // Only functions and only protected and public functions
+    int default_flags = NormalFunctions | Visible | WasVisible | NotRemovedFromShell;
+
+    // All virtual functions
+    AbstractMetaFunctionList returned = queryFunctions(VirtualFunctions | default_flags);
+
+    // All functions explicitly set to be implemented by the shell class
+    // (mainly superclass functions that are hidden by other declarations)
+    returned += queryFunctions(ForcedShellFunctions | default_flags);
+
+    // All functions explicitly set to be virtual slots
+    returned += queryFunctions(VirtualSlots | default_flags);
+
+    return returned;
+}
+
+/*******************************************************************************
+ * Returns a list of all functions that require a public override function to
+ * be generated in the shell class. This includes all functions that were originally
+ * protected in the superclass.
+ */
+AbstractMetaFunctionList AbstractMetaClass::publicOverrideFunctions() const
+{
+    return queryFunctions(NormalFunctions | WasProtected | FinalInCppFunctions | NotRemovedFromTargetLang)
+         + queryFunctions(Signals | WasProtected | FinalInCppFunctions | NotRemovedFromTargetLang);
+}
+
+AbstractMetaFunctionList AbstractMetaClass::virtualOverrideFunctions() const
+{
+    return queryFunctions(NormalFunctions | NonEmptyFunctions | Visible | VirtualInCppFunctions | NotRemovedFromShell) +
+           queryFunctions(Signals | NonEmptyFunctions | Visible | VirtualInCppFunctions | NotRemovedFromShell);
+}
+
+void AbstractMetaClass::sortFunctions()
+{
+    qSort(m_functions.begin(), m_functions.end(), function_sorter);
+}
+
+void AbstractMetaClass::setFunctions(const AbstractMetaFunctionList &functions)
+{
+    m_functions = functions;
+
+    // Functions must be sorted by name before next loop
+    sortFunctions();
+
+    QString currentName;
+    bool hasVirtuals = false;
+    AbstractMetaFunctionList final_functions;
+    foreach (AbstractMetaFunction *f, m_functions) {
+        f->setOwnerClass(this);
+
+        m_has_virtual_slots |= f->isVirtualSlot();
+        m_has_virtuals |= !f->isFinal() || f->isVirtualSlot();
+        m_has_nonpublic |= !f->isPublic();
+
+        // If we have non-virtual overloads of a virtual function, we have to implement
+        // all the overloads in the shell class to override the hiding rule
+        if (currentName == f->name()) {
+            hasVirtuals = hasVirtuals || !f->isFinal();
+            if (f->isFinal())
+                final_functions += f;
+        } else {
+            if (hasVirtuals && final_functions.size() > 0) {
+                foreach (AbstractMetaFunction *final_function, final_functions) {
+                    *final_function += AbstractMetaAttributes::ForceShellImplementation;
+
+                    QString warn = QString("hiding of function '%1' in class '%2'")
+                        .arg(final_function->name()).arg(name());
+                    ReportHandler::warning(warn);
+                }
+            }
+
+            hasVirtuals = !f->isFinal();
+            final_functions.clear();
+            if (f->isFinal())
+                final_functions += f;
+            currentName = f->name();
+        }
+    }
+
+#ifndef QT_NO_DEBUG
+    bool duplicate_function = false;
+    for (int j=0; j<m_functions.size(); ++j) {
+        FunctionModificationList mods = m_functions.at(j)->modifications(m_functions.at(j)->implementingClass());
+
+        bool removed = false;
+        foreach (const FunctionModification &mod, mods) {
+            if (mod.isRemoveModifier()) {
+                removed = true;
+                break ;
+            }
+        }
+        if (removed)
+            continue ;
+
+        for (int i=0; i<m_functions.size() - 1; ++i) {
+            if (j == i)
+                continue;
+
+            mods = m_functions.at(i)->modifications(m_functions.at(i)->implementingClass());
+            bool removed = false;
+            foreach (const FunctionModification &mod, mods) {
+                if (mod.isRemoveModifier()) {
+                    removed = true;
+                    break ;
+                }
+            }
+            if (removed)
+                continue ;
+
+            uint cmp = m_functions.at(i)->compareTo(m_functions.at(j));
+            if ((cmp & AbstractMetaFunction::EqualName) && (cmp & AbstractMetaFunction::EqualArguments)) {
+                printf("%s.%s mostly equal to %s.%s\n",
+                       qPrintable(m_functions.at(i)->implementingClass()->typeEntry()->qualifiedCppName()),
+                       qPrintable(m_functions.at(i)->signature()),
+                       qPrintable(m_functions.at(j)->implementingClass()->typeEntry()->qualifiedCppName()),
+                       qPrintable(m_functions.at(j)->signature()));
+                duplicate_function = true;
+            }
+        }
+    }
+    //Q_ASSERT(!duplicate_function);
+#endif
+}
+
+bool AbstractMetaClass::hasFieldAccessors() const
+{
+    foreach (const AbstractMetaField *field, fields()) {
+        if (field->getter() || field->setter())
+            return true;
+    }
+
+    return false;
+}
+
+bool AbstractMetaClass::hasDefaultToStringFunction() const
+{
+    foreach (AbstractMetaFunction *f, queryFunctionsByName("toString")) {
+        if (f->actualMinimumArgumentCount() == 0) {
+            return true;
+        }
+
+    }
+    return false;
+}
+
+void AbstractMetaClass::addFunction(AbstractMetaFunction *function)
+{
+    function->setOwnerClass(this);
+
+    if (!function->isDestructor()) {
+        m_functions << function;
+        qSort(m_functions.begin(), m_functions.end(), function_sorter);
+    }
+
+
+    m_has_virtual_slots |= function->isVirtualSlot();
+    m_has_virtuals |= !function->isFinal() || function->isVirtualSlot();
+    m_has_nonpublic |= !function->isPublic();
+}
+
+bool AbstractMetaClass::hasSignal(const AbstractMetaFunction *other) const
+{
+    if (!other->isSignal())
+        return false;
+
+    foreach (const AbstractMetaFunction *f, functions()) {
+        if (f->isSignal() && f->compareTo(other) & AbstractMetaFunction::EqualName)
+            return other->modifiedName() == f->modifiedName();
+    }
+
+    return false;
+}
+
+
+QString AbstractMetaClass::name() const
+{
+    return QString(m_type_entry->targetLangName()).replace("::", "_");
+}
+
+bool AbstractMetaClass::hasFunction(const QString &str) const
+{
+    foreach (const AbstractMetaFunction *f, functions())
+        if (f->name() == str)
+            return true;
+    return false;
+}
+
+/* Returns true if this class has one or more functions that are
+   protected. If a class has protected members we need to generate a
+   shell class with public accessors to the protected functions, so
+   they can be called from the native functions.
+*/
+bool AbstractMetaClass::hasProtectedFunctions() const {
+    foreach (AbstractMetaFunction *func, m_functions) {
+        if (func->isProtected())
+            return true;
+    }
+    return false;
+}
+
+bool AbstractMetaClass::generateShellClass() const
+{
+    return m_force_shell_class ||
+        (!isFinal()
+         && (hasVirtualFunctions()
+             || hasProtectedFunctions()
+             || hasFieldAccessors()
+             || typeEntry()->isObject())); // qtd2 for being more consistent
+}
+
+QPropertySpec *AbstractMetaClass::propertySpecForRead(const QString &name) const
+{
+    for (int i=0; i<m_property_specs.size(); ++i)
+        if (name == m_property_specs.at(i)->read())
+            return m_property_specs.at(i);
+    return 0;
+}
+
+QPropertySpec *AbstractMetaClass::propertySpecForWrite(const QString &name) const
+{
+    for (int i=0; i<m_property_specs.size(); ++i)
+        if (name == m_property_specs.at(i)->write())
+            return m_property_specs.at(i);
+    return 0;
+}
+
+QPropertySpec *AbstractMetaClass::propertySpecForReset(const QString &name) const
+{
+    for (int i=0; i<m_property_specs.size(); ++i) {
+        if (name == m_property_specs.at(i)->reset())
+            return m_property_specs.at(i);
+    }
+    return 0;
+}
+
+
+
+static bool functions_contains(const AbstractMetaFunctionList &l, const AbstractMetaFunction *func)
+{
+    foreach (const AbstractMetaFunction *f, l) {
+        if ((f->compareTo(func) & AbstractMetaFunction::PrettySimilar) == AbstractMetaFunction::PrettySimilar)
+            return true;
+    }
+    return false;
+}
+
+AbstractMetaField::AbstractMetaField() : m_getter(0), m_setter(0), m_class(0)
+{
+}
+
+AbstractMetaField::~AbstractMetaField()
+{
+    delete m_setter;
+    delete m_getter;
+}
+ushort        painters;                        // refcount
+AbstractMetaField *AbstractMetaField::copy() const
+{
+    AbstractMetaField *returned = new AbstractMetaField;
+    returned->setEnclosingClass(0);
+    returned->setAttributes(attributes());
+    returned->setName(name());
+    returned->setType(type()->copy());
+    returned->setOriginalAttributes(originalAttributes());
+
+    return returned;
+}
+
+static QString upCaseFirst(const QString &str) {
+    Q_ASSERT(!str.isEmpty());
+    QString s = str;
+    s[0] = s.at(0).toUpper();
+    return s;
+}
+
+static AbstractMetaFunction *createXetter(const AbstractMetaField *g, const QString &name, uint type) {
+    AbstractMetaFunction *f = new AbstractMetaFunction;
+
+
+
+    f->setName(name);
+    f->setOriginalName(name);
+    f->setOwnerClass(g->enclosingClass());
+    f->setImplementingClass(g->enclosingClass());
+    f->setDeclaringClass(g->enclosingClass());
+
+    uint attr = AbstractMetaAttributes::Native
+                | AbstractMetaAttributes::Final
+                | type;
+    if (g->isStatic())
+        attr |= AbstractMetaAttributes::Static;
+    if (g->isPublic())
+        attr |= AbstractMetaAttributes::Public;
+    else if (g->isProtected())
+        attr |= AbstractMetaAttributes::Protected;
+    else
+        attr |= AbstractMetaAttributes::Private;
+    f->setAttributes(attr);
+    f->setOriginalAttributes(attr);
+
+    FieldModificationList mods = g->modifications();
+    foreach (FieldModification mod, mods) {
+        if (mod.isRenameModifier())
+            f->setName(mod.renamedTo());
+        if (mod.isAccessModifier()) {
+            if (mod.isPrivate())
+                f->setVisibility(AbstractMetaAttributes::Private);
+            else if (mod.isProtected())
+                f->setVisibility(AbstractMetaAttributes::Protected);
+            else if (mod.isPublic())
+                f->setVisibility(AbstractMetaAttributes::Public);
+            else if (mod.isFriendly())
+                f->setVisibility(AbstractMetaAttributes::Friendly);
+        }
+
+    }
+    return f;
+}
+
+FieldModificationList AbstractMetaField::modifications() const
+{
+    FieldModificationList mods = enclosingClass()->typeEntry()->fieldModifications();
+    FieldModificationList returned;
+
+    foreach (FieldModification mod, mods) {
+        if (mod.name == name())
+            returned += mod;
+    }
+
+    return returned;
+}
+
+const AbstractMetaFunction *AbstractMetaField::setter() const
+{
+    if (m_setter == 0) {
+        m_setter = createXetter(this,
+                                "set" + upCaseFirst(name()),
+                                AbstractMetaAttributes::SetterFunction);
+        AbstractMetaArgumentList arguments;
+        AbstractMetaArgument *argument = new AbstractMetaArgument;
+        argument->setType(type()->copy());
+        argument->setName(name());
+        arguments.append(argument);
+        m_setter->setArguments(arguments);
+    }
+    return m_setter;
+}
+
+const AbstractMetaFunction *AbstractMetaField::getter() const
+{
+    if (m_getter == 0) {
+        m_getter = createXetter(this,
+                                name(),
+                                AbstractMetaAttributes::GetterFunction);
+        m_getter->setType(type());
+    }
+
+    return m_getter;
+}
+
+
+bool AbstractMetaClass::hasConstructors() const
+{
+    return queryFunctions(Constructors).size() != 0;
+}
+
+void AbstractMetaClass::addDefaultConstructor()
+{
+    AbstractMetaFunction *f = new AbstractMetaFunction;
+    f->setName(name());
+    f->setOwnerClass(this);
+    f->setFunctionType(AbstractMetaFunction::ConstructorFunction);
+    f->setArguments(AbstractMetaArgumentList());
+    f->setDeclaringClass(this);
+
+    uint attr = AbstractMetaAttributes::Native;
+    attr |= AbstractMetaAttributes::Public;
+    attr |= AbstractMetaAttributes::Final; // qtd otherwise added constructor is virtual which in fact it is not
+    f->setAttributes(attr);
+    f->setImplementingClass(this);
+    f->setOriginalAttributes(f->attributes());
+
+    addFunction(f);
+}
+
+bool AbstractMetaClass::hasFunction(const AbstractMetaFunction *f) const
+{
+    return functions_contains(m_functions, f);
+}
+
+/* Goes through the list of functions and returns a list of all
+   functions matching all of the criteria in \a query.
+ */
+
+AbstractMetaFunctionList AbstractMetaClass::queryFunctions(uint query) const
+{
+    AbstractMetaFunctionList functions;
+
+    foreach (AbstractMetaFunction *f, m_functions) {
+
+        if ((query & VirtualSlots) && !f->isVirtualSlot())
+            continue;
+
+        if ((query & NotRemovedFromTargetLang) && f->isRemovedFrom(f->implementingClass(), TypeSystem::TargetLangCode)) {
+            continue;
+        }
+
+        if ((query & NotRemovedFromTargetLang) && !f->isFinal() && f->isRemovedFrom(f->declaringClass(), TypeSystem::TargetLangCode)) {
+            continue;
+        }
+
+        if ((query & NotRemovedFromShell) && f->isRemovedFrom(f->implementingClass(), TypeSystem::ShellCode)) {
+            continue;
+        }
+
+        if ((query & NotRemovedFromShell) && !f->isFinal() && f->isRemovedFrom(f->declaringClass(), TypeSystem::ShellCode)) {
+            continue;
+        }
+
+        if ((query & Visible) && f->isPrivate()) {
+            continue;
+        }
+
+        if ((query & VirtualInTargetLangFunctions) && f->isFinalInTargetLang()) {
+            continue;
+        }
+
+        if ((query & Invisible) && !f->isPrivate()) {
+            continue;
+        }
+
+        if ((query & Empty) && !f->isEmptyFunction()) {
+            continue;
+        }
+
+        if ((query & WasPublic) && !f->wasPublic()) {
+            continue;
+        }
+
+        if ((query & WasVisible) && f->wasPrivate()) {
+            continue;
+        }
+
+        if ((query & WasProtected) && !f->wasProtected()) {
+            continue;
+        }
+
+        if ((query & ClassImplements) && f->ownerClass() != f->implementingClass()) {
+            continue;
+        }
+
+        if ((query & Inconsistent) && (f->isFinalInTargetLang() || !f->isFinalInCpp() || f->isStatic())) {
+            continue;
+        }
+
+        if ((query & FinalInTargetLangFunctions) && !f->isFinalInTargetLang()) {
+            continue;
+        }
+
+        if ((query & FinalInCppFunctions) && !f->isFinalInCpp()) {
+            continue;
+        }
+
+        if ((query & VirtualInCppFunctions) && f->isFinalInCpp()) {
+            continue;
+        }
+
+        if ((query & Signals) && (!f->isSignal())) {
+            continue;
+        }
+
+        if ((query & ForcedShellFunctions)
+            && (!f->isForcedShellImplementation()
+                || !f->isFinal())) {
+            continue;
+        }
+
+        if ((query & Constructors) && (!f->isConstructor()
+                                       || f->ownerClass() != f->implementingClass())
+            || f->isConstructor() && (query & Constructors) == 0) {
+            continue;
+        }
+
+        // Destructors are never included in the functions of a class currently
+        /*
+           if ((query & Destructors) && (!f->isDestructor()
+                                       || f->ownerClass() != f->implementingClass())
+            || f->isDestructor() && (query & Destructors) == 0) {
+            continue;
+        }*/
+
+        if ((query & VirtualFunctions) && (f->isFinal() || f->isSignal() || f->isStatic())) {
+            continue;
+        }
+
+        if ((query & StaticFunctions) && (!f->isStatic() || f->isSignal())) {
+            continue;
+        }
+
+        if ((query & NonStaticFunctions) && (f->isStatic())) {
+            continue;
+        }
+
+        if ((query & NonEmptyFunctions) && (f->isEmptyFunction())) {
+            continue;
+        }
+
+        if ((query & NormalFunctions) && (f->isSignal())) {
+            continue;
+        }
+
+        if ((query & AbstractFunctions) && !f->isAbstract()) {
+            continue;
+        }
+
+        functions << f;
+    }
+
+//    qDebug() << "queried" << m_type_entry->qualifiedCppName() << "got" << functions.size() << "out of" << m_functions.size();
+
+    return functions;
+}
+
+
+bool AbstractMetaClass::hasInconsistentFunctions() const
+{
+    return cppInconsistentFunctions().size() > 0;
+}
+
+bool AbstractMetaClass::hasSignals() const
+{
+    return cppSignalFunctions().size() > 0;
+}
+
+
+/**
+ * Adds the specified interface to this class by adding all the
+ * functions in the interface to this class.
+ */
+void AbstractMetaClass::addInterface(AbstractMetaClass *interface)
+{
+    Q_ASSERT(!m_interfaces.contains(interface));
+    m_interfaces << interface;
+
+    if (m_extracted_interface != 0 && m_extracted_interface != interface)
+        m_extracted_interface->addInterface(interface);
+
+    foreach (AbstractMetaFunction *function, interface->functions())
+        if (!hasFunction(function) && !function->isConstructor()) {
+            AbstractMetaFunction *cpy = function->copy();
+            cpy->setImplementingClass(this);
+
+            // Setup that this function is an interface class.
+            cpy->setInterfaceClass(interface);
+            *cpy += AbstractMetaAttributes::InterfaceFunction;
+
+            // Copy the modifications in interface into the implementing classes.
+            FunctionModificationList mods = function->modifications(interface);
+            foreach  (const FunctionModification &mod, mods) {
+                m_type_entry->addFunctionModification(mod);
+            }
+
+            // It should be mostly safe to assume that when we implement an interface
+            // we don't "pass on" pure virtual functions to our sublcasses...
+//             *cpy -= AbstractMetaAttributes::Abstract;
+
+            addFunction(cpy);
+        }
+}
+
+
+void AbstractMetaClass::setInterfaces(const AbstractMetaClassList &interfaces)
+{
+    m_interfaces = interfaces;
+}
+
+
+AbstractMetaEnum *AbstractMetaClass::findEnum(const QString &enumName)
+{
+    foreach (AbstractMetaEnum *e, m_enums) {
+        if (e->name() == enumName)
+            return e;
+    }
+
+    if (typeEntry()->designatedInterface())
+        return extractInterface()->findEnum(enumName);
+
+    return 0;
+}
+
+
+
+
+/*!  Recursivly searches for the enum value named \a enumValueName in
+  this class and its superclasses and interfaces. Values belonging to
+  \a meta_enum are excluded from the search.
+*/
+AbstractMetaEnumValue *AbstractMetaClass::findEnumValue(const QString &enumValueName, AbstractMetaEnum *meta_enum)
+{
+    foreach (AbstractMetaEnum *e, m_enums) {
+        if (e == meta_enum)
+            continue;
+        foreach (AbstractMetaEnumValue *v, e->values()) {
+            if (v->name() == enumValueName)
+                return v;
+        }
+    }
+
+    if (typeEntry()->designatedInterface())
+        return extractInterface()->findEnumValue(enumValueName, meta_enum);
+
+    if (baseClass() != 0)
+        return baseClass()->findEnumValue(enumValueName, meta_enum);
+
+    return 0;
+}
+
+
+/*!
+ * Searches through all of this class' enums for a value matching the
+ * name \a enumValueName. The name is excluding the class/namespace
+ * prefix. The function recursivly searches interfaces and baseclasses
+ * of this class.
+ */
+AbstractMetaEnum *AbstractMetaClass::findEnumForValue(const QString &enumValueName)
+{
+    foreach (AbstractMetaEnum *e, m_enums) {
+        foreach (AbstractMetaEnumValue *v, e->values()) {
+            if (v->name() == enumValueName)
+                return e;
+        }
+    }
+
+    if (typeEntry()->designatedInterface())
+        return extractInterface()->findEnumForValue(enumValueName);
+
+    if (baseClass() != 0)
+        return baseClass()->findEnumForValue(enumValueName);
+
+    return 0;
+}
+
+
+static void add_extra_include_for_type(AbstractMetaClass *meta_class, const AbstractMetaType *type)
+{
+
+    if (type == 0)
+        return;
+
+    Q_ASSERT(meta_class != 0);
+    const TypeEntry *entry = (type ? type->typeEntry() : 0);
+    if (entry != 0 && entry->isComplex()) {
+        const ComplexTypeEntry *centry = static_cast<const ComplexTypeEntry *>(entry);
+        ComplexTypeEntry *class_entry = meta_class->typeEntry();
+        if (class_entry != 0 && centry->include().isValid())
+            class_entry->addExtraInclude(centry->include());
+    }
+
+    if (type->hasInstantiations()) {
+        QList<AbstractMetaType *> instantiations = type->instantiations();
+        foreach (AbstractMetaType *instantiation, instantiations)
+            add_extra_include_for_type(meta_class, instantiation);
+    }
+}
+
+static void add_extra_includes_for_function(AbstractMetaClass *meta_class, const AbstractMetaFunction *meta_function)
+{
+    Q_ASSERT(meta_class != 0);
+    Q_ASSERT(meta_function != 0);
+    add_extra_include_for_type(meta_class, meta_function->type());
+
+    AbstractMetaArgumentList arguments = meta_function->arguments();
+    foreach (AbstractMetaArgument *argument, arguments)
+        add_extra_include_for_type(meta_class, argument->type());
+}
+
+void AbstractMetaClass::fixFunctions()
+{
+    if (m_functions_fixed)
+        return;
+    else
+        m_functions_fixed = true;
+
+    AbstractMetaClass *super_class = baseClass();
+    AbstractMetaFunctionList funcs = functions();
+
+//     printf("fix functions for %s\n", qPrintable(name()));
+
+    if (super_class != 0)
+        super_class->fixFunctions();
+    int iface_idx = 0;
+    while (super_class || iface_idx < interfaces().size()) {
+//         printf(" - base: %s\n", qPrintable(super_class->name()));
+
+        // Since we always traverse the complete hierarchy we are only
+        // interrested in what each super class implements, not what
+        // we may have propagated from their base classes again.
+        AbstractMetaFunctionList super_funcs;
+        if (super_class) {
+
+            // Super classes can never be final
+            if (super_class->isFinalInTargetLang()) {
+                ReportHandler::warning("Final class '" + super_class->name() + "' set to non-final, as it is extended by other classes");
+                *super_class -= AbstractMetaAttributes::FinalInTargetLang;
+            }
+            super_funcs = super_class->queryFunctions(AbstractMetaClass::ClassImplements);
+        } else {
+            super_funcs = interfaces().at(iface_idx)->queryFunctions(AbstractMetaClass::NormalFunctions);
+        }
+
+        QSet<AbstractMetaFunction *> funcs_to_add;
+        for (int sfi=0; sfi<super_funcs.size(); ++sfi) {
+            AbstractMetaFunction *sf = super_funcs.at(sfi);
+
+            if (sf->isRemovedFromAllLanguages(sf->implementingClass()))
+                continue;
+
+            // we generally don't care about private functions, but we have to get the ones that are
+            // virtual in case they override abstract functions.
+            bool add = (sf->isNormal() || sf->isSignal() || sf->isEmptyFunction());
+            for (int fi=0; fi<funcs.size(); ++fi) {
+                AbstractMetaFunction *f = funcs.at(fi);
+                if (f->isRemovedFromAllLanguages(f->implementingClass()))
+                    continue;
+
+                uint cmp = f->compareTo(sf);
+
+                if (cmp & AbstractMetaFunction::EqualModifiedName) {
+//                     printf("   - %s::%s similar to %s::%s %x vs %x\n",
+//                            qPrintable(sf->implementingClass()->typeEntry()->qualifiedCppName()),
+//                            qPrintable(sf->name()),
+//                            qPrintable(f->implementingClass()->typeEntry()->qualifiedCppName()),
+//                            qPrintable(f->name()),
+//                            sf->attributes(),
+//                            f->attributes());
+
+                    add = false;
+                    if (cmp & AbstractMetaFunction::EqualArguments) {
+
+//                         if (!(cmp & AbstractMetaFunction::EqualReturnType)) {
+//                             ReportHandler::warning(QString("%1::%2 and %3::%4 differ in retur type")
+//                                                    .arg(sf->implementingClass()->name())
+//                                                    .arg(sf->name())
+//                                                    .arg(f->implementingClass()->name())
+//                                                    .arg(f->name()));
+//                         }
+
+                        // Same function, propegate virtual...
+                        if (!(cmp & AbstractMetaFunction::EqualAttributes)) {
+                            if (!f->isEmptyFunction()) {
+                                if (!sf->isFinalInCpp() && f->isFinalInCpp()) {
+                                    *f -= AbstractMetaAttributes::FinalInCpp;
+    //                                 printf("   --- inherit virtual\n");
+                                }
+                                if (!sf->isFinalInTargetLang() && f->isFinalInTargetLang()) {
+                                    *f -= AbstractMetaAttributes::FinalInTargetLang;
+    //                                 printf("   --- inherit virtual\n");
+                                }
+                                if (!f->isFinalInTargetLang() && f->isPrivate()) {
+                                    f->setFunctionType(AbstractMetaFunction::EmptyFunction);
+                                    f->setVisibility(AbstractMetaAttributes::Protected);
+                                    *f += AbstractMetaAttributes::FinalInTargetLang;
+                                    ReportHandler::warning(QString("private virtual function '%1' in '%2'")
+                                        .arg(f->signature())
+                                        .arg(f->implementingClass()->name()));
+                                }
+                            }
+                        }
+
+                        if (f->visibility() != sf->visibility()) {
+                            QString warn = QString("visibility of function '%1' modified in class '%2'")
+                                .arg(f->name()).arg(name());
+                            ReportHandler::warning(warn);
+
+                            // If new visibility is private, we can't
+                            // do anything. If it isn't, then we
+                            // prefer the parent class's visibility
+                            // setting for the function.
+                            if (!f->isPrivate() && !sf->isPrivate())
+                                f->setVisibility(sf->visibility());
+
+                            // Private overrides of abstract functions have to go into the class or
+                            // the subclasses will not compile as non-abstract classes.
+                            // But they don't need to be implemented, since they can never be called.
+                            if (f->isPrivate() && sf->isAbstract()) {
+                                f->setFunctionType(AbstractMetaFunction::EmptyFunction);
+                                f->setVisibility(sf->visibility());
+                                *f += AbstractMetaAttributes::FinalInTargetLang;
+                                *f += AbstractMetaAttributes::FinalInCpp;
+                            }
+                        }
+
+                        // Set the class which first declares this function, afawk
+                        f->setDeclaringClass(sf->declaringClass());
+
+                        if (sf->isFinalInTargetLang() && !sf->isPrivate() && !f->isPrivate() && !sf->isStatic() && !f->isStatic()) {
+                            // Shadowed funcion, need to make base class
+                            // function non-virtual
+                            if (f->implementingClass() != sf->implementingClass() && f->implementingClass()->inheritsFrom(sf->implementingClass())) {
+
+                                // Check whether the superclass method has been redefined to non-final
+
+                                bool hasNonFinalModifier = false;
+                                bool isBaseImplPrivate = false;
+                                FunctionModificationList mods = sf->modifications(sf->implementingClass());
+                                foreach (FunctionModification mod, mods) {
+                                    if (mod.isNonFinal()) {
+                                        hasNonFinalModifier = true;
+                                        break;
+                                    } else if (mod.isPrivate()) {
+                                        isBaseImplPrivate = true;
+                                        break;
+                                    }
+                                }
+
+                                if (!hasNonFinalModifier && !isBaseImplPrivate) {
+                                    ReportHandler::warning(QString::fromLatin1("Shadowing: %1::%2 and %3::%4; Java code will not compile")
+                                                        .arg(sf->implementingClass()->name())
+                                                        .arg(sf->signature())
+                                                        .arg(f->implementingClass()->name())
+                                                        .arg(f->signature()));
+                                }
+                            }
+                        }
+
+                    }
+
+                    if (cmp & AbstractMetaFunction::EqualDefaultValueOverload) {
+                        AbstractMetaArgumentList arguments;
+                        if (f->arguments().size() < sf->arguments().size())
+                            arguments = sf->arguments();
+                        else
+                            arguments = f->arguments();
+/* qtd
+                        for (int i=0; i<arguments.size(); ++i)
+                            arguments[i]->setDefaultValueExpression(QString());
+*/                    }
+
+
+                    // Otherwise we have function shadowing and we can
+                    // skip the thing...
+                } else if (cmp & AbstractMetaFunction::EqualName && !sf->isSignal()) {
+
+                    // In the case of function shadowing where the function name has been altered to
+                    // avoid conflict, we don't copy in the original.
+                    add = false;
+                }
+
+            }
+
+            if (add)
+                funcs_to_add << sf;
+        }
+
+        foreach (AbstractMetaFunction *f, funcs_to_add)
+            funcs << f->copy();
+
+        if (super_class)
+            super_class = super_class->baseClass();
+        else
+            iface_idx++;
+    }
+
+    bool hasPrivateConstructors = false;
+    bool hasPublicConstructors = false;
+    foreach (AbstractMetaFunction *func, funcs) {
+        FunctionModificationList mods = func->modifications(this);
+        foreach (const FunctionModification &mod, mods) {
+            if (mod.isRenameModifier()) {
+//                 qDebug() << name() << func->originalName() << func << " from "
+//                          << func->implementingClass()->name() << "renamed to" << mod.renamedTo();
+                func->setName(mod.renamedTo());
+            }
+        }
+
+        // Make sure class is abstract if one of the functions is
+        if (func->isAbstract()) {
+            (*this) += AbstractMetaAttributes::Abstract;
+            (*this) -= AbstractMetaAttributes::Final;
+        }
+
+        if (func->isConstructor()) {
+            if (func->isPrivate())
+                hasPrivateConstructors = true;
+            else
+                hasPublicConstructors = true;
+        }
+
+
+
+        // Make sure that we include files for all classes that are in use
+
+        if (!func->isRemovedFrom(this, TypeSystem::ShellCode))
+            add_extra_includes_for_function(this, func);
+    }
+
+    if (hasPrivateConstructors && !hasPublicConstructors) {
+        (*this) += AbstractMetaAttributes::Abstract;
+        (*this) -= AbstractMetaAttributes::Final;
+    }
+
+    foreach (AbstractMetaFunction *f1, funcs) {
+        foreach (AbstractMetaFunction *f2, funcs) {
+            if (f1 != f2) {
+                uint cmp = f1->compareTo(f2);
+                if ((cmp & AbstractMetaFunction::EqualName)
+                    && !f1->isFinalInCpp()
+                    && f2->isFinalInCpp()) {
+                    *f2 += AbstractMetaAttributes::FinalOverload;
+//                     qDebug() << f2 << f2->implementingClass()->name() << "::" << f2->name() << f2->arguments().size() << " vs " << f1 << f1->implementingClass()->name() << "::" << f1->name() << f1->arguments().size();
+//                     qDebug() << "    " << f2;
+//                     AbstractMetaArgumentList f2Args = f2->arguments();
+//                     foreach (AbstractMetaArgument *a, f2Args)
+//                         qDebug() << "        " << a->type()->name() << a->name();
+//                     qDebug() << "    " << f1;
+//                     AbstractMetaArgumentList f1Args = f1->arguments();
+//                     foreach (AbstractMetaArgument *a, f1Args)
+//                         qDebug() << "        " << a->type()->name() << a->name();
+
+                }
+            }
+        }
+    }
+
+    setFunctions(funcs);
+}
+
+
+QString AbstractMetaType::minimalSignature() const
+{
+    QString minimalSignature;
+    if (isConstant())
+        minimalSignature += "const ";
+    minimalSignature += typeEntry()->qualifiedCppName();
+    if (hasInstantiations()) {
+        QList<AbstractMetaType *> instantiations = this->instantiations();
+        minimalSignature += "<";
+        for (int i=0;i<instantiations.size();++i) {
+            if (i > 0)
+                minimalSignature += ",";
+            minimalSignature += instantiations.at(i)->minimalSignature();
+        }
+        minimalSignature += ">";
+    }
+
+    if (isReference())
+        minimalSignature += "&";
+    for (int j=0; j<indirections(); ++j)
+        minimalSignature += "*";
+
+    return minimalSignature;
+}
+
+bool AbstractMetaType::hasNativeId() const
+{
+    return (isQObject() || isValue() || isObject()) && typeEntry()->isNativeIdBased();
+}
+
+
+/*******************************************************************************
+ * Other stuff...
+ */
+
+
+AbstractMetaEnum *AbstractMetaClassList::findEnum(const EnumTypeEntry *entry) const
+{
+    Q_ASSERT(entry->isEnum());
+
+    QString qualified_name = entry->qualifiedCppName();
+    int pos = qualified_name.lastIndexOf("::");
+
+    QString enum_name;
+    QString class_name;
+
+    if (pos > 0) {
+        enum_name = qualified_name.mid(pos + 2);
+        class_name = qualified_name.mid(0, pos);
+    } else {
+        enum_name = qualified_name;
+        class_name = TypeDatabase::globalNamespaceClassName(entry);
+    }
+
+    AbstractMetaClass *meta_class = findClass(class_name);
+    if (!meta_class) {
+        ReportHandler::warning(QString("AbstractMeta::findEnum(), unknown class '%1' in '%2'")
+                               .arg(class_name).arg(entry->qualifiedCppName()));
+        return 0;
+    }
+
+    return meta_class->findEnum(enum_name);
+}
+
+AbstractMetaEnumValue *AbstractMetaEnumValueList::find(const QString &name) const
+{
+    for (int i=0; i<size(); ++i) {
+        if (name == at(i)->name())
+            return at(i);
+    }
+    return 0;
+}
+
+AbstractMetaEnumValue *AbstractMetaClassList::findEnumValue(const QString &name) const
+{
+    QStringList lst = name.split(QLatin1String("::"));
+
+    Q_ASSERT_X(lst.size() == 2, "AbstractMetaClassList::findEnumValue()", "Expected qualified enum");
+
+
+    QString prefixName = lst.at(0);
+    QString enumName = lst.at(1);
+
+    AbstractMetaClass *cl = findClass(prefixName);
+    if (cl)
+        return cl->findEnumValue(enumName, 0);
+
+    ReportHandler::warning(QString("no matching enum '%1'").arg(name));
+    return 0;
+}
+
+/*!
+ * Searches the list after a class that mathces \a name; either as
+ * C++, Java base name or complete Java package.class name.
+ */
+
+AbstractMetaClass *AbstractMetaClassList::findClass(const QString &name) const
+{
+    if (name.isEmpty())
+        return 0;
+
+    foreach (AbstractMetaClass *c, *this) {
+        if (c->qualifiedCppName() == name)
+            return c;
+    }
+
+    foreach (AbstractMetaClass *c, *this) {
+        if (c->fullName() == name)
+            return c;
+    }
+
+    foreach (AbstractMetaClass *c, *this) {
+        if (c->name() == name)
+            return c;
+    }
+
+    return 0;
+}
+
+ArgumentReplace *ArgumentReplace::m_instance = 0;
+
+ArgumentReplace::ArgumentReplace()
+{
+}
+
+void ArgumentReplace::init()
+{
+    if (m_instance)
+        return;
+
+    m_instance = new ArgumentReplace();
+    m_instance->data["version"] = "_version";
+    m_instance->data["parent"] = "_parent";
+    m_instance->data["delegate"] = "_delegate";
+    m_instance->data["align"] = "_align";
+    m_instance->data["in"] = "_in";
+    m_instance->data["out"] = "_out";
+    m_instance->data["scope"] = "_scope";
+    m_instance->data["default"] = "_default";
+}
+
+QString ArgumentReplace::translate(QString arg)
+{
+    if (m_instance->data.contains(arg))
+        return m_instance->data[arg];
+    else
+        return arg;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/abstractmetalang.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,968 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#ifndef ABSTRACTMETALANG_H
+#define ABSTRACTMETALANG_H
+
+#include "codemodel.h"
+
+#include "typesystem.h"
+
+#include <QHash>
+#include <QSet>
+#include <QStringList>
+#include <QTextStream>
+
+
+class AbstractMeta;
+class AbstractMetaClass;
+class AbstractMetaField;
+class AbstractMetaFunction;
+class AbstractMetaType;
+class AbstractMetaVariable;
+class AbstractMetaArgument;
+class AbstractMetaEnumValue;
+class AbstractMetaEnum;
+class QPropertySpec;
+
+typedef QList<AbstractMetaField *> AbstractMetaFieldList;
+typedef QList<AbstractMetaArgument *> AbstractMetaArgumentList;
+typedef QList<AbstractMetaFunction *> AbstractMetaFunctionList;
+class AbstractMetaClassList : public  QList<AbstractMetaClass *>
+{
+public:
+    AbstractMetaClass *findClass(const QString &name) const;
+    AbstractMetaEnumValue *findEnumValue(const QString &string) const;
+    AbstractMetaEnum *findEnum(const EnumTypeEntry *entry) const;
+
+};
+
+
+
+class AbstractMetaAttributes
+{
+public:
+    AbstractMetaAttributes() : m_attributes(0) { };
+
+    enum Attribute {
+        None                        = 0x00000000,
+
+        Private                     = 0x00000001,
+        Protected                   = 0x00000002,
+        Public                      = 0x00000004,
+        Friendly                    = 0x00000008,
+        Visibility                  = 0x0000000f,
+
+        Native                      = 0x00000010,
+        Abstract                    = 0x00000020,
+        Static                      = 0x00000040,
+
+        FinalInTargetLang           = 0x00000080,
+        FinalInCpp                  = 0x00000100,
+        ForceShellImplementation    = 0x00000200,
+
+        GetterFunction              = 0x00000400,
+        SetterFunction              = 0x00000800,
+
+        FinalOverload               = 0x00001000,
+        InterfaceFunction           = 0x00002000,
+
+        PropertyReader              = 0x00004000,
+        PropertyWriter              = 0x00008000,
+        PropertyResetter            = 0x00010000,
+
+        Fake                        = 0x00020000,
+
+        Invokable                   = 0x00040000,
+
+        Final                       = FinalInTargetLang | FinalInCpp
+    };
+
+    uint attributes() const { return m_attributes; }
+    void setAttributes(uint attributes) { m_attributes = attributes; }
+
+    uint originalAttributes() const { return m_originalAttributes; }
+    void setOriginalAttributes(uint attributes) { m_originalAttributes = attributes; }
+
+    uint visibility() const { return m_attributes & Visibility; }
+    void setVisibility(uint visi) { m_attributes = (m_attributes & ~Visibility) | visi; }
+
+    void operator+=(Attribute attribute) { m_attributes |= attribute; }
+    void operator-=(Attribute attribute) { m_attributes &= ~attribute; }
+
+    bool isNative() const { return m_attributes & Native; }
+    bool isFinal() const { return (m_attributes & Final) == Final; }
+    bool isFinalInTargetLang() const { return m_attributes & FinalInTargetLang; }
+    bool isFinalInCpp() const { return m_attributes & FinalInCpp; }
+    bool isAbstract() const { return m_attributes & Abstract; }
+    bool isStatic() const { return m_attributes & Static; }
+    bool isForcedShellImplementation() const { return m_attributes & ForceShellImplementation; }
+    bool isInterfaceFunction() const { return m_attributes & InterfaceFunction; }
+    bool isFinalOverload() const { return m_attributes & FinalOverload; }
+    bool isInvokable() const { return m_attributes & Invokable; }
+
+    bool isPropertyReader() const { return m_attributes & PropertyReader; }
+    bool isPropertyWriter() const { return m_attributes & PropertyWriter; }
+    bool isPropertyResetter() const { return m_attributes & PropertyResetter; }
+
+    bool isPrivate() const { return m_attributes & Private; }
+    bool isProtected() const { return m_attributes & Protected; }
+    bool isPublic() const { return m_attributes & Public; }
+    bool isFriendly() const { return m_attributes & Friendly; }
+
+    bool wasPrivate() const { return m_originalAttributes & Private; }
+    bool wasProtected() const { return m_originalAttributes & Protected; }
+    bool wasPublic() const { return m_originalAttributes & Public; }
+    bool wasFriendly() const { return m_originalAttributes & Friendly; }
+
+private:
+    uint m_attributes;
+    uint m_originalAttributes;
+};
+
+
+class AbstractMetaType
+{
+public:
+    enum TypeUsagePattern {
+        InvalidPattern,
+        PrimitivePattern,
+        FlagsPattern,
+        EnumPattern,
+        ValuePattern,
+        StringPattern,
+        CharPattern,
+        ObjectPattern,
+        QObjectPattern,
+        NativePointerPattern,
+        ContainerPattern,
+        VariantPattern,
+        JObjectWrapperPattern,
+        ArrayPattern,
+        ThreadPattern
+    };
+
+    AbstractMetaType() :
+        m_type_entry(0),
+        m_array_element_count(0),
+        m_array_element_type(0),
+        m_original_template_type(0),
+        m_pattern(InvalidPattern),
+        m_constant(false),
+        m_reference(false),
+        m_cpp_instantiation(true),
+        m_indirections(0),
+        m_reserved(0)
+    {
+    }
+
+    QString package() const { return m_type_entry->javaPackage(); }
+    QString name() const { return m_type_entry->targetLangName(); }
+    QString fullName() const { return m_type_entry->qualifiedTargetLangName(); }
+
+    void setTypeUsagePattern(TypeUsagePattern pattern) { m_pattern = pattern; }
+    TypeUsagePattern typeUsagePattern() const { return m_pattern; }
+
+    // true when use pattern is container
+    bool hasInstantiations() const { return !m_instantiations.isEmpty(); }
+    void addInstantiation(AbstractMetaType *inst) { m_instantiations << inst; }
+    void setInstantiations(const QList<AbstractMetaType *> &insts) { m_instantiations = insts; }
+    QList<AbstractMetaType *> instantiations() const { return m_instantiations; }
+    void setInstantiationInCpp(bool incpp) { m_cpp_instantiation = incpp; }
+    bool hasInstantiationInCpp() const { return hasInstantiations() && m_cpp_instantiation; }
+
+    QString minimalSignature() const;
+
+    // true when the type is a QtJambiObject subclass
+    bool hasNativeId() const;
+
+    // returns true if the typs is used as a non complex primitive, no & or *'s
+    bool isPrimitive() const { return m_pattern == PrimitivePattern; }
+
+    // returns true if the type is used as an enum
+    bool isEnum() const { return m_pattern == EnumPattern; }
+
+    // returns true if the type is used as a QObject *
+    bool isQObject() const { return m_pattern == QObjectPattern; }
+
+    // returns true if the type is used as an object, e.g. Xxx *
+    bool isObject() const { return m_pattern == ObjectPattern; }
+
+    // returns true if the type is used as an array, e.g. Xxx[42]
+    bool isArray() const { return m_pattern == ArrayPattern; }
+
+    // returns true if the type is used as a value type (X or const X &)
+    bool isValue() const { return m_pattern == ValuePattern; }
+
+    // returns true for more complex types...
+    bool isNativePointer() const { return m_pattern == NativePointerPattern; }
+
+    // returns true if the type was originally a QString or const QString & or equivalent for QLatin1String
+    bool isTargetLangString() const { return m_pattern == StringPattern; }
+
+    // returns true if the type was originally a QChar or const QChar &
+    bool isTargetLangChar() const { return m_pattern == CharPattern; }
+
+    // return true if the type was originally a QVariant or const QVariant &
+    bool isVariant() const { return m_pattern == VariantPattern; }
+
+    // return true if the type was originally a JObjectWrapper or const JObjectWrapper &
+    bool isJObjectWrapper() const { return m_pattern == JObjectWrapperPattern; }
+
+    // returns true if the type was used as a container
+    bool isContainer() const { return m_pattern == ContainerPattern; }
+
+    // returns true if the type was used as a flag
+    bool isFlags() const { return m_pattern == FlagsPattern; }
+
+    // returns true if the type was used as a thread
+    bool isThread() const { return m_pattern == ThreadPattern; }
+
+    bool isConstant() const { return m_constant; }
+    void setConstant(bool constant) { m_constant = constant; }
+
+    bool isReference() const { return m_reference; }
+    void setReference(bool ref) { m_reference = ref; }
+
+    // Returns true if the type is to be implemented using Java enums, e.g. not plain ints.
+    bool isTargetLangEnum() const { return isEnum() && !((EnumTypeEntry *) typeEntry())->forceInteger(); }
+    bool isIntegerEnum() const { return isEnum() && !isTargetLangEnum(); }
+
+    // Returns true if the type is to be implemented using Java QFlags, e.g. not plain ints.
+    bool isTargetLangFlags() const {
+        return isFlags() && !((FlagsTypeEntry *) typeEntry())->forceInteger(); }
+    bool isIntegerFlags() const { return isFlags() && !isTargetLangFlags(); }
+
+    int actualIndirections() const { return m_indirections + (isReference() ? 1 : 0); }
+    int indirections() const { return m_indirections; }
+    void setIndirections(int indirections) { m_indirections = indirections; }
+
+    void setArrayElementCount(int n) { m_array_element_count = n; }
+    int arrayElementCount() const { return m_array_element_count; }
+
+    AbstractMetaType *arrayElementType() const { return m_array_element_type; }
+    void setArrayElementType(AbstractMetaType *t) { m_array_element_type = t; }
+
+    QString cppSignature() const;
+
+    AbstractMetaType *copy() const;
+
+    const TypeEntry *typeEntry() const { return m_type_entry; }
+    void setTypeEntry(const TypeEntry *type) { m_type_entry = type; }
+
+    void setOriginalTypeDescription(const QString &otd) { m_original_type_description = otd; }
+    QString originalTypeDescription() const { return m_original_type_description; }
+
+    void setOriginalTemplateType(const AbstractMetaType *type) { m_original_template_type = type; }
+    const AbstractMetaType *originalTemplateType() const { return m_original_template_type; }
+
+private:
+    const TypeEntry *m_type_entry;
+    QList <AbstractMetaType *> m_instantiations;
+    QString m_package;
+    QString m_original_type_description;
+
+    int m_array_element_count;
+    AbstractMetaType *m_array_element_type;
+    const AbstractMetaType *m_original_template_type;
+
+    TypeUsagePattern m_pattern;
+    uint m_constant : 1;
+    uint m_reference : 1;
+    uint m_cpp_instantiation : 1;
+    int m_indirections : 4;
+    uint m_reserved : 25; // unused
+};
+
+class AbstractMetaVariable
+{
+public:
+    AbstractMetaVariable() : m_type(0) { }
+
+    AbstractMetaType *type() const { return m_type; }
+    void setType(AbstractMetaType *type) { m_type = type; }
+
+    QString name() const { return m_name; }
+    void setName(const QString &name) { m_name = name; }
+
+private:
+    QString m_name;
+    AbstractMetaType *m_type;
+};
+
+
+
+class AbstractMetaArgument : public AbstractMetaVariable
+{
+public:
+    AbstractMetaArgument() : m_argument_index(0) { };
+
+    QString defaultValueExpression() const { return m_expression; }
+    void setDefaultValueExpression(const QString &expr) { m_expression = expr; }
+
+    QString originalDefaultValueExpression() const { return m_original_expression; }
+    void setOriginalDefaultValueExpression(const QString &expr) { m_original_expression = expr; }
+
+    QString toString() const { return type()->name() + " " + AbstractMetaVariable::name() +
+                                           (m_expression.isEmpty() ? "" :  " = " + m_expression); }
+
+    int argumentIndex() const { return m_argument_index; }
+    void setArgumentIndex(int argIndex) { m_argument_index = argIndex; }
+
+    QString argumentName() const;
+    QString indexedName() const;
+
+    AbstractMetaArgument *copy() const;
+
+private:
+    // Just to force people to call argumentName() And indexedName();
+    QString name() const;
+
+    QString m_expression;
+    QString m_original_expression;
+    int m_argument_index;
+};
+
+
+class AbstractMetaField : public AbstractMetaVariable, public AbstractMetaAttributes
+{
+public:
+    AbstractMetaField();
+    ~AbstractMetaField();
+
+    const AbstractMetaClass *enclosingClass() const { return m_class; }
+    void setEnclosingClass(const AbstractMetaClass *cls) { m_class = cls; }
+
+    const AbstractMetaFunction *getter() const;
+    const AbstractMetaFunction *setter() const;
+
+    FieldModificationList modifications() const;
+
+    AbstractMetaField *copy() const;
+
+private:
+    mutable AbstractMetaFunction *m_getter;
+    mutable AbstractMetaFunction *m_setter;
+    const AbstractMetaClass *m_class;
+};
+
+
+class AbstractMetaFunction : public AbstractMetaAttributes
+{
+public:
+    enum FunctionType {
+        ConstructorFunction,
+        DestructorFunction,
+        NormalFunction,
+        SignalFunction,
+        EmptyFunction,
+        SlotFunction,
+        GlobalScopeFunction
+    };
+
+    enum CompareResult {
+        EqualName                   = 0x00000001,
+        EqualArguments              = 0x00000002,
+        EqualAttributes             = 0x00000004,
+        EqualImplementor            = 0x00000008,
+        EqualReturnType             = 0x00000010,
+        EqualDefaultValueOverload   = 0x00000020,
+        EqualModifiedName           = 0x00000040,
+
+        NameLessThan                = 0x00001000,
+
+        PrettySimilar               = EqualName | EqualArguments,
+        Equal                       = 0x0000001f,
+        NotEqual                    = 0x00001000
+    };
+
+    AbstractMetaFunction()
+        : m_function_type(NormalFunction),
+          m_type(0),
+          m_class(0),
+          m_implementing_class(0),
+          m_declaring_class(0),
+          m_interface_class(0),
+          m_property_spec(0),
+          m_constant(false),
+          m_invalid(false),
+          m_jumptable_id(-1),
+          // qtd
+          m_store_result(0)
+    {
+    }
+
+    ~AbstractMetaFunction();
+
+    QString name() const { return m_name; }
+    void setName(const QString &name) { m_name = name; }
+
+    QString originalName() const { return m_original_name.isEmpty() ? name() : m_original_name; }
+    void setOriginalName(const QString &name) { m_original_name = name; }
+
+    QString modifiedName() const;
+
+    QString minimalSignature() const;
+    QStringList possibleIntrospectionCompatibleSignatures() const;
+
+    QString marshalledName(bool classIsOwner = true) const;
+
+    // true if one or more of the arguments are of QtJambiObject subclasses
+    bool argumentsHaveNativeId() const
+    {
+        foreach (const AbstractMetaArgument *arg, m_arguments) {
+            if (arg->type()->hasNativeId())
+                return true;
+        }
+
+        return false;
+    }
+
+    bool isModifiedRemoved(int types = TypeSystem::All) const;
+
+    AbstractMetaType *type() const { return m_type; }
+    void setType(AbstractMetaType *type) { m_type = type; }
+
+    // The class that has this function as a member.
+    const AbstractMetaClass *ownerClass() const { return m_class; }
+    void setOwnerClass(const AbstractMetaClass *cls) { m_class = cls; }
+
+    // The first class in a hierarchy that declares the function
+    const AbstractMetaClass *declaringClass() const { return m_declaring_class; }
+    void setDeclaringClass(const AbstractMetaClass *cls) { m_declaring_class = cls; }
+
+    // The class that actually implements this function
+    const AbstractMetaClass *implementingClass() const { return m_implementing_class; }
+    void setImplementingClass(const AbstractMetaClass *cls) { m_implementing_class = cls; }
+
+    bool needsCallThrough() const;
+
+    AbstractMetaArgumentList arguments() const { return m_arguments; }
+    void setArguments(const AbstractMetaArgumentList &arguments) { m_arguments = arguments; }
+    void addArgument(AbstractMetaArgument *argument) { m_arguments << argument; }
+    int actualMinimumArgumentCount() const;
+
+    void setInvalid(bool on) { m_invalid = on; }
+    bool isInvalid() const { return m_invalid; }
+    bool isDeprecated() const;
+    bool isDestructor() const { return functionType() == DestructorFunction; }
+    bool isConstructor() const { return functionType() == ConstructorFunction; }
+    bool isNormal() const { return functionType() == NormalFunction || isSlot() || isInGlobalScope(); }
+    bool isInGlobalScope() const { return functionType() == GlobalScopeFunction; }
+    bool isSignal() const { return functionType() == SignalFunction; }
+    bool isSlot() const { return functionType() == SlotFunction; }
+    bool isEmptyFunction() const { return functionType() == EmptyFunction; }
+    FunctionType functionType() const { return m_function_type; }
+    void setFunctionType(FunctionType type) { m_function_type = type; }
+
+    QStringList introspectionCompatibleSignatures(const QStringList &resolvedArguments = QStringList()) const;
+    QString signature() const;
+    QString targetLangSignature(bool minimal = false) const;
+    bool shouldReturnThisObject() const { return QLatin1String("this") == argumentReplaced(0); }
+
+    bool isConstant() const { return m_constant; }
+    void setConstant(bool constant) { m_constant = constant; }
+
+    QString toString() const { return m_name; }
+
+    uint compareTo(const AbstractMetaFunction *other) const;
+
+    bool operator <(const AbstractMetaFunction &a) const;
+
+    AbstractMetaFunction *copy() const;
+
+    QString replacedDefaultExpression(const AbstractMetaClass *cls, int idx) const;
+    bool removedDefaultExpression(const AbstractMetaClass *cls, int idx) const;
+    QString conversionRule(TypeSystem::Language language, int idx) const;
+    QList<ReferenceCount> referenceCounts(const AbstractMetaClass *cls, int idx = -2) const;
+
+    bool nullPointersDisabled(const AbstractMetaClass *cls = 0, int argument_idx = 0) const;
+    QString nullPointerDefaultValue(const AbstractMetaClass *cls = 0, int argument_idx = 0) const;
+
+    bool resetObjectAfterUse(int argument_idx) const;
+
+    // Returns whether garbage collection is disabled for the argument in any context
+    bool disabledGarbageCollection(const AbstractMetaClass *cls, int key) const;
+
+    // Returns the ownership rules for the given argument in the given context
+    TypeSystem::Ownership ownership(const AbstractMetaClass *cls, TypeSystem::Language language, int idx) const;
+
+    bool isVirtualSlot() const;
+
+    QString typeReplaced(int argument_index) const;
+    bool isRemovedFromAllLanguages(const AbstractMetaClass *) const;
+    bool isRemovedFrom(const AbstractMetaClass *, TypeSystem::Language language) const;
+    bool argumentRemoved(int) const;
+
+    QString argumentReplaced(int key) const;
+    bool needsSuppressUncheckedWarning() const;
+
+    bool hasModifications(const AbstractMetaClass *implementor) const;
+    FunctionModificationList modifications(const AbstractMetaClass *implementor) const;
+
+    // If this function stems from an interface, this returns the
+    // interface that declares it.
+    const AbstractMetaClass *interfaceClass() const { return m_interface_class; }
+    void setInterfaceClass(const AbstractMetaClass *cl) { m_interface_class = cl; }
+
+    void setPropertySpec(QPropertySpec *spec) { m_property_spec = spec; }
+    QPropertySpec *propertySpec() const { return m_property_spec; }
+
+    int jumpTableId() const { return m_jumptable_id; }
+    void setJumpTableId(int id) { m_jumptable_id = id; }
+
+    // qtd
+    bool storeResult() const;
+    void checkStoreResult();
+
+private:
+    int m_store_result;
+
+private:
+    QString m_name;
+    QString m_original_name;
+    mutable QString m_cached_minimal_signature;
+    mutable QString m_cached_modified_name;
+
+    FunctionType m_function_type;
+    AbstractMetaType *m_type;
+    const AbstractMetaClass *m_class;
+    const AbstractMetaClass *m_implementing_class;
+    const AbstractMetaClass *m_declaring_class;
+    const AbstractMetaClass *m_interface_class;
+    QPropertySpec *m_property_spec;
+    AbstractMetaArgumentList m_arguments;
+    uint m_constant                 : 1;
+    uint m_invalid                  : 1;
+    int m_jumptable_id;
+};
+
+
+class AbstractMetaEnumValue
+{
+public:
+    AbstractMetaEnumValue()
+        : m_value_set(false), m_value(0)
+    {
+    }
+
+    int value() const { return m_value; }
+    void setValue(int value) { m_value_set = true; m_value = value; }
+
+    QString stringValue() const { return m_string_value; }
+    void setStringValue(const QString &v) { m_string_value = v; }
+
+    QString name() const { return m_name; }
+    void setName(const QString &name) { m_name = name; }
+
+    bool isValueSet() const { return m_value_set; }
+
+private:
+    QString m_name;
+    QString m_string_value;
+
+    bool m_value_set;
+    int m_value;
+};
+
+
+class AbstractMetaEnumValueList : public QList<AbstractMetaEnumValue *>
+{
+public:
+    AbstractMetaEnumValue *find(const QString &name) const;
+};
+
+class AbstractMetaEnum : public AbstractMetaAttributes
+{
+public:
+    AbstractMetaEnum() : m_type_entry(0), m_class(0), m_has_qenums_declaration(false) {}
+
+    AbstractMetaEnumValueList values() const { return m_enum_values; }
+    void addEnumValue(AbstractMetaEnumValue *enumValue) { m_enum_values << enumValue; }
+
+    QString name() const { return m_type_entry->targetLangName(); }
+    QString qualifier() const { return m_type_entry->javaQualifier(); }
+    QString package() const { return m_type_entry->javaPackage(); }
+    QString fullName() const { return package() + "." + qualifier()  + "." + name(); }
+
+    // Has the enum been declared inside a Q_ENUMS() macro in its enclosing class?
+    void setHasQEnumsDeclaration(bool on) { m_has_qenums_declaration = on; }
+    bool hasQEnumsDeclaration() const { return m_has_qenums_declaration; }
+
+    EnumTypeEntry *typeEntry() const { return m_type_entry; }
+    void setTypeEntry(EnumTypeEntry *entry) { m_type_entry = entry; }
+
+    AbstractMetaClass *enclosingClass() const { return m_class; }
+    void setEnclosingClass(AbstractMetaClass *c) { m_class = c; }
+
+private:
+    AbstractMetaEnumValueList m_enum_values;
+    EnumTypeEntry *m_type_entry;
+    AbstractMetaClass *m_class;
+
+    uint m_has_qenums_declaration : 1;
+    uint m_reserved : 31;
+};
+
+typedef QList<AbstractMetaEnum *> AbstractMetaEnumList;
+
+class AbstractMetaClass : public AbstractMetaAttributes
+{
+public:
+    enum FunctionQueryOption {
+        Constructors            = 0x000001,   // Only constructors
+        //Destructors             = 0x000002,   // Only destructors. Not included in class.
+        VirtualFunctions        = 0x000004,   // Only virtual functions (virtual in both TargetLang and C++)
+        FinalInTargetLangFunctions    = 0x000008,   // Only functions that are non-virtual in TargetLang
+        FinalInCppFunctions     = 0x000010,   // Only functions that are non-virtual in C++
+        ClassImplements         = 0x000020,   // Only functions implemented by the current class
+        Inconsistent            = 0x000040,   // Only inconsistent functions (inconsistent virtualness in TargetLang/C++)
+        StaticFunctions         = 0x000080,   // Only static functions
+        Signals                 = 0x000100,   // Only signals
+        NormalFunctions         = 0x000200,   // Only functions that aren't signals
+        Visible                 = 0x000400,   // Only public and protected functions
+        ForcedShellFunctions    = 0x000800,   // Only functions that are overridden to be implemented in the shell class
+        WasPublic               = 0x001000,   // Only functions that were originally public
+        WasProtected            = 0x002000,   // Only functions that were originally protected
+        NonStaticFunctions      = 0x004000,   // No static functions
+        Empty                   = 0x008000,   // Empty overrides of abstract functions
+        Invisible               = 0x010000,   // Only private functions
+        VirtualInCppFunctions   = 0x020000,   // Only functions that are virtual in C++
+        NonEmptyFunctions       = 0x040000,   // Only functions with JNI implementations
+        VirtualInTargetLangFunctions  = 0x080000,   // Only functions which are virtual in TargetLang
+        AbstractFunctions       = 0x100000,   // Only abstract functions
+        WasVisible              = 0x200000,   // Only functions that were public or protected in the original code
+        NotRemovedFromTargetLang      = 0x400000,   // Only functions that have not been removed from TargetLang
+        NotRemovedFromShell     = 0x800000,    // Only functions that have not been removed from the shell class
+        VirtualSlots           = 0x1000000     // Only functions that are set as virtual slots in the type system
+    };
+
+    AbstractMetaClass()
+        : m_namespace(false),
+          m_qobject(false),
+          m_has_virtuals(false),
+          m_has_nonpublic(false),
+          m_has_virtual_slots(false),
+          m_has_nonprivateconstructor(false),
+          m_functions_fixed(false),
+          m_has_public_destructor(true),
+          m_force_shell_class(false),
+          m_has_hash_function(false),
+          m_has_equals_operator(false),
+          m_has_clone_operator(false),
+          m_is_type_alias(false),
+          m_enclosing_class(0),
+          m_base_class(0),
+          m_template_base_class(0),
+          m_extracted_interface(0),
+          m_primary_interface_implementor(0),
+          m_type_entry(0),
+          m_qDebug_stream_function(0)
+    {
+    }
+
+    virtual ~AbstractMetaClass();
+
+    AbstractMetaClass *extractInterface();
+    void fixFunctions();
+
+    AbstractMetaFunctionList functions() const { return m_functions; }
+    void setFunctions(const AbstractMetaFunctionList &functions);
+    void addFunction(AbstractMetaFunction *function);
+    bool hasFunction(const AbstractMetaFunction *f) const;
+    bool hasFunction(const QString &str) const;
+    bool hasSignal(const AbstractMetaFunction *f) const;
+
+    bool hasConstructors() const;
+
+    void addDefaultConstructor();
+
+    bool hasNonPrivateConstructor() const { return m_has_nonprivateconstructor; }
+    void setHasNonPrivateConstructor(bool on) { m_has_nonprivateconstructor = on; }
+    bool hasPublicDestructor() const { return m_has_public_destructor; }
+    void setHasPublicDestructor(bool on) { m_has_public_destructor = on; }
+
+    AbstractMetaFunctionList queryFunctionsByName(const QString &name) const;
+    AbstractMetaFunctionList queryFunctions(uint query) const;
+    inline AbstractMetaFunctionList allVirtualFunctions() const;
+    inline AbstractMetaFunctionList allFinalFunctions() const;
+    AbstractMetaFunctionList functionsInTargetLang() const;
+    AbstractMetaFunctionList functionsInShellClass() const;
+    inline AbstractMetaFunctionList cppInconsistentFunctions() const;
+    inline AbstractMetaFunctionList cppSignalFunctions() const;
+    AbstractMetaFunctionList publicOverrideFunctions() const;
+    AbstractMetaFunctionList virtualOverrideFunctions() const;
+    AbstractMetaFunctionList virtualFunctions() const;
+    AbstractMetaFunctionList nonVirtualShellFunctions() const;
+
+    AbstractMetaFieldList fields() const { return m_fields; }
+    void setFields(const AbstractMetaFieldList &fields) { m_fields = fields; }
+    void addField(AbstractMetaField *field) { m_fields << field; }
+
+    AbstractMetaEnumList enums() const { return m_enums; }
+    void setEnums(const AbstractMetaEnumList &enums) { m_enums = enums; }
+    void addEnum(AbstractMetaEnum *e) { m_enums << e; }
+
+    AbstractMetaEnum *findEnum(const QString &enumName);
+    AbstractMetaEnum *findEnumForValue(const QString &enumName);
+    AbstractMetaEnumValue *findEnumValue(const QString &enumName, AbstractMetaEnum *meta_enum);
+
+    AbstractMetaClassList interfaces() const { return m_interfaces; }
+    void addInterface(AbstractMetaClass *interface);
+    void setInterfaces(const AbstractMetaClassList &interface);
+
+    QString fullName() const { return package() + "." + name(); }
+    QString name() const;
+
+    QString baseClassName() const { return m_base_class ? m_base_class->name() : QString(); }
+
+    AbstractMetaClass *baseClass() const { return m_base_class; }
+    void setBaseClass(AbstractMetaClass *base_class) { m_base_class = base_class; }
+
+    const AbstractMetaClass *enclosingClass() const { return m_enclosing_class; }
+    void setEnclosingClass(AbstractMetaClass *cl) { m_enclosing_class = cl; }
+
+    QString package() const { return m_type_entry->javaPackage(); }
+    bool isInterface() const { return m_type_entry->isInterface(); }
+    bool isNamespace() const { return m_type_entry->isNamespace(); }
+    bool isQObject() const { return m_type_entry->isQObject(); }
+    bool isQtNamespace() const { return isNamespace() && name() == "Qt"; }
+    QString qualifiedCppName() const { return m_type_entry->qualifiedCppName(); }
+
+    bool hasInconsistentFunctions() const;
+    bool hasSignals() const;
+    bool inheritsFrom(const AbstractMetaClass *other) const;
+
+    void setForceShellClass(bool on) { m_force_shell_class = on; }
+    bool generateShellClass() const;
+
+    bool hasVirtualSlots() const { return m_has_virtual_slots; }
+    bool hasVirtualFunctions() const { return !isFinal() && m_has_virtuals; }
+    bool hasProtectedFunctions() const;
+
+    QList<TypeEntry *> templateArguments() const { return m_template_args; }
+    void setTemplateArguments(const QList<TypeEntry *> &args) { m_template_args = args; }
+
+    bool hasFieldAccessors() const;
+
+    // only valid during metajavabuilder's run
+    QStringList baseClassNames() const { return m_base_class_names; }
+    void setBaseClassNames(const QStringList &names) { m_base_class_names = names; }
+
+    AbstractMetaClass *primaryInterfaceImplementor() const { return m_primary_interface_implementor; }
+    void setPrimaryInterfaceImplementor(AbstractMetaClass *cl) { m_primary_interface_implementor = cl; }
+
+    const ComplexTypeEntry *typeEntry() const { return m_type_entry; }
+    ComplexTypeEntry *typeEntry() { return m_type_entry; }
+    void setTypeEntry(ComplexTypeEntry *type) { m_type_entry = type; }
+
+    void setHasHashFunction(bool on) { m_has_hash_function = on; }
+    bool hasHashFunction() const { return m_has_hash_function; }
+
+    void setToStringCapability(FunctionModelItem fun) { m_qDebug_stream_function= fun; }
+    FunctionModelItem hasToStringCapability() const { return m_qDebug_stream_function; }
+
+    virtual bool hasDefaultToStringFunction() const;
+
+    void setHasEqualsOperator(bool on) { m_has_equals_operator = on; }
+    bool hasEqualsOperator() const { return m_has_equals_operator; }
+
+    void setHasCloneOperator(bool on) { m_has_clone_operator = on; }
+    bool hasCloneOperator() const { return m_has_clone_operator; }
+
+    void addPropertySpec(QPropertySpec *spec) { m_property_specs << spec; }
+    QList<QPropertySpec *> propertySpecs() const { return m_property_specs; }
+
+    QPropertySpec *propertySpecForRead(const QString &name) const;
+    QPropertySpec *propertySpecForWrite(const QString &name) const;
+    QPropertySpec *propertySpecForReset(const QString &name) const;
+
+    QList<ReferenceCount> referenceCounts() const;
+
+    void setEqualsFunctions(const AbstractMetaFunctionList &lst) { m_equals_functions = lst; }
+    AbstractMetaFunctionList equalsFunctions() const { return m_equals_functions; }
+
+    void setNotEqualsFunctions(const AbstractMetaFunctionList &lst) { m_nequals_functions = lst; }
+    AbstractMetaFunctionList notEqualsFunctions() const { return m_nequals_functions; }
+
+    void setLessThanFunctions(const AbstractMetaFunctionList &lst) { m_less_than_functions = lst; }
+    AbstractMetaFunctionList lessThanFunctions() const { return m_less_than_functions; }
+
+    void setGreaterThanFunctions(const AbstractMetaFunctionList &lst) { m_greater_than_functions = lst; }
+    AbstractMetaFunctionList greaterThanFunctions() const { return m_greater_than_functions; }
+
+    void setLessThanEqFunctions(const AbstractMetaFunctionList &lst) { m_less_than_eq_functions = lst; }
+    AbstractMetaFunctionList lessThanEqFunctions() const { return m_less_than_eq_functions; }
+
+    void setGreaterThanEqFunctions(const AbstractMetaFunctionList &lst) { m_greater_than_eq_functions = lst; }
+    AbstractMetaFunctionList greaterThanEqFunctions() const { return m_greater_than_eq_functions; }
+
+    void sortFunctions();
+
+    const AbstractMetaClass *templateBaseClass() const { return m_template_base_class; }
+    void setTemplateBaseClass(const AbstractMetaClass *cls) { m_template_base_class = cls; }
+
+    void setTypeAlias(bool typeAlias) { m_is_type_alias = typeAlias; }
+    bool isTypeAlias() const { return m_is_type_alias; }
+
+private:
+    uint m_namespace : 1;
+    uint m_qobject : 1;
+    uint m_has_virtuals : 1;
+    uint m_has_nonpublic : 1;
+    uint m_has_virtual_slots : 1;
+    uint m_has_nonprivateconstructor : 1;
+    uint m_functions_fixed : 1;
+    uint m_has_public_destructor : 1;
+    uint m_force_shell_class : 1;
+    uint m_has_hash_function : 1;
+    uint m_has_equals_operator : 1;
+    uint m_has_clone_operator :1;
+    uint m_is_type_alias : 1;
+    uint m_reserved : 19;
+
+    const AbstractMetaClass *m_enclosing_class;
+    AbstractMetaClass *m_base_class;
+    const AbstractMetaClass *m_template_base_class;
+    AbstractMetaFunctionList m_functions;
+    AbstractMetaFieldList m_fields;
+    AbstractMetaEnumList m_enums;
+    AbstractMetaClassList m_interfaces;
+    AbstractMetaClass *m_extracted_interface;
+    AbstractMetaClass *m_primary_interface_implementor;
+    QList<QPropertySpec *> m_property_specs;
+    AbstractMetaFunctionList m_equals_functions;
+    AbstractMetaFunctionList m_nequals_functions;
+
+    AbstractMetaFunctionList m_less_than_functions;
+    AbstractMetaFunctionList m_greater_than_functions;
+    AbstractMetaFunctionList m_less_than_eq_functions;
+    AbstractMetaFunctionList m_greater_than_eq_functions;
+
+    QStringList m_base_class_names;
+    QList<TypeEntry *> m_template_args;
+    ComplexTypeEntry *m_type_entry;
+    FunctionModelItem m_qDebug_stream_function;
+
+    // qtd2 hack
+    friend class DGenerator;
+};
+
+class QPropertySpec {
+public:
+    QPropertySpec(const TypeEntry *type)
+        : m_type(type),
+          m_index(-1)
+    {
+    }
+
+    const TypeEntry *type() const { return m_type; }
+
+    QString name() const { return m_name; }
+    void setName(const QString &name) { m_name = name; }
+
+    QString read() const { return m_read; }
+    void setRead(const QString &read) { m_read = read; }
+
+    QString write() const { return m_write; }
+    void setWrite(const QString &write) { m_write = write; }
+
+    QString designable() const { return m_designable; }
+    void setDesignable(const QString &designable) { m_designable = designable; }
+
+    QString reset() const { return m_reset; }
+    void setReset(const QString &reset) { m_reset = reset; }
+
+    int index() const { return m_index; }
+    void setIndex(int index) { m_index = index; }
+
+private:
+    QString m_name;
+    QString m_read;
+    QString m_write;
+    QString m_designable;
+    QString m_reset;
+    const TypeEntry *m_type;
+    int m_index;
+};
+
+// qtd
+class ArgumentReplace
+{
+private:
+    QHash<QString, QString> data;
+    static ArgumentReplace *m_instance;
+    ArgumentReplace();
+
+public:
+    static void init();
+    static QString translate(QString arg);
+};
+
+inline AbstractMetaFunctionList AbstractMetaClass::allVirtualFunctions() const
+{
+    return queryFunctions(VirtualFunctions
+                          | NotRemovedFromTargetLang);
+}
+
+inline AbstractMetaFunctionList AbstractMetaClass::allFinalFunctions() const
+{
+    return queryFunctions(FinalInTargetLangFunctions
+                          | FinalInCppFunctions
+                          | NotRemovedFromTargetLang);
+}
+
+inline AbstractMetaFunctionList AbstractMetaClass::cppInconsistentFunctions() const
+{
+    return queryFunctions(Inconsistent
+                          | NormalFunctions
+                          | Visible
+                          | NotRemovedFromTargetLang);
+}
+
+inline AbstractMetaFunctionList AbstractMetaClass::cppSignalFunctions() const
+{
+    return queryFunctions(Signals
+                          | Visible
+                          | NotRemovedFromTargetLang);
+}
+
+#endif // ABSTRACTMETALANG_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/asttoxml.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,171 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#include "asttoxml.h"
+#include "control.h"
+#include "parser.h"
+#include "binder.h"
+
+
+#include <QXmlStreamWriter>
+#include <QTextStream>
+#include <QTextCodec>
+#include <QFile>
+
+void astToXML(QString name) {
+    QFile file(name);
+
+    if (!file.open(QFile::ReadOnly))
+        return;
+
+    QTextStream stream(&file);
+    stream.setCodec(QTextCodec::codecForName("UTF-8"));
+    QByteArray contents = stream.readAll().toUtf8();
+    file.close();
+
+    Control control;
+    Parser p(&control);
+    pool __pool;
+
+    TranslationUnitAST *ast = p.parse(contents, contents.size(), &__pool);
+
+    CodeModel model;
+    Binder binder(&model, p.location());
+    FileModelItem dom = binder.run(ast);
+
+    QFile outputFile;
+    if (!outputFile.open(stdout, QIODevice::WriteOnly))
+    {
+        return;
+    }
+
+    QXmlStreamWriter s( &outputFile);
+    s.setAutoFormatting( true );
+
+    s.writeStartElement("code");
+
+    QHash<QString, NamespaceModelItem> namespaceMap = dom->namespaceMap();
+    foreach (NamespaceModelItem item, namespaceMap.values()) {
+        writeOutNamespace(s, item);
+    }
+
+    QHash<QString, ClassModelItem> typeMap = dom->classMap();
+    foreach (ClassModelItem item, typeMap.values()) {
+        writeOutClass(s, item);
+    }
+    s.writeEndElement();
+}
+
+
+void writeOutNamespace(QXmlStreamWriter &s, NamespaceModelItem &item) {
+    s.writeStartElement("namespace");
+    s.writeAttribute("name", item->name());
+
+    QHash<QString, NamespaceModelItem> namespaceMap = item->namespaceMap();
+    foreach (NamespaceModelItem item, namespaceMap.values()) {
+        writeOutNamespace(s, item);
+    }
+
+    QHash<QString, ClassModelItem> typeMap = item->classMap();
+    foreach (ClassModelItem item, typeMap.values()) {
+        writeOutClass(s, item);
+    }
+
+    QHash<QString, EnumModelItem> enumMap = item->enumMap();
+    foreach (EnumModelItem item, enumMap.values()) {
+        writeOutEnum(s, item);
+    }
+
+    s.writeEndElement();
+}
+
+void writeOutEnum(QXmlStreamWriter &s, EnumModelItem &item) {
+    QString qualified_name = item->qualifiedName().join("::");
+    s.writeStartElement("enum");
+    s.writeAttribute("name", qualified_name);
+
+    EnumeratorList enumList = item->enumerators();
+    for(int i=0; i < enumList.size() ; i++) {
+        s.writeStartElement("enumerator");
+        if( !enumList[i]->value().isEmpty() )
+            s.writeAttribute("value", enumList[i]->value());
+        s.writeCharacters(enumList[i]->name());
+
+        s.writeEndElement();
+    }
+    s.writeEndElement();
+}
+
+void writeOutFunction(QXmlStreamWriter &s, FunctionModelItem &item) {
+    QString qualified_name = item->qualifiedName().join("::");
+    s.writeStartElement("function");
+    s.writeAttribute("name", qualified_name);
+
+    ArgumentList arguments = item->arguments();
+    for(int i=0; i < arguments.size() ; i++) {
+        s.writeStartElement("argument");
+        s.writeAttribute("type",  arguments[i]->type().qualifiedName().join("::"));
+        s.writeEndElement();
+    }
+    s.writeEndElement();
+}
+
+void writeOutClass(QXmlStreamWriter &s, ClassModelItem &item) {
+    QString qualified_name = item->qualifiedName().join("::");
+    s.writeStartElement("class");
+    s.writeAttribute("name", qualified_name);
+
+    QHash<QString, EnumModelItem> enumMap = item->enumMap();
+    foreach (EnumModelItem item, enumMap.values()) {
+        writeOutEnum(s, item);
+    }
+
+    QHash<QString, FunctionModelItem> functionMap = item->functionMap();
+    foreach (FunctionModelItem item, functionMap.values()) {
+        writeOutFunction(s, item);
+    }
+
+    QHash<QString, ClassModelItem> typeMap = item->classMap();
+    foreach (ClassModelItem item, typeMap.values()) {
+        writeOutClass(s, item);
+    }
+    s.writeEndElement();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/asttoxml.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+
+#ifndef ASTTOXML
+#define ASTTOXML
+
+#include "codemodel.h"
+
+#include <QString>
+#include <QXmlStreamWriter>
+
+void astToXML(const QString name);
+void writeOutNamespace(QXmlStreamWriter &s, NamespaceModelItem &item);
+void writeOutEnum(QXmlStreamWriter &s, EnumModelItem &item);
+void writeOutFunction(QXmlStreamWriter &s, FunctionModelItem &item);
+void writeOutClass(QXmlStreamWriter &s, ClassModelItem &item);
+
+
+#endif // ASTTOXML
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/build_all.txt	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,13 @@
+<typesystem>
+  <load-typesystem name="typesystem_core.xml" generate="yes" />
+  <load-typesystem name="typesystem_gui.xml" generate="yes" />
+  <load-typesystem name="typesystem_sql.xml" generate="yes" />
+  <load-typesystem name="typesystem_opengl.xml" generate="yes" />
+  <load-typesystem name="typesystem_svg.xml" generate="yes" />
+  <load-typesystem name="typesystem_network.xml" generate="yes" />
+  <load-typesystem name="typesystem_xml.xml" generate="yes" />
+  <load-typesystem name="typesystem_xmlpatterns.xml" generate="yes" />
+  <load-typesystem name="typesystem_webkit.xml" generate="yes" />
+  <load-typesystem name="typesystem_designer.xml" generate="yes" />
+  <load-typesystem name="typesystem_phonon.xml" generate="yes" />
+</typesystem>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/build_core.txt	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,3 @@
+<typesystem>
+  <load-typesystem name="typesystem_core.xml" generate="yes" />
+</typesystem>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/build_designer.bat	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,1 @@
+release\generator ../qtjambi_designer/designer.h typesystem_designer.txt
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/build_gui.txt	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,4 @@
+<typesystem>
+  <load-typesystem name="typesystem_core.xml" generate="yes" />
+  <load-typesystem name="typesystem_gui.xml" generate="yes" />
+</typesystem>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/build_network.txt	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,4 @@
+<typesystem>
+   <load-typesystem name="typesystem_core.xml" generate="no" />
+   <load-typesystem name="typesystem_network.xml" generate="yes" />
+</typesystem>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/build_opengl.txt	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,5 @@
+<typesystem>
+  <load-typesystem name="typesystem_core.xml" generate="yes" />
+  <load-typesystem name="typesystem_gui.xml" generate="yes" />
+  <load-typesystem name="typesystem_opengl.xml" generate="yes" />
+</typesystem>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/build_sql.txt	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,5 @@
+<typesystem>
+  <load-typesystem name="typesystem_core.xml" generate="no" />
+  <load-typesystem name="typesystem_gui.xml" generate="no" />
+  <load-typesystem name="typesystem_sql.xml" generate="yes" />
+</typesystem>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/build_svg.txt	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,7 @@
+<typesystem>
+  <load-typesystem name="typesystem_core.xml" generate="yes" />
+  <load-typesystem name="typesystem_xml.xml" generate="yes" />
+  <load-typesystem name="typesystem_gui.xml" generate="yes" />
+  <load-typesystem name="typesystem_svg.xml" generate="yes" />
+  <load-typesystem name="typesystem_opengl.xml" generate="yes" />
+</typesystem>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/build_typesystem.txt	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,247 @@
+<typesystem package="com.trolltech.tools.generator" default-superclass="qt.QtJambiObject">
+  <load-typesystem name=":/trolltech/generator/typesystem_core.txt" generate="no" />
+
+  <rejection class="QDataStream"/>
+  <rejection class="MetaJavaBuilder" field-name="m_used_types" />
+  <rejection class="MetaJavaBuilder" function-name="figureOutEnumValuesForClass" />
+  <rejection class="JavaGenerator" function-name="retrieveModifications" />
+  <rejection class="JavaGenerator" function-name="setupForFunction" />
+
+  <object-type name="JuicDataGenerator">
+    <include file-name="juicdatagenerator.h" location="local" />
+  </object-type>
+
+  <object-type name="MetaInfoGenerator">
+    <include file-name="metainfogenerator.h" location="local" />
+  </object-type>
+
+  <object-type name="ReportHandler">
+    <include file-name="reporthandler.h" location="local" />
+  </object-type>
+
+  <object-type name="CppGenerator">
+    <include file-name="cppgenerator.h" location="local" />
+  </object-type>
+
+  <object-type name="CppHeaderGenerator">
+    <include file-name="cppheadergenerator.h" location="local" />
+  </object-type>
+
+  <object-type name="CppImplGenerator">
+    <include file-name="cppimplgenerator.h" location="local" />
+  </object-type>
+
+  <object-type name="Generator">
+    <include file-name="generator.h" location="local" />
+  </object-type>
+
+ <object-type name="JavaGenerator">
+    <modify-function signature="translateType(const MetaJavaType *, Generator::Option option)">
+       <replace-default-expression index="2" with="Option.NoOption" />
+    </modify-function>
+    <include file-name="javagenerator.h" location="local" />
+  </object-type>
+
+  <object-type name="MetaJavaArgument">
+    <include file-name="metajava.h" location="local" />
+  </object-type>
+
+  <interface-type name="MetaJavaAttributes"/>
+
+  <object-type name="MetaJavaBuilder">
+    <include file-name="metajavabuilder.h" location="local" />
+  </object-type>
+
+ <object-type name="MetaJavaClass">
+    <include file-name="metajava.h" location="local" />
+    <modify-function signature="package() const">
+        <rename to="packageName" />
+    </modify-function>
+ </object-type>
+
+ <object-type name="MetaJavaEnum">
+    <include file-name="metajava.h" location="local" />
+    <modify-function signature="package() const">
+        <rename to="packageName" />
+    </modify-function>
+ </object-type>
+
+ <object-type name="MetaJavaEnumValue">
+    <include file-name="metajava.h" location="local" />
+ </object-type>
+
+ <object-type name="MetaJavaField">
+    <include file-name="metajava.h" location="local" />
+ </object-type>
+
+ <object-type name="MetaJavaFunction">
+    <include file-name="metajava.h" location="local" />
+ </object-type>
+
+ <object-type name="MetaJavaType">
+    <include file-name="metajava.h" location="local" />
+    <modify-function signature="package() const">
+        <rename to="packageName" />
+    </modify-function>
+ </object-type>
+
+ <object-type name="MetaJavaVariable">
+    <include file-name="metajava.h" location="local" />
+ </object-type>
+
+ <object-type name="Preprocess">
+    <include file-name="main.h" location="local" />
+ </object-type>
+
+ <object-type name="TypeParser">
+    <include file-name="typeparser.h" location="local" />
+ </object-type>
+
+
+  <object-type name="ArrayTypeEntry">
+     <include file-name="typesystem.h" location="local"/>
+  </object-type>
+
+  <object-type name="CharTypeEntry">
+    <include file-name="typesystem.h" location="local"/>
+  </object-type>
+
+  <object-type name="ComplexTypeEntry">
+    <include file-name="typesystem.h" location="local"/>
+  </object-type>
+
+  <object-type name="ContainerTypeEntry">
+    <include file-name="typesystem.h" location="local"/>
+    <modify-function signature="type() const">
+      <rename to="containerType" />
+    </modify-function>
+  </object-type>
+
+  <object-type name="EnumTypeEntry">
+    <include file-name="typesystem.h" location="local"/>
+  </object-type>
+
+  <object-type name="FlagsTypeEntry">
+    <include file-name="typesystem.h" location="local"/>
+  </object-type>
+
+  <object-type name="InterfaceTypeEntry">
+    <include file-name="typesystem.h" location="local"/>
+  </object-type>
+
+  <object-type name="NamespaceTypeEntry">
+    <include file-name="typesystem.h" location="local"/>
+  </object-type>
+
+  <object-type name="ObjectTypeEntry">
+    <include file-name="typesystem.h" location="local"/>
+  </object-type>
+
+  <object-type name="PrimitiveTypeEntry">
+    <include file-name="typesystem.h" location="local"/>
+  </object-type>
+
+  <object-type name="StringTypeEntry">
+    <include file-name="typesystem.h" location="local"/>
+  </object-type>
+
+  <object-type name="TemplateArgumentEntry">
+    <include file-name="typesystem.h" location="local"/>
+  </object-type>
+
+  <object-type name="ThreadTypeEntry">
+    <include file-name="typesystem.h" location="local"/>
+  </object-type>
+
+  <object-type name="TypeEntry">
+    <include file-name="typesystem.h" location="local"/>
+  </object-type>
+
+  <object-type name="ValueTypeEntry">
+    <include file-name="typesystem.h" location="local"/>
+  </object-type>
+
+  <object-type name="VariantTypeEntry">
+    <include file-name="typesystem.h" location="local"/>
+  </object-type>
+
+  <object-type name="VoidTypeEntry">
+    <include file-name="typesystem.h" location="local"/>
+  </object-type>
+
+
+
+  <object-type name="TypeDatabase">
+    <include file-name="typesystem.h" location="local"/>
+  </object-type>
+
+
+
+  <value-type name="CodeSnip">
+    <include file-name="typesystem.h" location="local"/>
+  </value-type>
+
+  <value-type name="CustomFunction">
+    <include file-name="typesystem.h" location="local"/>
+  </value-type>
+
+  <value-type name="FieldModification">
+    <include file-name="typesystem.h" location="local"/>
+  </value-type>
+
+  <value-type name="FunctionModification">
+    <include file-name="typesystem.h" location="local"/>
+  </value-type>
+
+  <value-type name="Include">
+    <include file-name="typesystem.h" location="local"/>
+  </value-type>
+
+  <value-type name="TypeRejection">
+    <include file-name="typesystem.h" location="local"/>
+  </value-type>
+
+  <value-type name="TypeParser::Info">
+    <include file-name="typeparser.h" location="local"/>
+  </value-type>
+
+  <value-type name="MetaJavaClassList">
+    <inject-code class="shell-declaration">
+    QList&lt;MetaJavaClass *&gt; &amp;operator=(const QList&lt;MetaJavaClass *&gt; &amp;other)
+    {
+        return ((QList&lt;MetaJavaClass *&gt; *)this)-&gt;operator=(other);
+    }
+    </inject-code>
+  </value-type>
+  <value-type name="MetaJavaEnumValueList">
+    <inject-code class="shell-declaration">
+    QList&lt;MetaJavaEnumValue *&gt; &amp;operator=(const QList&lt;MetaJavaEnumValue *&gt; &amp;other)
+    {
+        return ((QList&lt;MetaJavaEnumValue *&gt; *)this)-&gt;operator=(other);
+    }
+    </inject-code>
+  </value-type>
+
+  <enum-type name="CodeSnip::Language"/>
+  <enum-type name="CodeSnip::Position"/>
+  <enum-type name="ContainerTypeEntry::Type"/>
+  <enum-type name="FieldModification::Modifiers"/>
+  <enum-type name="FunctionModification::Modifiers"/>
+  <enum-type name="FunctionModification::DisableGarbageCollectionArgument"/>
+  <enum-type name="Include::IncludeType"/>
+  <enum-type name="TypeEntry::CodeGeneration"/>
+  <enum-type name="TypeEntry::Type"/>
+  <enum-type name="MetaJavaAttributes::Attribute"/>
+  <enum-type name="MetaJavaBuilder::RejectReason"/>
+  <enum-type name="MetaJavaClass::FunctionQueryOption"/>
+  <enum-type name="MetaJavaFunction::CompareResult" force-integer="yes">
+      <reject-enum-value name="NotEqual"/>
+  </enum-type>
+  <enum-type name="MetaJavaFunction::FunctionType"/>
+  <enum-type name="MetaJavaFunction::FunctionContext"/>
+  <enum-type name="MetaJavaType::TypeUsagePattern"/>
+  <enum-type name="Generator::Option"/>
+  <enum-type name="ReportHandler::DebugLevel"/>
+
+
+</typesystem>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/build_webkit.txt	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,6 @@
+<typesystem>
+   <load-typesystem name="typesystem_core.xml" generate="no" />
+   <load-typesystem name="typesystem_gui.xml" generate="no" />
+   <load-typesystem name="typesystem_network.xml" generate="no" />
+   <load-typesystem name="typesystem_webkit.xml" generate="yes" />
+</typesystem>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/build_xml.txt	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,4 @@
+<typesystem>
+   <load-typesystem name="typesystem_core.xml" generate="no" />
+   <load-typesystem name="typesystem_xml.xml" generate="yes" />
+</typesystem>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/build_xmlpatterns.txt	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,4 @@
+<typesystem>
+   <load-typesystem name="typesystem_core.xml" generate="no" />
+   <load-typesystem name="typesystem_xmlpatterns.xml" generate="yes" />
+</typesystem>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/classlistgenerator.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,89 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#include "classlistgenerator.h"
+
+QString ClassListGenerator::fileName() const { return "qtjambi-classes.qdoc"; }
+
+static bool class_sorter(AbstractMetaClass *a, AbstractMetaClass *b)
+{
+    return a->name() < b->name();
+}
+
+void ClassListGenerator::generate()
+{
+    QFile f(fileName());
+    if (f.open(QFile::WriteOnly)) {
+        QTextStream s(&f);
+
+        s << "/****************************************************************************" << endl
+          << "**" << endl
+          << "** This is a generated file, please don't touch." << endl
+          << "**" << endl
+          << "****************************************************************************/" << endl << endl;
+
+        s << "/*!" << endl
+          << "\\page qtjambi-classes.html" << endl << endl
+          << "\\title Qt Jambi's classes" << endl << endl
+          << "This is a list of all Qt Jambi classes." << endl << endl
+          << "\\table 100%" << endl;
+
+        AbstractMetaClassList classes = Generator::classes();
+        qSort(classes.begin(), classes.end(), class_sorter);
+
+        int numColumns = 4;
+        int numRows = (classes.size() + numColumns - 1) / numColumns;
+
+        for (int i = 0; i < numRows; ++i) {
+            s << endl << "\\row ";
+            for (int j=0; j<numColumns; ++j) {
+                if (classes.value(i + j * numRows)) {
+                    s << "\\o \\l{" << classes.value(i + j * numRows)->qualifiedCppName()
+                      << "}{" << classes.value(i + j * numRows)->name() << "} ";
+                }
+            }
+
+        }
+
+        s << endl << "\\endtable" << endl
+          << "*/" << endl;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/classlistgenerator.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#ifndef CLASSLISTGENERATOR_H
+#define CLASSLISTGENERATOR_H
+
+#include "generator.h"
+
+#include <QtCore/QString>
+
+class ClassListGenerator: public Generator
+{
+public:
+    virtual void generate();
+
+    QString fileName() const;
+};
+
+#endif // CLASSLISTGENERATOR_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/containergenerator.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,396 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+*
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#include "containergenerator.h"
+#include "cppimplgenerator.h"
+#include "fileout.h"
+
+static Indentor INDENT;
+
+ContainerGenerator::ContainerGenerator():
+        DGenerator()
+
+{
+    setFilenameStub("ArrayOps");
+    excludedTypes.clear();
+
+    // qtd2
+    excludedTypes << "QFuture";
+}
+
+QString ContainerGenerator::subDirectoryForPackage(const QString &package, OutputDirectoryType type) const
+{
+    switch (type) {
+    case CppDirectory:
+        return "cpp/" + QString(package).replace(".", "_") + "/";
+    case DDirectory:
+        return QString(package).replace(".", "/");
+    case HDirectory:
+        return "include/";
+    default:
+        return QString(); // kill nonsense warnings
+    }
+}
+
+void ContainerGenerator::write(QTextStream &, const AbstractMetaClass *)
+{
+    // not used
+}
+
+void ContainerGenerator::addTypeEntry(const TypeEntry* te)
+{
+    if (!excludedTypes.contains(te->name()))
+        containerTypes << te;
+}
+
+void ContainerGenerator::processType(AbstractMetaType *d_type)
+{
+    if (d_type->isContainer()) {
+        QList<AbstractMetaType *> args = d_type->instantiations();
+
+        if (args.size() == 1) // QVector or QList
+            if (args.at(0)->typeEntry()->isComplex()
+                && !args.at(0)->isContainer()
+                && !args.at(0)->isTargetLangString())
+                addTypeEntry(args.at(0)->typeEntry()); // qMakePair(args.at(0)->typeEntry(), m_class);
+    }
+}
+
+void ContainerGenerator::processFunction(const AbstractMetaFunction *d_function)
+{
+    if (notWrappedYet(d_function)) // qtd2
+        return;
+
+    if (d_function->type()) {
+        AbstractMetaType *d_type = d_function->type();
+        if (d_type->isContainer()) {
+            processType(d_type);
+        }
+    }
+
+    AbstractMetaArgumentList arguments = d_function->arguments();
+    for (int i=0; i<arguments.count(); ++i) {
+        const AbstractMetaArgument *arg = arguments.at(i);
+        processType(arg->type());
+    }
+}
+
+void ContainerGenerator::buildTypeList()
+{
+    foreach (AbstractMetaClass *d_class, classes()) {
+m_class = d_class;
+        AbstractMetaFunctionList d_funcs = d_class->functionsInTargetLang();
+        for (int i=0; i<d_funcs.size(); ++i) {
+            AbstractMetaFunction *function = d_funcs.at(i);
+
+            // If a method in an interface class is modified to be private, this should
+            // not be present in the interface at all, only in the implementation.
+            if (d_class->isInterface()) {
+                uint includedAttributes = 0;
+                uint excludedAttributes = 0;
+                retrieveModifications(function, d_class, &excludedAttributes, &includedAttributes);
+                if (includedAttributes & AbstractMetaAttributes::Private)
+                    continue;
+            }
+
+            processFunction(function);
+        }
+        AbstractMetaFieldList fields = d_class->fields();
+        foreach (const AbstractMetaField *field, fields) {
+            if (field->wasPublic() || (field->wasProtected() && !d_class->isFinal())) {
+                processFunction(field->setter());
+                processFunction(field->getter());
+            }
+        }
+
+    }
+}
+
+void ContainerGenerator::generate()
+{
+    buildTypeList();
+
+    writeFile(cppFilename(), CppDirectory, &ContainerGenerator::writeCppContent); // cpp file
+    writeFile("ArrayOps_%1.h", HDirectory, &ContainerGenerator::writeHeaderContent); // header file
+    writeFile(dFilename(), DDirectory, &ContainerGenerator::writeDContent); // d file
+}
+
+void ContainerGenerator::writeFile(const QString& fileName, OutputDirectoryType dirType, WriteOut writeOut)
+{
+    AbstractMetaClassList classList = classes();
+    QHash<QString, FileOut *> fileHash;
+
+    // Seems continue is not supported by our foreach loop, so
+    foreach (AbstractMetaClass *cls, classList) {
+
+        FileOut *f = fileHash.value(cls->package(), 0);
+        if (f == 0) {
+            f = new FileOut(outputDirectory() + "/" + subDirectoryForPackage(cls->package(), dirType) + "/" +
+                    fileName.arg(cls->package().replace(".", "_")));
+            writeNotice(f->stream);
+
+            (this->*writeOut)(f->stream, cls);
+
+            fileHash.insert(cls->package(), f);
+
+//            QString pro_file_name = cls->package().replace(".", "_") + "/" + cls->package().replace(".", "_") + ".pri";
+//            priGenerator->addSource(pro_file_name, cppFilename());
+        }
+    }
+
+    foreach (QString package, fileHash.keys()) {
+        FileOut *f = fileHash.value(package, 0);
+        if (f != 0) {
+            if( f->done() )
+                ++m_num_generated_written;
+            ++m_num_generated;
+
+            delete f;
+        }
+    }
+}
+
+void ContainerGenerator::writeCppContent(QTextStream &s, AbstractMetaClass *cls)
+{
+    QString package = cls->package().replace(".", "_");
+
+    s << "// stuff for passing D function pointers" << endl << endl
+      << "#ifdef CPP_SHARED" << endl << endl
+      << "#include \"ArrayOps_" << package << ".h\"" << endl << endl;
+
+    foreach (const TypeEntry *te, containerTypes) {
+        if (te->javaPackage() == cls->package()) {
+            const ComplexTypeEntry *centry = static_cast<const ComplexTypeEntry *>(te);
+            QString cls_name = centry->name();
+
+            setFuncNames(cls_name);
+            s << "QTD_EXPORT_VAR(" << all_name << ")" << endl
+              << "QTD_EXPORT_VAR(" << ass_name << ")" << endl
+              << "QTD_EXPORT_VAR(" << get_name << ")" << endl << endl;
+        }
+    }
+
+    s << endl
+      << "extern \"C\" DLL_PUBLIC void qtd_" << cls->package().replace(".", "_") << "_ArrayOps_initCallBacks(pfunc_abstr *callbacks)" << endl
+      << "{" << endl;
+
+    int num_funcs = 0;
+    foreach (const TypeEntry *te, containerTypes) {
+        if (te->javaPackage() == cls->package()) {
+            const ComplexTypeEntry *centry = static_cast<const ComplexTypeEntry *>(te);
+            QString cls_name = centry->name();
+
+            setFuncNames(cls_name);
+            s << "    QTD_EXPORT_VAR_SET(" << all_name << ", callbacks[" << num_funcs + 0 << "]);" << endl
+              << "    QTD_EXPORT_VAR_SET(" << ass_name << ", callbacks[" << num_funcs + 1 << "]);" << endl
+              << "    QTD_EXPORT_VAR_SET(" << get_name << ", callbacks[" << num_funcs + 2 << "]);" << endl << endl;
+
+            num_funcs += NUM_ARRAY_FUNCS;
+        }
+    }
+    s << "}" << endl
+      << "#endif" << endl;
+}
+
+void ContainerGenerator::writeHeaderContent(QTextStream &s, AbstractMetaClass *cls)
+{
+    s << "#include <cstring>" << endl
+      << "#include \"qtd_core.h\"" << endl << endl;
+
+    foreach (const TypeEntry *te, containerTypes) {
+        if (te->javaPackage() == cls->package()) {
+            const ComplexTypeEntry *typeEntry = static_cast<const ComplexTypeEntry *>(te);
+            s << "// " << typeEntry->name() << endl; // " in " << it.second->name() << endl;
+
+            Indentation indent(INDENT);
+            writeHeaderArrayFunctions(s, typeEntry);
+        }
+    }
+}
+
+void ContainerGenerator::setFuncNames(const QString& cls_name)
+{
+    all_name = QString("qtd_allocate_%1_array").arg(cls_name);
+    ass_name = QString("qtd_assign_%1_array_element").arg(cls_name);
+    get_name = QString("qtd_get_%1_from_array").arg(cls_name);
+}
+
+void ContainerGenerator::writeHeaderArrayFunctions(QTextStream &s, const ComplexTypeEntry *centry)
+{
+    QString cls_name = centry->name();
+    bool d_export = true;
+    QString d_type, cpp_type, cpp_type_assign;
+
+    if (centry->name() == "QModelIndex") {
+        cpp_type = "QModelIndexAccessor*";
+    } else if (centry->isStructInD()) {
+        cpp_type = centry->qualifiedCppName() + "*";
+    } else if (centry->isObject() || centry->isQObject() || centry->isValue() || centry->isInterface() || centry->isVariant()) {
+        cpp_type = "void*";
+    }
+
+    setFuncNames(cls_name);
+
+    s << "QTD_EXPORT(void, " << all_name << ", (void* arr, size_t len))" << endl
+      << "QTD_EXPORT(void, " << ass_name << ", (void* arr, size_t pos, " << cpp_type << " elem))" << endl
+      << "QTD_EXPORT(void, " << get_name << ", (void* arr, size_t pos, " << cpp_type << " elem))" << endl;
+
+    s << "#ifdef CPP_SHARED" << endl
+      << "#define " << all_name << " qtd_get_" << all_name << "()" << endl
+      << "#define " << ass_name << " qtd_get_" << ass_name << "()" << endl
+      << "#define " << get_name << " qtd_get_" << get_name << "()" << endl
+      << "#endif" << endl;
+
+    s << endl;
+}
+
+void ContainerGenerator::writeDContent(QTextStream &s, AbstractMetaClass *cls)
+{
+    s << "module " << cls->package() << ".ArrayOps;" << endl << endl;
+
+    int num_funcs = 0;
+    foreach (const TypeEntry *te, containerTypes) {
+        if (te->javaPackage() == cls->package()) {
+            const ComplexTypeEntry *typeEntry = static_cast<const ComplexTypeEntry *>(te);
+            s << "// " << typeEntry->name() << endl;
+            writeImportString(s, typeEntry);
+            s << endl;
+
+            Indentation indent(INDENT);
+
+            writeArrayFunctions(s, typeEntry);
+            s << endl;
+            num_funcs += NUM_ARRAY_FUNCS;
+        }
+    }
+    if (num_funcs == 0)
+        return;
+
+    s << "version (Windows) {" << endl
+      << "    private extern (C) void qtd_" << cls->package().replace(".", "_") << "_ArrayOps_initCallBacks(void* callbacks);" << endl << endl
+      << "    static this() {" << endl
+      << "        void*[" << num_funcs << "] callbacks; " << endl << endl;
+
+    num_funcs = 0;
+    foreach (const TypeEntry *te, containerTypes) {
+        if (te->javaPackage() == cls->package()) {
+            const ComplexTypeEntry *centry = static_cast<const ComplexTypeEntry *>(te);
+
+            QString cls_name = centry->name();
+            setFuncNames(cls_name);
+
+            s << "        callbacks[" << num_funcs + 0 << "] = &" << all_name << ";" << endl
+              << "        callbacks[" << num_funcs + 1 << "] = &" << ass_name << ";" << endl
+              << "        callbacks[" << num_funcs + 2 << "] = &" << get_name << ";" << endl;
+
+            s << endl;
+            num_funcs += NUM_ARRAY_FUNCS;
+        }
+    }
+    s << "        qtd_" << cls->package().replace(".", "_") << "_ArrayOps_initCallBacks(callbacks.ptr);" << endl
+      << "    }" << endl
+      << "}" << endl;
+}
+
+void ContainerGenerator::writeNotice(QTextStream &s)
+{
+    s << "/****************************************************************************" << endl
+      << "**" << endl
+      << "** This is a generated file, please don't touch." << endl
+      << "**" << endl
+      << "****************************************************************************/" << endl << endl;
+}
+
+void ContainerGenerator::writeArrayFunctions(QTextStream &s, const ComplexTypeEntry *centry)
+{
+    QString cls_name = centry->name();
+    QString type_name = cls_name;
+
+    bool d_export = true;
+    QString d_type, cpp_type, cpp_assign_type, convert, nativeId;
+
+    convert = "qtd_" + cls_name + "_cpp_to_d(elem)";
+    nativeId = "";
+
+    if (centry->name() == "QModelIndex") {
+        cpp_type = "QModelIndexAccessor*";
+        cpp_assign_type = cpp_type;
+        d_type = cpp_type;
+        convert = "*elem";
+    } else if (centry->isStructInD()) {
+        cpp_type = centry->qualifiedCppName() + "*";
+        cpp_assign_type = cpp_type;
+        d_type = cpp_type;
+        convert = "*elem";
+    } else if (centry->isObject() || centry->isQObject() || centry->isValue() || centry->isInterface() || centry->isVariant()) {
+        cpp_type = "void*";
+        cpp_assign_type = cpp_type + "*";
+        d_type = cls_name;
+        nativeId = ".nativeId";
+    }
+
+    if (centry->designatedInterface()) {
+        type_name = centry->designatedInterface()->name();
+        nativeId = ".__ptr_" + type_name;
+    }
+
+    s << "private extern(C) void qtd_allocate_" << cls_name << "_array(" << type_name << "[]* arr, size_t len)" << endl
+      << "{" << endl
+      << INDENT << "*arr = new " << type_name << "[len];" << endl
+      << "}" << endl << endl;
+
+    s << "private extern(C) void qtd_assign_" << cls_name << "_array_element(" << type_name << "[]* arr, size_t pos, " << cpp_type << " elem)" << endl
+      << "{" << endl
+      << INDENT << "(*arr)[pos] = " << convert << ";" << endl
+      << "}" << endl << endl
+
+      << "private extern(C) void qtd_get_" << cls_name << "_from_array(" << type_name << "* arr, size_t pos, " << cpp_assign_type << " elem)" << endl
+      << "{" << endl
+      << INDENT << "*elem = arr[pos]" << nativeId << ";" << endl
+      << "}" << endl << endl
+
+      << "package " << d_type << " qtd_" << cls_name << "_cpp_to_d(" << cpp_type << " __qt_return_value)" << endl
+      << "{" << endl;
+
+    marshallFromCppToD(s, centry);
+
+    s << "}" << endl;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/containergenerator.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,105 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+*
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#ifndef CONTAINERGENERATOR_H
+#define CONTAINERGENERATOR_H
+
+#include "dgenerator.h"
+#include "metajava.h"
+#include "prigenerator.h"
+
+const int NUM_ARRAY_FUNCS = 3;
+
+class ContainerGenerator : public DGenerator
+{
+    Q_OBJECT
+
+public:
+    enum OutputDirectoryType {
+        CppDirectory,
+        DDirectory,
+        HDirectory
+    };
+
+    typedef void (ContainerGenerator::*WriteOut)(QTextStream &s, AbstractMetaClass *cls);
+
+    ContainerGenerator();
+
+    virtual void generate();
+    virtual void write(QTextStream &s, const AbstractMetaClass *java_class);
+    void writeFile(const QString& fileName, OutputDirectoryType dirType, WriteOut writeOut);
+
+    // base functions for operating with arrays
+    void writeHeaderContent(QTextStream &s, AbstractMetaClass *cls);
+    void writeCppContent(QTextStream &s, AbstractMetaClass *cls);
+    void writeDContent(QTextStream &s, AbstractMetaClass *cls);
+
+    void buildTypeList();
+
+    void processFunction(const AbstractMetaFunction *d_function);
+    void processType(AbstractMetaType *d_type);
+    void addTypeEntry(const TypeEntry* te);
+
+    virtual QString subDirectoryForPackage(const QString &package, OutputDirectoryType type) const;
+
+    void setFilenameStub(const QString &stub) { m_filenameStub = stub; }
+    QString filenameStub() const { return m_filenameStub; }
+
+    QString headerFilename() const { return filenameStub() + ".h"; }
+    QString cppFilename() const { return filenameStub() + "_shell.cpp"; }
+    QString dFilename() const { return filenameStub() + ".d"; }
+
+private:
+    virtual void writeArrayFunctions(QTextStream &s, const ComplexTypeEntry *centry);
+    void writeHeaderArrayFunctions(QTextStream &s, const ComplexTypeEntry *centry);
+    void writeNotice(QTextStream &s);
+
+    void setFuncNames(const QString& cls_name);
+
+    QString m_filenameStub;
+    QSet<const TypeEntry*> containerTypes;
+//    QSet< QPair<const TypeEntry*, AbstractMetaClass*> > containerTypes;
+    AbstractMetaClass* m_class;
+
+    QString all_name, ass_name, get_name;
+};
+
+#endif // CONTAINERGENERATOR_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/cppgenerator.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,252 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#include "cppgenerator.h"
+#include "reporthandler.h"
+
+#include "metajava.h"
+
+// ### There's a bug in Qt causing it to fail at normalizing signatures
+// on the form FooBar<T> const&, which is the form the C++ parser uses
+// for all types, so connections between Java and C++ with const& templates
+// will fail. This is a work around which is only needed until that bug is fixed.
+// Since Qt works correctly with const FooBar<T> &, we simply change the
+// signature to that.
+QString CppGenerator::fixNormalizedSignatureForQt(const QString &signature)
+{
+    QString ret = signature;
+    if (signature.contains("<") && signature.endsWith("const&")) {
+        ret = "const "
+            + signature.mid(0, signature.size() - 6)
+            + "&";
+    }
+    return ret;
+}
+
+void CppGenerator::writeTypeInfo(QTextStream &s, const AbstractMetaType *type, Option options)
+{
+    if ((options & OriginalTypeDescription) && !type->originalTypeDescription().isEmpty()) {
+        QString originalTypeDescription = type->originalTypeDescription();
+
+        if (options & NormalizeAndFixTypeSignature) {
+            originalTypeDescription = QMetaObject::normalizedSignature(originalTypeDescription.toLatin1().constData());
+            originalTypeDescription = fixNormalizedSignatureForQt(originalTypeDescription);
+        }
+
+        s << originalTypeDescription;
+        return;
+    }
+
+    if (type->isArray()) {
+        writeTypeInfo(s, type->arrayElementType(), options);
+        if (options & ArrayAsPointer) {
+            s << "*";
+        } else {
+            s << "[" << type->arrayElementCount() << "]";
+        }
+        return;
+    }
+
+    const TypeEntry *te = type->typeEntry();
+
+    if (type->isConstant() && !(options & ExcludeConst))
+        s << "const ";
+
+    if ((options & EnumAsInts) && (te->isEnum() || te->isFlags())) {
+        s << "int";
+    } else if (te->isFlags()) {
+        s << ((FlagsTypeEntry *) te)->originalName();
+    } else {
+        if (options & VirtualDispatch && te->name() == "QModelIndex")
+            s << "QModelIndexAccessor";
+        else
+            s << fixCppTypeName(te->qualifiedCppName());
+    }
+
+    if (type->instantiations().size() > 0
+        && (!type->isContainer()
+            || (static_cast<const ContainerTypeEntry *>(te))->type() != ContainerTypeEntry::StringListContainer)) {
+        s << '<';
+        QList<AbstractMetaType *> args = type->instantiations();
+        bool nested_template = false;
+        for (int i=0; i<args.size(); ++i) {
+            if (i != 0)
+                s << ", ";
+            nested_template |= args.at(i)->isContainer();
+            writeTypeInfo(s, args.at(i));
+        }
+        if (nested_template)
+            s << ' ';
+        s << '>';
+    }
+
+    int actual_indirections = type->indirections();
+    // for getting C++ elements from array we want pointers even if elements are
+    // values because wrapper actually contains pointers
+    if ((options & ForcePointer) && actual_indirections == 0
+        && !type->isPrimitive() && !type->typeEntry()->isStructInD()
+        && type->name() != "QModelIndex")
+        actual_indirections = 1;
+
+    s << QString(actual_indirections, '*');
+
+    if (type->isReference() && !(options & ExcludeReference))
+        s << "&";
+
+    if (!(options & SkipName))
+        s << ' ';
+}
+
+
+void CppGenerator::writeFunctionArguments(QTextStream &s,
+                                          const AbstractMetaArgumentList &arguments,
+                                          Option option,
+                                          int numArguments)
+{
+    if (numArguments < 0) numArguments = arguments.size();
+
+    for (int i=0; i<numArguments; ++i) {
+        if (i != 0)
+            s << ", ";
+        AbstractMetaArgument *arg = arguments.at(i);
+        writeTypeInfo(s, arg->type(), option);
+        if (!(option & SkipName))
+            s << " " << arg->indexedName();
+        if ((option & IncludeDefaultExpression) && !arg->originalDefaultValueExpression().isEmpty()) {
+            s << " = ";
+
+            QString expr = arg->originalDefaultValueExpression();
+            if (arg->type()->typeEntry()->isEnum() && expr.indexOf("::") < 0)
+                s << ((EnumTypeEntry *)arg->type()->typeEntry())->qualifier() << "::";
+
+            s << expr;
+        }
+    }
+}
+
+/*!
+ * Writes the function \a java_function signature to the textstream \a s.
+ *
+ * The \a name_prefix can be used to give the function name a prefix,
+ * like "__public_" or "__override_" and \a classname_prefix can
+ * be used to give the class name a prefix.
+ *
+ * The \a option flags can be used to tweak various parameters, such as
+ * showing static, original vs renamed name, underscores for space etc.
+ *
+ * The \a extra_arguments list is a list of extra arguments on the
+ * form "bool static_call".
+ */
+
+void CppGenerator::writeFunctionSignature(QTextStream &s,
+                                          const AbstractMetaFunction *java_function,
+                                          const AbstractMetaClass *implementor,
+                                          const QString &name_prefix,
+                                          Option option,
+                                          const QString &classname_prefix,
+                                          const QStringList &extra_arguments,
+                                          int numArguments)
+{
+// ### remove the implementor
+    AbstractMetaType *function_type = java_function->type();
+
+    if (java_function->isStatic() && (option & ShowStatic))
+        s << "static ";
+
+    if ((option & SkipReturnType) == 0) {
+        if (function_type) {
+            writeTypeInfo(s, function_type, option);
+            s << " ";
+        } else if (!java_function->isConstructor()) {
+            s << "void ";
+        }
+    }
+
+    if (implementor) {
+        if (classname_prefix.isEmpty())
+            s << shellClassName(implementor) << "::";
+        else
+            s << classname_prefix << implementor->name() << "::";
+    }
+
+
+    QString function_name;
+    if (option & OriginalName)
+        function_name = java_function->originalName();
+    else
+        function_name = java_function->name();
+
+    if (option & UnderscoreSpaces)
+        function_name = function_name.replace(' ', '_');
+
+    if (java_function->isConstructor())
+        function_name = shellClassName(java_function->ownerClass());
+
+    s << name_prefix << function_name;
+
+    if (java_function->attributes() & AbstractMetaAttributes::SetterFunction)
+        s << "_setter";
+    else if (java_function->attributes() & AbstractMetaAttributes::GetterFunction)
+        s << "_getter";
+
+    s << "(";
+    const AbstractMetaClass *owner = java_function->ownerClass();
+
+    bool has_d_ptr = java_function->isConstructor() && owner && (owner->hasVirtualFunctions()/* || owner->typeEntry()->isObject()*/ );
+    const AbstractMetaArgumentList arg_list = java_function->arguments();
+    if (has_d_ptr) {
+        s << "void *d_ptr";
+        if (arg_list.size() > 0)
+            s << ", ";
+    }
+    writeFunctionArguments(s, arg_list, option, numArguments);
+
+    // The extra arguments...
+    for (int i=0; i<extra_arguments.size(); ++i) {
+        if (i > 0 || java_function->arguments().size() != 0)
+            s << ", ";
+        s << extra_arguments.at(i);
+    }
+
+    s << ")";
+    if (java_function->isConstant())
+        s << " const";
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/cppgenerator.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,96 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#ifndef CPPGENERATOR_H
+#define CPPGENERATOR_H
+
+#include "generator.h"
+#include "metajava.h"
+#include "prigenerator.h"
+
+class CppGenerator : public Generator
+{
+    Q_OBJECT
+
+public:
+    static inline QString subDirectoryForPackage(const QString &package) {
+        return QLatin1String("cpp/") + QString(package).replace(".", "_");
+    }
+
+    virtual QString subDirectoryForClass(const AbstractMetaClass *cls) const
+    {
+        return subDirectoryForPackage(cls->package()) + "/";
+    }
+
+    static QString fixNormalizedSignatureForQt(const QString &signature);
+    static void writeTypeInfo(QTextStream &s, const AbstractMetaType *type, Option option = NoOption);
+    static void writeFunctionSignature(QTextStream &s, const AbstractMetaFunction *java_function,
+                                const AbstractMetaClass *implementor = 0,
+                                const QString &name_prefix = QString(),
+                                Option option = NoOption,
+                                const QString &classname_prefix = QString(),
+                                const QStringList &extra_arguments = QStringList(),
+                                int numArguments = -1);
+    static void writeFunctionArguments(QTextStream &s, const AbstractMetaArgumentList &arguments,
+                                Option option = NoOption,
+                                int numArguments = -1);
+
+    QString signalWrapperPrefix() const { return "__qt_signalwrapper_"; }
+
+    bool shouldGenerate(const AbstractMetaClass *java_class) const {
+        return (!java_class->isNamespace() || java_class->functionsInTargetLang().size() > 0) && !java_class->isInterface()
+            && !java_class->typeEntry()->isVariant()
+            && (java_class->typeEntry()->codeGeneration() & TypeEntry::GenerateCpp)
+            && !(java_class->attributes() & AbstractMetaAttributes::Fake);
+    }
+
+    static QString shellClassName(const AbstractMetaClass *java_class) {
+        return java_class->generateShellClass()
+               ? java_class->name() + "_QtDShell"
+               : java_class->qualifiedCppName();
+    }
+
+ protected:
+    PriGenerator *priGenerator;
+
+};
+
+#endif // CPPGENERATOR_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/cppheadergenerator.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,312 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#include "cppheadergenerator.h"
+
+#include <QtCore/QDir>
+
+#include <qdebug.h>
+
+QString CppHeaderGenerator::fileNameForClass(const AbstractMetaClass *java_class) const
+{
+    return QString("%1_shell.h").arg(java_class->name());
+}
+
+void CppHeaderGenerator::writeFieldAccessors(QTextStream &s, const AbstractMetaField *java_field)
+{
+    Q_ASSERT(java_field->isProtected());
+
+    const AbstractMetaFunction *setter = java_field->setter();
+    const AbstractMetaFunction *getter = java_field->getter();
+
+    // qtd2
+    if(notWrappedYet(getter))
+        return;
+
+    if (getter->isModifiedRemoved(TypeSystem::ShellCode))
+        return;
+
+    s << "    ";
+    writeFunctionSignature(s, getter, 0, QString(), Option(ShowStatic));
+    s << ";" << endl;
+
+    // qtd2
+    if(notWrappedYet(setter))
+        return;
+
+    if (!java_field->type()->isConstant()) {
+        if (setter->isModifiedRemoved(TypeSystem::ShellCode))
+            return;
+
+        s << "    ";
+        writeFunctionSignature(s, setter, 0, QString(), Option(ShowStatic));
+        s << ";" << endl;
+    }
+}
+
+void CppHeaderGenerator::writeSignalWrapper(QTextStream &s, const AbstractMetaFunction *signal)
+{
+    s << "    ";
+    writeFunctionSignature(s, signal, 0, signalWrapperPrefix(),
+                           Option(NormalizeAndFixTypeSignature | OriginalName | OriginalTypeDescription | IncludeDefaultExpression));
+    s << ";" << endl;
+}
+
+void CppHeaderGenerator::writeSignalWrappers(QTextStream &s, const AbstractMetaClass *java_class)
+{
+    AbstractMetaFunctionList signal_funcs = signalFunctions(java_class);
+    if (signal_funcs.size() > 0) {
+        s << endl << "public slots:" << endl;
+        foreach (const AbstractMetaFunction *signal, signal_funcs) {
+            writeSignalWrapper(s, signal);
+        }
+    }
+}
+
+void CppHeaderGenerator::writeWrapperClass(QTextStream &s, const AbstractMetaClass *java_class)
+{
+    AbstractMetaFunctionList signal_functions =
+        java_class->queryFunctions(AbstractMetaClass::Signals | AbstractMetaClass::Visible | AbstractMetaClass::NotRemovedFromTargetLang);
+    if (signal_functions.size() == 0)
+        return ;
+
+    s << "class QtJambi_SignalWrapper_" << java_class->name() << ": public QObject" << endl
+      << "{" << endl
+      << "  Q_OBJECT" << endl;
+    writeSignalWrappers(s, java_class);
+    s << endl << "public:" << endl
+      << "    QtJambiSignalInfo m_signals[" << signal_functions.size() << "];" << endl
+      << "    QtJambiLink *link;" << endl
+      << "};" << endl << endl;
+}
+
+void CppHeaderGenerator::write(QTextStream &s, const AbstractMetaClass *java_class)
+{
+    QString include_block = java_class->name().toUpper() + "_SHELL_H";
+
+    s << "#ifndef " << include_block << endl
+      << "#define " << include_block << endl << endl
+//      << "#include <qtjambi_core.h>" << endl
+      << "#include <QtCore/QHash>" << endl
+      << "#include <QObjectEntity.h>" << endl;
+
+    Include inc = java_class->typeEntry()->include();
+    s << "#include ";
+    if (inc.type == Include::IncludePath)
+        s << "<";
+    else
+        s << "\"";
+    s << inc.name;
+    if (inc.type == Include::IncludePath)
+        s << ">";
+    else
+        s << "\"";
+    s << endl << endl;
+
+    IncludeList list = java_class->typeEntry()->extraIncludes();
+    qSort(list.begin(), list.end());
+    foreach (const Include &inc, list) {
+        if (inc.type == Include::TargetLangImport)
+            continue;
+
+        s << "#include ";
+        if (inc.type == Include::LocalPath)
+            s << "\"";
+        else
+            s << "<";
+
+        s << inc.name;
+
+        if (inc.type == Include::LocalPath)
+            s << "\"";
+        else
+            s << ">";
+
+        s << endl;
+    }
+
+/* qtd    writeForwardDeclareSection(s, java_class);
+
+    writeWrapperClass(s, java_class);
+*/
+    s << endl;
+    QString pro_file_name = java_class->package().replace(".", "_") + "/" + java_class->package().replace(".", "_") + ".pri";
+
+    if (!java_class->generateShellClass()) {
+        s << "#endif" << endl << endl;
+        priGenerator->addHeader(pro_file_name, fileNameForClass(java_class));
+        return ;
+    }
+
+    s << "class " << shellClassName(java_class)
+      << " : public " << java_class->qualifiedCppName();
+    if (java_class->hasVirtualFunctions())
+        s << ", public Qtd_QObjectEntity";
+    s << endl  << "{" << endl;
+
+    if (java_class->isQObject()) {
+      s << "public:" << endl
+        << "  Q_OBJECT_CHECK" << endl;
+//        << "  mutable const QMetaObject *m_meta_object;" << endl;
+
+/*      if (java_class->hasVirtualSlots()) {
+          s << "  mutable QHash<int,int> m_map;" << endl;
+      }
+*/
+      s // << "  const QMetaObject *metaObject() const;" << endl
+//        << "  void *qt_metacast(const char *);" << endl
+//        << "  QT_TR_FUNCTIONS" << endl
+        << "  virtual int qt_metacall(QMetaObject::Call, int, void **);" << endl
+        << "private:" << endl;
+    }
+
+
+    s << "public:" << endl;
+    // constructor
+    foreach (const AbstractMetaFunction *function, java_class->functions()) {
+        if (function->isConstructor() && !function->isPrivate())
+            writeFunction(s, function);
+    }
+
+    s << "    ~" << shellClassName(java_class) << "();" << endl;
+    s << endl;
+
+    // All functions in original class that should be reimplemented in shell class
+    AbstractMetaFunctionList shell_functions = java_class->functionsInShellClass();
+    foreach (const AbstractMetaFunction *function, shell_functions) {
+        if(notWrappedYet(function))
+            continue;
+        writeFunction(s, function);
+    }
+
+    // Public call throughs for protected functions
+    AbstractMetaFunctionList public_overrides = java_class->publicOverrideFunctions();
+    foreach (const AbstractMetaFunction *function, public_overrides) {
+        if(notWrappedYet(function))
+            continue;
+        writePublicFunctionOverride(s, function);
+    }
+
+    // Override all virtual functions to get the decision on static/virtual call
+    AbstractMetaFunctionList virtual_functions = java_class->virtualOverrideFunctions();
+    foreach (const AbstractMetaFunction *function, virtual_functions) {
+        if(notWrappedYet(function))
+            continue;
+
+        writeVirtualFunctionOverride(s, function);
+    }
+
+    // Field accessors
+    foreach (const AbstractMetaField *field, java_class->fields()) {
+        if (field->isProtected())
+            writeFieldAccessors(s, field);
+    }
+/* qtd
+    writeVariablesSection(s, java_class);
+*/
+    writeInjectedCode(s, java_class);
+
+    s  << "};" << endl << endl
+       << "#endif // " << include_block << endl;
+
+    priGenerator->addHeader(pro_file_name, fileNameForClass(java_class));
+}
+
+
+/*!
+    Writes out declarations of virtual C++ functions so that they
+    can be reimplemented from the java side.
+*/
+void CppHeaderGenerator::writeFunction(QTextStream &s, const AbstractMetaFunction *java_function)
+{
+    if (java_function->isModifiedRemoved(TypeSystem::ShellCode))
+        return;
+
+    s << "    ";
+    writeFunctionSignature(s, java_function, 0, QString(), Option(OriginalName | ShowStatic));
+    s << ";" << endl;
+}
+
+void CppHeaderGenerator::writePublicFunctionOverride(QTextStream &s,
+                                                     const AbstractMetaFunction *java_function)
+{
+    s << "    ";
+    writeFunctionSignature(s, java_function, 0, "__public_", Option(EnumAsInts | ShowStatic | UnderscoreSpaces));
+    s << ";" << endl;
+}
+
+
+void CppHeaderGenerator::writeVirtualFunctionOverride(QTextStream &s,
+                                                      const AbstractMetaFunction *java_function)
+{
+    if (java_function->isModifiedRemoved(TypeSystem::NativeCode))
+        return;
+
+    s << "    ";
+    writeFunctionSignature(s, java_function, 0, "__override_", Option(EnumAsInts | ShowStatic | UnderscoreSpaces), QString());
+    s << ";" << endl;
+}
+
+
+void CppHeaderGenerator::writeForwardDeclareSection(QTextStream &s, const AbstractMetaClass *)
+{
+    s << endl
+      << "class QtJambiFunctionTable;" << endl
+      << "class QtJambiLink;" << endl;
+}
+
+
+void CppHeaderGenerator::writeVariablesSection(QTextStream &s, const AbstractMetaClass *)
+{
+    s << endl
+      << "    QtJambiFunctionTable *m_vtable;" << endl
+      << "    QtJambiLink *m_link;" << endl;
+}
+
+void CppHeaderGenerator::writeInjectedCode(QTextStream &s, const AbstractMetaClass *java_class)
+{
+    CodeSnipList code_snips = java_class->typeEntry()->codeSnips();
+    foreach (const CodeSnip &cs, code_snips) {
+        if (cs.language == TypeSystem::ShellDeclaration) {
+            s << cs.code() << endl;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/cppheadergenerator.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#ifndef CPP_HEADER_GENERATOR
+#define CPP_HEADER_GENERATOR
+
+#include "cppgenerator.h"
+#include "metajava.h"
+
+class CppHeaderGenerator : public CppGenerator
+{
+    Q_OBJECT
+
+public:
+    CppHeaderGenerator(PriGenerator *pri)
+    {
+        priGenerator = pri;
+    }
+
+    virtual QString fileNameForClass(const AbstractMetaClass *cls) const;
+
+    void write(QTextStream &s, const AbstractMetaClass *java_class);
+    void writeFunction(QTextStream &s, const AbstractMetaFunction *java_function);
+    void writePublicFunctionOverride(QTextStream &s, const AbstractMetaFunction *java_function);
+    void writeVirtualFunctionOverride(QTextStream &s, const AbstractMetaFunction *java_function);
+    void writeForwardDeclareSection(QTextStream &s, const AbstractMetaClass *java_class);
+    void writeVariablesSection(QTextStream &s, const AbstractMetaClass *java_class);
+    void writeFieldAccessors(QTextStream &s, const AbstractMetaField *java_field);
+    void writeSignalWrapper(QTextStream &s, const AbstractMetaFunction *java_function);
+    void writeSignalWrappers(QTextStream &s, const AbstractMetaClass *java_class);
+    void writeWrapperClass(QTextStream &s, const AbstractMetaClass *java_class);
+    void writeInjectedCode(QTextStream &s, const AbstractMetaClass *java_class);
+
+    bool shouldGenerate(const AbstractMetaClass *java_class) const {
+        return (java_class->generateShellClass()
+                && CppGenerator::shouldGenerate(java_class))
+            || (java_class->queryFunctions(AbstractMetaClass::Signals).size() > 0
+                && (java_class->typeEntry()->codeGeneration() & TypeEntry::GenerateCpp));
+    }
+};
+
+#endif // CPP_HEADER_GENERATOR
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/cppimplgenerator.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,3719 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+*
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#include "cppimplgenerator.h"
+#include "dgenerator.h"
+#include "reporthandler.h"
+#include <qnativepointer.h>
+
+#include <QDir>
+#include <QtDebug>
+#include <QVariant>
+#include <iostream>
+#define VOID_POINTER_ORDINAL 8
+
+static Indentor INDENT;
+
+QString jni_signature(const AbstractMetaFunction *function, JNISignatureFormat format)
+{
+    QString returned = "(";
+    AbstractMetaArgumentList arguments = function->arguments();
+    foreach (const AbstractMetaArgument *argument, arguments) {
+        if (!function->argumentRemoved(argument->argumentIndex() + 1)) {
+            QString modified_type = function->typeReplaced(argument->argumentIndex()+1);
+
+            if (modified_type.isEmpty())
+                returned += jni_signature(argument->type(), format);
+            else
+                returned += jni_signature(modified_type, format);
+        }
+    }
+
+    returned += ")";
+
+    QString modified_type = function->typeReplaced(0);
+    if (modified_type.isEmpty())
+        returned += jni_signature(function->type(), format);
+    else
+        returned += jni_signature(modified_type, format);
+
+    return returned;
+}
+
+QString jni_signature(const QString &_full_name, JNISignatureFormat format)
+{
+    QString signature;
+    QString full_name = _full_name;
+
+    if (full_name.endsWith("[]")) {
+        full_name.chop(2);
+        signature = "[";
+    }
+
+    int start = 0, end = -1;
+    while ( (start = full_name.indexOf("<")) >= 0 && (end = full_name.indexOf(">")) >= 0 ) {
+        full_name.remove(start, end - start + 1);
+    }
+
+    static QHash<QString, QString> table;
+    if (table.isEmpty()) {
+        table["boolean"] = "Z";
+        table["byte"] = "B";
+        table["char"] = "C";
+        table["short"] = "S";
+        table["int"] = "I";
+        table["long"] = "J";
+        table["float"] = "F";
+        table["double"] = "D";
+    }
+
+    if (format == Underscores)
+        signature.replace("[", "_3");
+
+    if (table.contains(full_name)) {
+        signature += table[full_name];
+    } else if (format == Underscores) {
+        signature.replace("[", "_3");
+        signature += "L";
+        signature += QString(full_name).replace("_", "_1").replace('.', '_').replace("$", "_00024");
+        signature += "_2";
+    } else {
+        signature += "L";
+        signature += QString(full_name).replace('.', '/');
+        signature += ";";
+    }
+
+    return signature;
+}
+
+QString jni_signature(const AbstractMetaType *java_type, JNISignatureFormat format)
+{
+    if (!java_type)
+        return "V";
+
+    if (java_type->isArray()) {
+        return "_3" + jni_signature(java_type->arrayElementType(), format);
+    } else if (java_type->isNativePointer()) {
+        if (format == Underscores)
+            return "Lcom_trolltech_qt_QNativePointer_2";
+        else
+            return "Lcom/trolltech/qt/QNativePointer;";
+    } else if (java_type->isIntegerEnum() || java_type->isIntegerFlags()
+               || (format == Underscores && (java_type->isEnum() || java_type->isFlags()))) {
+        return "I";
+    } else if (java_type->isThread()) {
+        if (format == Underscores)
+            return "Ljava_lang_Thread_2";
+        else
+            return "Ljava/lang/Thread;";
+    }
+
+
+
+    QString name = java_type->name();
+    if (java_type->isObject()) {
+        if (const InterfaceTypeEntry *ie
+            = static_cast<const ObjectTypeEntry *>(java_type->typeEntry())->designatedInterface())
+            name = ie->targetLangName();
+    } else if (java_type->isTargetLangEnum()) {
+        const EnumTypeEntry *et = static_cast<const EnumTypeEntry *>(java_type->typeEntry());
+        name = et->javaQualifier() + "$" + et->targetLangName();
+
+    } else if (java_type->isTargetLangFlags()) {
+        const FlagsTypeEntry *ft = static_cast<const FlagsTypeEntry *>(java_type->typeEntry());
+        name = ft->originator()->javaQualifier() + "$" + ft->targetLangName();
+    }
+
+    return jni_signature( (java_type->package().isEmpty() ? QString() : java_type->package() + ".") + name, format);
+}
+
+static QHash<QString, QString> table;
+QString default_return_statement_qt(const AbstractMetaType *java_type, Generator::Option options = Generator::NoOption)
+{
+    QString returnStr = ((options & Generator::NoReturnStatement) == 0 ? "return" : "");
+    if (!java_type)
+        return returnStr;
+
+    if (table.isEmpty()) {
+        table["bool"] = "false";
+        table["byte"] = "0";
+        table["char"] = "0";
+        table["short"] = "0";
+        table["int"] = "0";
+        table["long"] = "0";
+        table["float"] = "0f";
+        table["double"] = "0.0";
+        table["java.lang.Object"] = "0";
+    }
+
+    QString signature = table.value(java_type->typeEntry()->targetLangName());
+
+    if (!signature.isEmpty())
+        return returnStr + " " + signature;
+
+    Q_ASSERT(!java_type->isPrimitive());
+    if (java_type->isJObjectWrapper())
+        return returnStr + " JObjectWrapper()";
+    if (java_type->isVariant())
+        return returnStr + " QVariant()";
+    if (java_type->isTargetLangString())
+        return returnStr + " QString()";
+    if (java_type->isTargetLangChar())
+        return returnStr + " QChar()";
+    else if (java_type->isEnum())
+        return returnStr + " " + java_type->typeEntry()->name() + "(0)";
+    else if (java_type->isContainer() && ((ContainerTypeEntry *)java_type->typeEntry())->type() == ContainerTypeEntry::StringListContainer)
+        return returnStr + " " + java_type->typeEntry()->name() + "()";
+    else if (java_type->isValue() || java_type->isContainer())
+        return returnStr + " " + java_type->cppSignature() + "()";
+    else
+        return returnStr + " 0";
+}
+
+QString default_return_statement_java(const AbstractMetaType *java_type)
+{
+    if (!java_type)
+        return "return";
+    if (java_type->isArray())
+        return "return null";
+
+    if (table.isEmpty()) {
+        table["boolean"] = "false";
+        table["byte"] = "0";
+        table["char"] = "0";
+        table["short"] = "0";
+        table["int"] = "0";
+        table["long"] = "0";
+        table["float"] = "0f";
+        table["double"] = "0.0";
+        table["java.lang.Object"] = "0";
+    }
+
+    QString signature = table.value(java_type->typeEntry()->targetLangName());
+    if (!signature.isEmpty())
+        return "return " + signature;
+
+    Q_ASSERT(!java_type->isPrimitive());
+    return "return 0";
+}
+
+/* Used to decide how which of the Call[Xxx]Method functions to call
+ */
+QByteArray jniTypeName(const QString &name) {
+    static QHash<QString, const char *> table;
+    if (table.isEmpty()) {
+        table["jboolean"] = "Boolean";
+        table["jbyte"] = "Byte";
+        table["jchar"] = "Char";
+        table["jshort"] = "Short";
+        table["jint"] = "Int";
+        table["jlong"] = "Long";
+        table["jfloat"] = "Float";
+        table["jdouble"] = "Double";
+        table["jobject"] = "Object";
+    }
+
+    return table[name];
+}
+
+QByteArray jniName(const QString &name) {
+    TypeEntry *entry = TypeDatabase::instance()->findType(name);
+    if (entry)
+        return entry->name().toLatin1();
+    else
+        return "void *";
+}
+
+QString CppImplGenerator::jniReturnName(const AbstractMetaFunction *java_function, uint options, bool d_export)
+{
+    QString return_type = translateType(java_function->type(), EnumAsInts, d_export);
+    QString new_return_type = java_function->typeReplaced(0);
+    if (!new_return_type.isEmpty()) {
+        return_type = jniName(new_return_type);
+    }
+
+    // qtd
+    AbstractMetaType *f_type = java_function->type();
+    if (f_type) {
+        if (f_type->name() == "QModelIndex")
+            return_type = "void";
+        else if (f_type->typeEntry()->isStructInD())
+            return_type = f_type->typeEntry()->qualifiedCppName();
+        else if (f_type->isObject() || f_type->isReference() || f_type->isValue() || f_type->isQObject())
+            return_type = "void*";
+        if (f_type->isVariant())
+            return_type = "void*";
+    }
+
+    if (options & CppImplGenerator::ExternC && java_function->isConstructor())
+        return_type = "void*";
+    if (options & CppImplGenerator::ExternC && f_type)
+        if (f_type->isTargetLangString() || f_type->typeEntry()->isContainer())
+            return_type = "void";
+    // qtd end
+
+    return return_type;
+}
+
+QString CppImplGenerator::jniReturnType(const AbstractMetaType *f_type, uint options)
+{
+    QString return_type = translateType(f_type, EnumAsInts);
+
+    // qtd
+    if (f_type) {
+        if (f_type->typeEntry()->isStructInD())
+            return_type = f_type->typeEntry()->qualifiedCppName();
+        else if (f_type->isObject() || f_type->isReference() || f_type->isValue() || f_type->isQObject())
+            return_type = "void*";
+        if (f_type->isVariant())
+            return_type = "void*";
+    }
+
+    if (options & CppImplGenerator::ExternC && f_type)
+        if (f_type->isTargetLangString())
+            return_type = "void";
+    // qtd end
+    return return_type;
+}
+
+QByteArray jniTypeName(const AbstractMetaType *java_type)
+{
+    if (!java_type) {
+        return "Void";
+    } else if (java_type->isTargetLangChar()) {
+        return "Char";
+    } else if (java_type->isPrimitive()) {
+        return jniTypeName(java_type->typeEntry()->jniName());
+    } else if (java_type->isIntegerEnum() || java_type->isIntegerFlags()) {
+        return "Int";
+    } else {
+        return "Object";
+    }
+}
+
+QByteArray newXxxArray(const AbstractMetaType *java_type)
+{
+    return "New" + jniTypeName(java_type) + "Array";
+}
+
+QByteArray setXxxArrayElement(const AbstractMetaType *java_type)
+{
+    Q_ASSERT(java_type);
+    return "Set" + jniTypeName(java_type) + "ArrayElement";
+}
+
+QByteArray getXxxArrayElement(const AbstractMetaType *java_type)
+{
+    Q_ASSERT(java_type);
+    return "Get" + jniTypeName(java_type) + "ArrayElement";
+}
+
+QByteArray getXxxArrayRegion(const AbstractMetaType *java_type)
+{
+    Q_ASSERT(java_type);
+    return "Get" + jniTypeName(java_type) + "ArrayRegion";
+}
+
+QByteArray setXxxArrayRegion(const AbstractMetaType *java_type)
+{
+    Q_ASSERT(java_type);
+    return "Set" + jniTypeName(java_type) + "ArrayRegion";
+}
+
+QByteArray callXxxMethod(const AbstractMetaType *java_type)
+{
+    return "Call" + jniTypeName(java_type) + "Method";
+}
+
+QByteArray callXxxMethod(const QString &name) {
+    TypeEntry *entry = TypeDatabase::instance()->findType(name);
+    if (entry && entry->isPrimitive())
+        return "Call" + jniTypeName(entry->jniName()) + "Method";
+    else
+        return "CallObjectMethod";
+}
+
+QString jni_function_signature(QString package, QString class_name,
+                               const QString &function_name,
+                               const QString &return_type,
+                               const QString &mangled_arguments = QString(),
+                               uint options = CppImplGenerator::StandardJNISignature)
+{
+    QString s;
+
+    if (options & CppImplGenerator::ExternC)
+        s += "extern \"C\" DLL_PUBLIC ";
+/* qtd
+    if (options & CppImplGenerator::JNIExport)
+        s += "Q_DECL_EXPORT ";
+*/
+    if (options & CppImplGenerator::ReturnType) {
+        s += return_type;
+        s += " ";
+    }
+/* qtd
+    if (options & CppImplGenerator::JNIExport)
+        s += "JNICALL QTJAMBI_FUNCTION_PREFIX(";
+
+    s += "Java_";
+
+    s += package.replace(".", "_"); // qtd .replace("_", "_1")
+    s += '_';
+    s += class_name; // qtd .replace("_", "_1");
+    s += '_';
+*/
+    s += QString(function_name); //.replace("_", "_1");
+//    s += mangled_arguments;
+
+/* qtd
+    if (options & CppImplGenerator::JNIExport)
+        s += ")";
+*/
+    return s;
+}
+
+QString CppImplGenerator::fileNameForClass(const AbstractMetaClass *java_class) const
+{
+    return QString("%1_shell.cpp").arg(java_class->name());
+}
+
+void CppImplGenerator::writeSignalFunction(QTextStream &s, const AbstractMetaFunction *signal, const AbstractMetaClass *cls,
+                                           int pos)
+{
+    writeFunctionSignature(s, signal, cls, signalWrapperPrefix(),
+                           Option(OriginalName | OriginalTypeDescription),
+                           "QtJambi_SignalWrapper_");
+    s << endl << "{" << endl;
+    {
+        AbstractMetaArgumentList arguments = signal->arguments();
+        Indentation indent(INDENT);
+
+        if (arguments.size() > 0)
+            s << INDENT << "jvalue arguments[" << arguments.size() << "];" << endl;
+        else
+            s << INDENT << "jvalue *arguments = 0;" << endl;
+        s << INDENT << "JNIEnv *__jni_env = qtjambi_current_environment();" << endl
+          << INDENT << "__jni_env->PushLocalFrame(100);" << endl;
+
+        for (int i=0; i<arguments.size(); ++i) {
+            const AbstractMetaArgument *argument = arguments.at(i);
+            writeQtToJava(s,
+                          argument->type(),
+                          argument->indexedName(),
+                          "__java_" + argument->indexedName(),
+                          signal,
+                          argument->argumentIndex() + 1,
+                          BoxedPrimitive);
+            s << INDENT << "arguments[" << i << "].l = __java_" << argument->indexedName() << ";" << endl;
+        }
+        s << INDENT << "qtjambi_call_java_signal(__jni_env, m_signals[" << pos << "], arguments);"
+                    << endl;
+
+        s << INDENT << "__jni_env->PopLocalFrame(0);" << endl;
+
+        if (signal->type() != 0)
+            s << INDENT << default_return_statement_qt(signal->type()) << ";" << endl;
+    }
+    s << "}" << endl << endl;
+
+    if (signal->implementingClass() == signal->ownerClass())
+        writeFinalFunction(s, signal, cls);
+}
+
+bool CppImplGenerator::hasCustomDestructor(const AbstractMetaClass *java_class) const
+{
+    return !java_class->isQObject() && !java_class->typeEntry()->isValue();
+}
+
+void writeQtdEntityFunction(QTextStream &s, const AbstractMetaClass *java_class)
+{
+/*    if(java_class->baseClass())
+        return; */
+    if (!(java_class->typeEntry()->isObject() || java_class->typeEntry()->isQObject()))
+        return;
+    if (!java_class->hasVirtualFunctions())
+        return;
+/*    if (java_class->name() == "QPainterPath_Element") {
+        foreach (AbstractMetaFunction *function, java_class->virtualOverrideFunctions()) {
+            s << function->name() << endl;
+        }
+    }*/
+
+    s << "extern \"C\" DLL_PUBLIC void *__" << java_class->name() << "_entity(void *q_ptr)" << endl;
+    s << "{" << endl;
+    {
+        Indentation indent(INDENT);
+            s << INDENT << "Qtd_QObjectEntity* a = dynamic_cast<Qtd_QObjectEntity*>((" << java_class->qualifiedCppName() << "*)q_ptr);" << endl
+              << INDENT << "if (a != NULL)" << endl
+              << INDENT << "    return a->d_entity();" << endl
+              << INDENT << "else" << endl
+              << INDENT << "    return NULL;" << endl;
+    }
+    s << "}" << endl << endl;
+}
+
+void CppImplGenerator::writeInterfaceCasts(QTextStream &s, const AbstractMetaClass *java_class)
+{
+        // pointers to native interface objects for classes that implement interfaces
+        // initializing
+        AbstractMetaClassList interfaces = java_class->interfaces();
+        if (!interfaces.isEmpty()) {
+            for (int i=0; i<interfaces.size(); ++i) {
+                AbstractMetaClass *iface = interfaces.at(i);
+                s << "extern \"C\" DLL_PUBLIC " << iface->qualifiedCppName() << "* qtd_" << java_class->name() << "_cast_to_" << iface->qualifiedCppName()
+                  << "(" << java_class->name() << " *ptr)" << endl << "{" << endl;
+                Indentation indent(INDENT);
+                s << INDENT << "return dynamic_cast<"<< iface->qualifiedCppName()<< "*>(ptr);" << endl;
+                s << "}" << endl << endl;
+            }
+        }
+}
+
+void CppImplGenerator::writeInitCallbacks(QTextStream &s, const AbstractMetaClass *java_class)
+{
+    QString initArgs = "pfunc_abstr *virts";
+    if (java_class->isQObject())
+        initArgs += ", pfunc_abstr *sigs, pfunc_abstr qobj_del";
+
+    s << "extern \"C\" DLL_PUBLIC void qtd_" << java_class->name()
+      << QString("_initCallBacks(%1) {").arg(initArgs) << endl;
+
+    // virtual functions handlers
+    AbstractMetaFunctionList virtualFunctions = java_class->virtualFunctions();
+    for (int pos = 0; pos<virtualFunctions.size(); ++pos) {
+        const AbstractMetaFunction *function = virtualFunctions.at(pos);
+        if (!notWrappedYet(function)) { // qtd2
+            s << "    " << function->marshalledName() << "_dispatch = "
+                 "(pf" << function->marshalledName() << "_dispatch) virts[" << pos << "];" << endl;
+        }
+    }
+
+    // D-side signal callbacks
+    AbstractMetaFunctionList signal_funcs = signalFunctions(java_class);
+    for(int i = 0; i < signal_funcs.size(); i++)
+        s << "    emit_callbacks_" << java_class->name() << "[" << i << "] = (EmitCallback)"
+             "sigs[" << i << "];" << endl;
+
+    if (java_class->isQObject())
+        s << "    qtd_D_" << java_class->name() << "_delete = "
+             "(qtd_pf_D_" << java_class->name() << "_delete)qobj_del;" << endl;
+
+
+    s << "}" << endl;
+}
+
+
+void CppImplGenerator::write(QTextStream &s, const AbstractMetaClass *java_class)
+{
+
+    bool shellClass = java_class->generateShellClass();
+
+    // Includes
+    writeExtraIncludes(s, java_class);
+    bool shellInclude = (java_class->generateShellClass()
+        || java_class->queryFunctions(AbstractMetaClass::Signals | AbstractMetaClass::Visible | AbstractMetaClass::NotRemovedFromShell).size() > 0);
+
+    // need to include QPainter for all widgets...
+    {
+        const AbstractMetaClass *qwidget = java_class;
+        while (qwidget && qwidget->name() != "QWidget") {
+            qwidget = qwidget->baseClass();
+        }
+        if (qwidget)
+            s << "#include <QPainter>" << endl << endl;
+    }
+/*
+#if defined(QTJAMBI_DEBUG_TOOLS)
+    s << "#include <qtjambidebugtools_p.h>" << endl << endl;
+#endif
+*/
+    if (shellInclude)
+        s << "#include \"" << java_class->name() << "_shell" << ".h\"" << endl;
+/* qtd
+    if (java_class->isQObject())
+        s << "#include <qtdynamicmetaobject.h>" << endl;
+*/
+    s << "#include <iostream>" << endl;
+    Include inc = java_class->typeEntry()->include();
+    if (!inc.name.isEmpty()) {
+        s << "#include ";
+        if (inc.type == Include::IncludePath)
+            s << "<";
+        else
+            s << "\"";
+        s << inc.name;
+        if (inc.type == Include::IncludePath)
+            s << ">";
+        else
+            s << "\"";
+        s << endl;
+    }
+    s << endl; // qtd
+    s << "#include \"qtd_core.h\"" << endl
+      << "#include \"ArrayOpsPrimitive.h\"" << endl
+      << "#include \"ArrayOps_qt_core.h\"" << endl;
+
+    // qtd2 hack!!
+    if (java_class->package() == "qt.gui")
+        s << "#include \"ArrayOps_qt_gui.h\"" << endl;
+
+    s << endl;
+
+    writeInterfaceCasts(s, java_class);
+
+    /* qtd2
+    writeShellSignatures(s, java_class);
+
+    writeDefaultConstructedValues(s, java_class);
+
+    if (hasCustomDestructor(java_class)) */
+        writeFinalDestructor(s, java_class);
+
+   if (shellClass) {
+        foreach (AbstractMetaFunction *function, java_class->functions()) {
+            if (function->isConstructor() && !function->isPrivate())
+                writeShellConstructor(s, function);
+        }
+        writeShellDestructor(s, java_class);
+
+        writeQtdEntityFunction(s, java_class);
+
+        if (java_class->isQObject())
+            writeQObjectFunctions(s, java_class);
+
+        // Virtual overrides
+        s << "// Virtual overrides" << endl;
+        AbstractMetaFunctionList virtualFunctions = java_class->virtualFunctions();
+        for (int pos = 0; pos<virtualFunctions.size(); ++pos) {
+            const AbstractMetaFunction *function = virtualFunctions.at(pos);
+// qtd            writeShellFunction(s, function, java_class, pos);
+            writeShellVirtualFunction(s, function, java_class, pos);
+        }
+
+        if (cpp_shared)
+            writeInitCallbacks(s, java_class);
+
+        // Functions in shell class
+        s << "// Functions in shell class" << endl;
+        AbstractMetaFunctionList shellFunctions = java_class->nonVirtualShellFunctions();
+        for (int i=0; i<shellFunctions.size(); ++i) {
+            const AbstractMetaFunction *function = shellFunctions.at(i);
+                writeShellFunction(s, function, java_class, -1);
+        }
+
+        // Write public overrides for functions that are protected in the base class
+        // so they can be accessed from the native callback
+        s << "// public overrides for functions that are protected in the base class" << endl;
+        AbstractMetaFunctionList public_override_functions = java_class->publicOverrideFunctions();
+        foreach (AbstractMetaFunction *function, public_override_functions) {
+            if(notWrappedYet(function))
+                continue;
+            writePublicFunctionOverride(s, function, java_class);
+        }
+
+        // Write virtual function overries used to decide on static/virtual calls
+        s << "// Write virtual function overries used to decide on static/virtual calls" << endl;
+        AbstractMetaFunctionList virtual_functions = java_class->virtualOverrideFunctions();
+        foreach (const AbstractMetaFunction *function, virtual_functions) {
+            if(notWrappedYet(function))
+                continue;
+            writeVirtualFunctionOverride(s, function, java_class);
+        }
+
+    }
+
+    writeExtraFunctions(s, java_class);
+/* qtd2
+    writeToStringFunction(s, java_class);
+
+    if (java_class->hasCloneOperator()) {
+        writeCloneFunction(s, java_class);
+    }
+
+    // Signals
+    AbstractMetaFunctionList signal_functions = signalFunctions(java_class);
+    for (int i=0; i<signal_functions.size(); ++i)
+        writeSignalFunction(s, signal_functions.at(i), java_class, i);
+*/
+    s << "// ---externC---" << endl;
+
+    // Native callbacks (all java functions require native callbacks)
+    AbstractMetaFunctionList class_funcs = java_class->functionsInTargetLang();
+    foreach (AbstractMetaFunction *function, class_funcs) {
+        if (!function->isEmptyFunction())
+            writeFinalFunction(s, function, java_class);
+    }
+    s << "// ---externC---end" << endl;
+
+
+    class_funcs = java_class->queryFunctions(AbstractMetaClass::NormalFunctions | AbstractMetaClass::AbstractFunctions | AbstractMetaClass::NotRemovedFromTargetLang);
+    foreach (AbstractMetaFunction *function, class_funcs) {
+        if (function->implementingClass() != java_class) {
+            writeFinalFunction(s, function, java_class);
+        }
+    }
+
+    // Field accessors
+    s << "// Field accessors" << endl;
+    foreach (AbstractMetaField *field, java_class->fields()) {
+        if (field->wasPublic() || (field->wasProtected() && !java_class->isFinal()))
+            writeFieldAccessors(s, field);
+    }
+/*
+    s << "// writeFromNativeFunction" << endl;
+    writeFromNativeFunction(s, java_class);
+
+    if (java_class->isQObject())
+        writeOriginalMetaObjectFunction(s, java_class);
+
+    if (java_class->typeEntry()->isValue())
+        writeFromArrayFunction(s, java_class);
+
+    // generate the __qt_cast_to_Xxx functions
+    if (!java_class->isNamespace() && !java_class->isInterface()) {
+        AbstractMetaClassList interfaces = java_class->interfaces();
+        foreach (AbstractMetaClass *iface, interfaces)
+            writeInterfaceCastFunction(s, java_class, iface);
+    }
+
+    writeSignalInitialization(s, java_class);
+*/
+// qtd    writeJavaLangObjectOverrideFunctions(s, java_class);
+
+    s << endl << endl;
+
+    QString pro_file_name = java_class->package().replace(".", "_") + "/" + java_class->package().replace(".", "_") + ".pri";
+    priGenerator->addSource(pro_file_name, fileNameForClass(java_class));
+}
+
+void CppImplGenerator::writeVirtualDispatchFunction(QTextStream &s, const AbstractMetaFunction *function, bool d_export)
+{
+            uint options2 = ReturnType | ExternC;
+            QString return_type = jniReturnName(function, options2);
+            QString f_name = function->marshalledName() + "_dispatch";
+
+            if(!d_export)
+                s << "extern \"C\" ";
+
+            if (!cpp_shared || d_export) {
+                s << return_type << " " << f_name;
+                writeVirtualDispatchArguments(s, function, d_export);
+                if(!d_export)
+                    s << ";";
+            } else if (cpp_shared) {
+                s << "typedef " << return_type << " " << "(*pf" << f_name << ")";
+                writeVirtualDispatchArguments(s, function, false);
+                s << ";" << endl
+                  << "pf" << function->marshalledName() << "_dispatch "
+                  << function->marshalledName() << "_dispatch;";
+            }
+
+            s << endl;
+}
+
+void CppImplGenerator::writeShellVirtualFunction(QTextStream &s, const AbstractMetaFunction *function,
+                                          const AbstractMetaClass *implementor, int id)
+{
+            // ----------------------------
+            if(notWrappedYet(function))
+                return;
+
+            AbstractMetaType *f_type = function->type();
+            QString new_return_type = function->typeReplaced(0);
+            bool has_function_type = ((f_type != 0
+                                      || !new_return_type.isEmpty())
+                                      && new_return_type != "void");
+
+            writeVirtualDispatchFunction(s, function);
+
+            writeFunctionSignature(s, function, implementor, QString(), OriginalName);
+
+            s << endl
+              << "{" << endl;
+
+            Option options = NoOption;
+
+            Indentation indent(INDENT);
+            //bool static_call = !(options & VirtualCall);
+//s << "std::cout << \"entering " << function->marshalledName() << " \\n\"; " << endl;
+
+            if (f_type) {
+                if (f_type->isTargetLangString())
+                    s << INDENT << "char* ret_str = NULL;" << endl
+                      << INDENT << "size_t ret_str_size = 0;" << endl;
+                if (f_type->name() == "QModelIndex")
+                    s << INDENT << "QModelIndexAccessor __d_return_value;" << endl;
+                if (f_type->isContainer())
+                    s << INDENT << "void* __d_return_value;" << endl
+                      << INDENT << "size_t __d_return_value_size;" << endl;
+            }
+
+            AbstractMetaArgumentList arguments = function->arguments();
+            foreach (AbstractMetaArgument *argument, arguments) {
+                if (!function->argumentRemoved(argument->argumentIndex()+1)) {
+                    if (!argument->type()->isPrimitive()
+                        || !function->conversionRule(TypeSystem::NativeCode, argument->argumentIndex()+1).isEmpty()) {
+                        if(argument->type()->isContainer()) {
+                            QString arg_name = argument->indexedName();
+                            s << INDENT << QString("DArray %1_arr;").arg(arg_name) << endl
+                              << INDENT << QString("DArray *__d_%1 = &%1_arr;").arg(arg_name);
+
+                            writeQtToJava(s,
+                                        argument->type(),
+                                        arg_name,
+                                        "__d_" + arg_name,
+                                        function,
+                                        argument->argumentIndex() + 1,
+                                        Option(VirtualDispatch));
+                        }
+                    }
+                }
+            }
+
+            if ((options & NoReturnStatement) == 0)
+                s << INDENT;
+            /* qtd if (function->isAbstract() && static_call) {
+                s << default_return_statement_qt(function->type(), options) << ";" << endl;
+            } else */
+            {
+                if (f_type) {
+                    if (f_type->isTargetLangString() || f_type->isContainer())
+                        ;
+                    else if ((f_type->isValue() && !f_type->typeEntry()->isStructInD()) ||
+                            f_type->isVariant() )
+                        s << f_type->name() << " *__qt_return_value = (" << f_type->name() << "*) ";
+                    else if (f_type->isObject() || f_type->isQObject())
+                        s << "return (" << f_type->name() <<"*) ";
+                    else if (f_type->name() == "QModelIndex")
+                        ;
+                    else if ((options & NoReturnStatement) == 0)
+                        s << "return ";
+
+                    if (f_type->isEnum() || f_type->isFlags())
+                        s << "(" << f_type->typeEntry()->qualifiedCppName() <<") ";
+                }
+
+                s << function->marshalledName() << "_dispatch("
+                  << "this->d_entity()";
+
+                if (f_type) {
+                    if (f_type->isTargetLangString())
+                        s << ", ret_str, ret_str_size";
+                    if (f_type->name() == "QModelIndex")
+                        s << ", &__d_return_value";
+                    if (f_type->isContainer())
+                        s << ", &__d_return_value, &__d_return_value_size";
+                }
+
+                if (function->arguments().size() > 0)
+                    s << ", ";
+                writeFunctionCallArguments(s, function, QString(), Option(options | ForceEnumCast | SkipRemovedArguments | ExcludeConst | VirtualDispatch));
+
+                s << ");" << endl;
+
+//s << "std::cout << \"leaving " << function->marshalledName() << " \\n\"; " << endl;
+
+                if (f_type) {
+                    if (f_type->name() == "QModelIndex") {
+                        s << INDENT << "QModelIndex __qt_return_value = qtd_to_QModelIndex( __d_return_value );" << endl;
+#ifdef Q_OS_WIN32
+s << "__qtd_dummy();" << endl; // hack!!!
+#endif
+                        s << INDENT << "return __qt_return_value;" << endl;
+                    }
+
+                    if (f_type->isContainer()) {
+                        writeJavaToQt(s, f_type, "__qt_return_value", "__d_return_value",
+                                      function, 0, GlobalRefJObject);
+                        s << INDENT << "return __qt_return_value;" << endl;
+                    }
+
+                    if (f_type->isTargetLangString())
+                        s << INDENT << "return " << "QString::fromUtf8(ret_str, ret_str_size);" << endl;
+
+                    if ( ( f_type->isValue() && !f_type->typeEntry()->isStructInD() ) || f_type->isVariant() )
+                        s << INDENT << "return " << f_type->name() << "(*__qt_return_value);" << endl; //" __qt_return_value = ";
+                }
+            }
+
+            s << "}" << endl << endl;
+            // ----------------------------
+}
+
+void CppImplGenerator::writeVirtualDispatchArguments(QTextStream &s, const AbstractMetaFunction *d_function, bool d_export)
+{
+    uint nativeArgCount = 0;
+    AbstractMetaType *ret_type = d_function->type();
+
+    s << "(void *d_entity";
+
+    if (ret_type) {
+        if (ret_type->isTargetLangString())
+            s << ", char* ret_str, size_t ret_str_size";
+        if (ret_type->name() == "QModelIndex")
+            s << ", QModelIndexAccessor *__d_return_value";
+        if (ret_type->isContainer())
+            s << ", void** __d_arr_ptr, size_t* __d_arr_size";
+    }
+
+    if (d_function->arguments().size() > 0)
+        s << ", ";
+
+
+    // the function arguments
+    AbstractMetaArgumentList arguments = d_function->arguments();
+    foreach (const AbstractMetaArgument *argument, arguments) {
+        if (!d_function->argumentRemoved(argument->argumentIndex() + 1)) {
+            if (nativeArgCount > 0)
+                s << "," << " ";
+
+            AbstractMetaType *d_type = argument->type();
+            QString arg_name = argument->indexedName();
+
+            if (d_type->name() == "QModelIndex")
+                s << "QModelIndexAccessor" << QString(d_type->actualIndirections(), '*') << " " << arg_name;
+            else if (d_type->isContainer()) {
+                if (d_export) {
+                    s << DGenerator::translateType(d_type, d_function->ownerClass(), NoOption) << "* ";
+                } else
+                    s << "DArray* ";
+                s << arg_name;
+            } else if (d_type->typeEntry()->isStructInD())
+                s << d_type->typeEntry()->qualifiedCppName() << QString(d_type->actualIndirections(), '*')
+                  << " " << arg_name;
+            else if (d_type->isTargetLangString()) {
+                if (d_export)
+                    s << "wchar* ";
+                else
+                    s << "const unsigned short* ";
+                s << QString("%1, int %1_size").arg(arg_name);
+            } else {
+                if(d_type->isVariant())
+                     s << "void*";
+                else if (!d_type->hasNativeId())
+                {
+                   const ComplexTypeEntry *ctype = static_cast<const ComplexTypeEntry *>(d_type->typeEntry());
+                   if(d_type->typeEntry()->isObject() && ctype->isAbstract() && d_export)
+                   {
+                        QString d_name = d_type->typeEntry()->qualifiedCppName();
+                        s << d_name + "_ConcreteWrapper" + QString(d_type->indirections(),'*');
+                   }
+                   else
+                        s << translateType(d_type, EnumAsInts);
+                }
+                else
+                    s << "void*";
+                s << " " << argument->indexedName();
+            }
+            nativeArgCount++;
+        }
+    }
+    s << ")";
+}
+
+void CppImplGenerator::writeJavaLangObjectOverrideFunctions(QTextStream &s, const AbstractMetaClass *cls)
+{
+    if (cls->hasHashFunction()) {
+        AbstractMetaFunctionList hashcode_functions = cls->queryFunctionsByName("hashCode");
+        bool found = false;
+        foreach (const AbstractMetaFunction *function, hashcode_functions) {
+            if (function->actualMinimumArgumentCount() == 0) {
+                found = true;
+                break;
+            }
+        }
+
+        if (!found) {
+            s << endl
+              << INDENT << jni_function_signature(cls->package(), cls->name(), "__qt_hashCode", "jint")
+              << "(JNIEnv *__jni_env, jobject, jlong __this_nativeId)" << endl
+              << INDENT << "{" << endl;
+            {
+                Indentation indent(INDENT);
+                s << INDENT << "Q_UNUSED(__jni_env);" << endl
+                  << INDENT << cls->qualifiedCppName() << " *__qt_this = ("
+                  << cls->qualifiedCppName() << " *) qtjambi_from_jlong(__this_nativeId);" << endl
+                  << INDENT << "QTJAMBI_EXCEPTION_CHECK(__jni_env);" << endl
+                  << INDENT << "Q_ASSERT(__qt_this);" << endl
+                  << INDENT << "return qHash(*__qt_this);" << endl;
+            }
+            s << INDENT << "}" << endl;
+        }
+    }
+
+    // Qt has a standard toString() conversion in QVariant?
+    QVariant::Type type = QVariant::nameToType(cls->qualifiedCppName().toLatin1());
+    if (QVariant(type).canConvert(QVariant::String) && !cls->hasToStringCapability()) {
+        AbstractMetaFunctionList tostring_functions = cls->queryFunctionsByName("toString");
+        bool found = false;
+        foreach (const AbstractMetaFunction *function, tostring_functions) {
+            if (function->actualMinimumArgumentCount() == 0) {
+                found = true;
+                break;
+            }
+        }
+
+        if (!found) {
+            s << endl
+              << INDENT << jni_function_signature(cls->package(), cls->name(), "__qt_toString", "jstring")
+              << "(JNIEnv *__jni_env, jobject, jlong __this_nativeId)" << endl
+              << INDENT << "{" << endl;
+            {
+                Indentation indent(INDENT);
+                s << INDENT << cls->qualifiedCppName() << " *__qt_this = ("
+                  << cls->qualifiedCppName() << " *) qtjambi_from_jlong(__this_nativeId);" << endl
+                  << INDENT << "QTJAMBI_EXCEPTION_CHECK(__jni_env);" << endl
+                  << INDENT << "Q_ASSERT(__qt_this);" << endl
+                  << INDENT << "return qtjambi_from_qstring(__jni_env, QVariant(*__qt_this).toString());" << endl;
+            }
+            s << INDENT << "}" << endl;
+        }
+    }
+}
+
+void CppImplGenerator::writeExtraFunctions(QTextStream &s, const AbstractMetaClass *java_class)
+{
+    const ComplexTypeEntry *class_type = java_class->typeEntry();
+    Q_ASSERT(class_type);
+
+    CodeSnipList code_snips = class_type->codeSnips();
+    foreach (const CodeSnip &snip, code_snips) {
+        if (snip.language == TypeSystem::ShellCode || snip.language == TypeSystem::NativeCode) {
+            snip.formattedCode(s, INDENT) << endl;
+        }
+    }
+}
+
+void CppImplGenerator::writeToStringFunction(QTextStream &s, const AbstractMetaClass *java_class)
+{
+    FunctionModelItem fun = java_class->hasToStringCapability();
+    bool core = java_class->package() == QLatin1String("qt.core");
+    bool qevent = false;
+
+    const AbstractMetaClass *cls = java_class;
+    while (cls) {
+        if (cls->name() == "QEvent") {
+            qevent = true;
+            fun = cls->hasToStringCapability();
+            break;
+        }
+        cls = cls->baseClass();
+    }
+
+    if (!java_class->hasDefaultToStringFunction() && fun && !(qevent && core)) {
+
+        int indirections = fun->arguments().at(1)->type().indirections();
+        QString deref = QLatin1String(indirections == 0 ? "*" : "");
+
+        s << endl;
+        s << "#include <QDebug>" << endl;
+        s << jni_function_signature(java_class->package(), java_class->name(), "__qt_toString", "jstring")
+          << "(JNIEnv *__jni_env, jobject, jlong __this_nativeId)" << endl
+          << INDENT << "{" << endl;
+        {
+            Indentation indent(INDENT);
+            s << INDENT << java_class->qualifiedCppName() << " *__qt_this = ("
+              << java_class->qualifiedCppName() << " *) qtjambi_from_jlong(__this_nativeId);" << endl
+              << INDENT << "QTJAMBI_EXCEPTION_CHECK(__jni_env);" << endl
+              << INDENT << "Q_ASSERT(__qt_this);" << endl
+
+              << INDENT << "QString res;" << endl
+              << INDENT << "QDebug d(&res);" << endl
+              << INDENT << "d << " << deref << "__qt_this;" << endl;
+            s << INDENT << "return qtjambi_from_qstring(__jni_env, res);" << endl;
+        }
+        s << INDENT << "}" << endl << endl;
+    }
+}
+
+void CppImplGenerator::writeCloneFunction(QTextStream &s, const AbstractMetaClass *java_class)
+{
+    s << endl
+      << jni_function_signature(java_class->package(), java_class->name(), "__qt_clone", "jobject") << endl
+      << "(JNIEnv *__jni_env, jobject, jlong __this_nativeId)" << endl
+      << INDENT << "{" << endl;
+    {
+        Indentation indent(INDENT);
+        s << INDENT << java_class->qualifiedCppName() << " *__qt_this = ("
+
+          << java_class->qualifiedCppName() << " *) qtjambi_from_jlong(__this_nativeId);" << endl
+          << INDENT << "QTJAMBI_EXCEPTION_CHECK(__jni_env);" << endl
+          << INDENT << "Q_ASSERT(__qt_this);" << endl
+          << INDENT << java_class->qualifiedCppName() << " *res = __qt_this;" << endl
+          << INDENT << "return qtjambi_from_object(__jni_env, res, \"" << java_class->name() << "\", \"" << java_class->package().replace(".", "/") << "/\", true);" << endl;
+    }
+    s << INDENT << "}" << endl << endl;
+}
+
+void CppImplGenerator::writeShellSignatures(QTextStream &s, const AbstractMetaClass *java_class)
+{
+    bool has_constructors = java_class->hasConstructors();
+
+    // Write the function names...
+    if (has_constructors && java_class->hasVirtualFunctions()) {
+        AbstractMetaFunctionList virtual_functions = java_class->virtualFunctions();
+        {
+            Indentation indent(INDENT);
+
+            int pos = -1;
+            foreach (AbstractMetaFunction *function, virtual_functions) {
+                ++pos;
+
+                if (pos == 0)
+                    s << "static const char *qtjambi_method_names[] = {";
+                else
+                    s << ",";
+                s << endl
+                  << "/* " << QString("%1").arg(QString::number(pos), 3) << " */ "
+                  << "\"" << function->name() << "\"";
+            }
+            if (pos >= 0)
+                s << endl << "};" << endl << endl;
+            else
+                s << "static const char **qtjambi_method_names = 0;" << endl;
+        }
+
+        // Write the function signatures
+        {
+            Indentation indent(INDENT);
+
+            int pos = -1;
+            foreach (AbstractMetaFunction *function, virtual_functions) {
+                ++pos;
+
+                if (pos == 0)
+                    s << "static const char *qtjambi_method_signatures[] = {";
+                else
+                    s << ",";
+                s << endl
+                  << "/* " << QString("%1").arg(QString::number(pos), 3) << " */ "
+                  << "\""
+                  << jni_signature(function, SlashesAndStuff)
+                  << "\"";
+            }
+            if (pos >= 0)
+                s << endl << "};" << endl;
+            else
+                s << "static const char **qtjambi_method_signatures = 0;" << endl;
+            s << "static const int qtjambi_method_count = " << QString::number(pos + 1) << ";" << endl
+              << endl;
+        }
+    }
+
+    if (has_constructors && java_class->hasInconsistentFunctions()) {
+        AbstractMetaFunctionList inconsistents = java_class->cppInconsistentFunctions();
+        // Write the inconsistent function names...
+        {
+            Indentation indent(INDENT);
+            s << "static const char *qtjambi_inconsistent_names[] = {";
+            for (int i=0; i<inconsistents.size(); ++i) {
+                if (i != 0)
+                    s << ",";
+                s << endl << INDENT << "\"" << inconsistents.at(i)->name() << "\"";
+            }
+            s << endl << "};" << endl << endl;
+        }
+
+        // Write the function signatures
+        {
+            Indentation indent(INDENT);
+            s << "static const char *qtjambi_inconsistent_signatures[] = {";
+            for (int i=0; i<inconsistents.size(); ++i) {
+                const AbstractMetaFunction *function = inconsistents.at(i);
+
+                if (i != 0)
+                    s << ",";
+                s << endl << INDENT << "\""
+                  << jni_signature(function, SlashesAndStuff)
+                  << "\"";
+            }
+            s << endl << "};" << endl << endl;
+        }
+        s << "static const int qtjambi_inconsistent_count = " << inconsistents.size() << ";" << endl
+          << endl;
+    }
+
+
+    AbstractMetaFunctionList signal_functions = java_class->cppSignalFunctions();
+    if (signal_functions.size()) {
+        Indentation indent(INDENT);
+        s << "static const char *qtjambi_signal_names[] = {";
+        for (int i=0; i<signal_functions.size(); ++i) {
+            if (i != 0)
+                s << ",";
+
+            const AbstractMetaFunction *f = signal_functions.at(i);
+
+            QString signalName = f->name();
+
+            s << endl << INDENT << "\"" << signalName << "\"";
+        }
+        s << endl << "};" << endl << endl;
+
+        s << "static const int qtjambi_signal_argumentcounts[] = {";
+        for (int i=0; i<signal_functions.size(); ++i) {
+            if (i != 0)
+                s << ",";
+            s << endl << INDENT << signal_functions.at(i)->arguments().count();
+        }
+        s << endl << "};" << endl << endl;
+        s << "static const int qtjambi_signal_count = " << signal_functions.size() << ";" << endl
+          << endl;
+    }
+}
+
+void CppImplGenerator::writeQObjectFunctions(QTextStream &s, const AbstractMetaClass *java_class)
+{
+    // QObject::metaObject()
+/*    s << "const QMetaObject *" << shellClassName(java_class) << "::metaObject() const" << endl
+      << "{" << endl
+      << "  if (m_meta_object == 0) {" << endl
+      << "      JNIEnv *__jni_env = qtjambi_current_environment();" << endl
+      << "      jobject __obj = m_link != 0 ? m_link->javaObject(__jni_env) : 0;" << endl
+      << "      if (__obj == 0) return " << java_class->qualifiedCppName() << "::metaObject();" << endl
+      << "      else m_meta_object = qtjambi_metaobject_for_class(__jni_env, __jni_env->GetObjectClass(__obj), " << java_class->qualifiedCppName() << "::metaObject());" << endl;
+
+
+    AbstractMetaFunctionList virtualFunctions = java_class->virtualFunctions();
+    for (int pos=0; pos<virtualFunctions.size(); ++pos) {
+        const AbstractMetaFunction *virtualFunction = virtualFunctions.at(pos);
+        if (virtualFunction->isVirtualSlot()) {
+            QStringList introspectionCompatibleSignatures = virtualFunction->introspectionCompatibleSignatures();
+            foreach (QString introspectionCompatibleSignature, introspectionCompatibleSignatures) {
+                s << "      {" << endl
+                  << "          int idx = "
+                  << java_class->qualifiedCppName() << "::metaObject()->indexOfMethod(\""
+                  << introspectionCompatibleSignature << "\");" << endl;
+
+                s << "          if (idx >= 0) m_map.insert(idx, " << pos << ");" << endl
+                  << "      }" << endl;
+            }
+        }
+
+    }
+
+    s << "  }" << endl
+      << "  return m_meta_object;" << endl
+      << "}" << endl << endl;
+
+    // QObject::qt_metacast()
+    s << "void *" << shellClassName(java_class) << "::qt_metacast(const char *_clname)" << endl
+      << "{" << endl
+      << "  if (!_clname) return 0;" << endl
+      << "  if (!strcmp(_clname, \"" << shellClassName(java_class) << "\"))" << endl
+      << "     return static_cast<void*>(const_cast<" << shellClassName(java_class) << "*>(this));" << endl
+      << "  return " << java_class->qualifiedCppName() << "::qt_metacast(_clname);" << endl
+      << "}" << endl << endl;
+*/
+
+    writeSignalsHandling(s, java_class);
+
+    // QObject::qt_metacall()
+    s << "int " << shellClassName(java_class) << "::qt_metacall(QMetaObject::Call _c, int _id, void **_a)" << endl
+      << "{" << endl;
+
+    s << "  _id = " << java_class->qualifiedCppName() << "::qt_metacall(_c, _id, _a);" << endl
+      << "   if (_id < 0 || _c != QMetaObject::InvokeMetaMethod)" << endl
+      << "       return _id;" << endl
+//      << "   Q_ASSERT(_id < 2);" << endl
+      << "   emit_callbacks_" << java_class->name() << "[_id](this->d_entity(), _a);" << endl
+      << "   return -1;" << endl
+      << "}" << endl << endl;
+}
+
+void CppImplGenerator::writeSignalHandler(QTextStream &s, const AbstractMetaClass *d_class, AbstractMetaFunction *function)
+{
+    QString extra_args, extra_call_args, conversion_code;
+    QTextStream s2(&conversion_code);
+
+    Indentation indent(INDENT);
+
+    AbstractMetaArgumentList arguments = function->arguments();
+    foreach (AbstractMetaArgument *argument, arguments) {
+        if(argument->type()->isContainer()) {
+            QString arg_name = argument->indexedName();
+            const AbstractMetaType *arg_type = argument->type();
+            extra_args += ", DArray " + arg_name;
+            extra_call_args += ", " + arg_name + "_arr";
+
+            s2 << INDENT;
+            writeTypeInfo(s2, arg_type, NoOption);
+            s2 << arg_name << " = (*reinterpret_cast< ";
+            writeTypeInfo(s2, arg_type, ExcludeReference);
+            s2 << "(*)>(args[" << argument->argumentIndex() + 1 << "]));" << endl
+               << INDENT << QString("DArray %1_arr;").arg(arg_name) << endl
+               << INDENT << QString("DArray *__d_%1 = &%1_arr;").arg(arg_name);
+
+            writeQtToJava(s2,
+                          arg_type,
+                          arg_name,
+                          "__d_" + arg_name,
+                          function,
+                          argument->argumentIndex() + 1,
+                          Option(VirtualDispatch));
+        }
+    }
+    QString sig_name = signalExternName(d_class, function);
+    s << "extern \"C\" DLL_PUBLIC void " << sig_name << "_handle_in_d(void* d_entity, void** args" << extra_args <<");" << endl
+      << "extern \"C\" DLL_PUBLIC void " << sig_name << "_handle(void* d_entity, void** args)" << endl
+      << "{" << endl
+      << conversion_code << endl
+      << INDENT << sig_name << "_handle_in_d(d_entity, args" << extra_call_args << ");" << endl
+      << "}" << endl;
+
+}
+
+void CppImplGenerator::writeSignalsHandling(QTextStream &s, const AbstractMetaClass *java_class)
+{
+    s << "extern \"C\" typedef void (*EmitCallback)(void*, void**);" << endl;
+    AbstractMetaFunctionList signal_funcs = signalFunctions(java_class);
+
+    if (cpp_shared)
+        s << "EmitCallback emit_callbacks_" << java_class->name() << "[" << signal_funcs.size() << "];" << endl;
+    else {
+        // D-side signal callbacks
+        for(int i = 0; i < signal_funcs.size(); i++) {
+            AbstractMetaFunction *signal = signal_funcs.at(i);
+            writeSignalHandler(s, java_class, signal);
+        }
+
+        s << "EmitCallback emit_callbacks_" << java_class->name() << "[" << signal_funcs.size() << "] = {" << endl;
+        for(int i = 0; i < signal_funcs.size(); i++) {
+            AbstractMetaFunction *signal = signal_funcs.at(i);
+            s << endl;
+            if (i != 0)
+                s << ", ";
+            s << "&" << signalExternName(java_class, signal) << "_handle";
+        }
+        s << endl << "};" << endl << endl;
+    }
+
+    // Functions connecting/disconnecting shell's slots
+    for(int i = 0; i < signal_funcs.size(); i++) {
+        AbstractMetaFunction *signal = signal_funcs.at(i);
+        QString sigExternName = signalExternName(java_class, signal);
+
+        s << "extern \"C\" DLL_PUBLIC void " << sigExternName << "_connect"
+          << "(void* native_id)" << endl << "{" << endl
+          << "    " << shellClassName(java_class) << " *qobj = (" << shellClassName(java_class) << "*) native_id;" << endl
+          << "    const QMetaObject &mo = " << shellClassName(java_class) << "::staticMetaObject;" << endl
+          << "    int signalId = mo.indexOfSignal(\"" << signal->minimalSignature() << "\");" << endl
+          << "    mo.connect(qobj, signalId, qobj, mo.methodCount() + " << i << ");" << endl
+          << "}" << endl;
+
+        s << "extern \"C\" DLL_PUBLIC void " << sigExternName << "_disconnect"
+          << "(void* native_id)" << endl << "{" << endl
+          << "    " << shellClassName(java_class) << " *qobj = (" << shellClassName(java_class) << "*) native_id;" << endl
+          << "    const QMetaObject &mo = " << shellClassName(java_class) << "::staticMetaObject;" << endl
+          << "    int signalId = mo.indexOfSignal(\"" << signal->minimalSignature() << "\");" << endl
+          << "    mo.disconnect(qobj, signalId, qobj, mo.methodCount() + " << i << ");" << endl
+          << "}" << endl << endl;
+    }
+}
+
+
+void CppImplGenerator::writeShellConstructor(QTextStream &s, const AbstractMetaFunction *java_function)
+{
+    if (java_function->isModifiedRemoved(TypeSystem::ShellCode))
+        return;
+
+    const AbstractMetaClass *cls = java_function->ownerClass();
+    AbstractMetaArgumentList arguments = java_function->arguments();
+
+    writeFunctionSignature(s, java_function, cls);
+
+    s << endl;
+    s << "    : " << cls->qualifiedCppName() << "(";
+    for (int i=0; i<arguments.size(); ++i) {
+        s << arguments.at(i)->indexedName();
+        if (i != arguments.size() - 1)
+            s << ", ";
+    }
+    s << ")";
+    if (cls->hasVirtualFunctions())
+        s << "," << endl << "      Qtd_QObjectEntity(d_ptr)";
+/* qtd        s << "    m_meta_object(0)," << endl;
+    s << "      m_vtable(0)," << endl
+      << "      m_link(0)" << endl;
+*/
+    s << endl;
+    s << "{" << endl;
+    {
+        Indentation indent(INDENT);
+        writeCodeInjections(s, java_function, cls, CodeSnip::Beginning, TypeSystem::ShellCode);
+        writeCodeInjections(s, java_function, cls, CodeSnip::End, TypeSystem::ShellCode);
+    }
+    s << "}" << endl << endl;
+}
+
+void CppImplGenerator::writeShellDestructor(QTextStream &s, const AbstractMetaClass *java_class)
+{
+
+    if (java_class->isQObject())
+    if (cpp_shared)
+        s << "extern \"C\" typedef void (*qtd_pf_D_" << java_class->name() << "_delete)(void *d_ptr);" << endl
+          << "qtd_pf_D_" << java_class->name() << "_delete qtd_D_" << java_class->name() << "_delete;" << endl << endl;
+    else
+        s << "extern \"C\" void qtd_D_" << java_class->name() << "_delete(void *d_ptr);" << endl << endl;
+
+    s << shellClassName(java_class) << "::~"
+      << shellClassName(java_class) << "()" << endl
+      << "{" << endl;
+    {
+        Indentation indent(INDENT);
+        if (java_class->isQObject())
+            s << INDENT << "if (QObject::parent())" << endl
+              << INDENT << "    qtd_D_" << java_class->name() << "_delete(this->d_entity());" << endl;
+
+/* qtd
+        s << "#ifdef QT_DEBUG" << endl
+          << INDENT << "if (m_vtable)" << endl
+          << INDENT << "    m_vtable->deref();" << endl
+          << "#endif" << endl
+          << INDENT << "if (m_link) {" << endl;
+
+        AbstractMetaClassList interfaces = java_class->interfaces();
+        if (interfaces.size() + (java_class->baseClass() != 0 ? 1 : 0) > 1) {
+            if (java_class->baseClass() != 0)
+                interfaces += java_class->baseClass();
+            foreach (AbstractMetaClass *iface, interfaces) {
+                AbstractMetaClass *impl = iface->isInterface() ? iface->primaryInterfaceImplementor() : iface;
+                s << INDENT << "    m_link->unregisterSubObject((" << impl->qualifiedCppName() << " *) this);" << endl;
+            }
+        }
+
+        if (!java_class->isQObject()) {
+            s << INDENT << "    JNIEnv *__jni_env = qtjambi_current_environment();" << endl
+              << INDENT << "    if (__jni_env != 0) m_link->nativeShellObjectDestroyed(__jni_env);" << endl;
+        }
+
+#if defined(QTJAMBI_DEBUG_TOOLS)
+        s << INDENT << "    qtjambi_increase_shellDestructorCalledCount(QString::fromLatin1(\"" << java_class->name() << "\"));" << endl;
+#endif
+
+         s << INDENT << "}" << endl; */
+    }
+    s << "}" << endl << endl;
+}
+
+void CppImplGenerator::writeCodeInjections(QTextStream &s, const AbstractMetaFunction *java_function,
+                                           const AbstractMetaClass *implementor, CodeSnip::Position position,
+                                           TypeSystem::Language language)
+{
+
+    FunctionModificationList mods;
+    const AbstractMetaClass *cls = implementor;
+    while (cls != 0) {
+        mods += java_function->modifications(cls);
+
+        if (cls == cls->baseClass())
+            break;
+        cls = cls->baseClass();
+    }
+
+    foreach (FunctionModification mod, mods) {
+        if (mod.snips.count() <= 0)
+            continue ;
+
+        foreach (CodeSnip snip, mod.snips) {
+            if (snip.position != position)
+                continue ;
+
+            if ((snip.language & language) == false)
+                continue ;
+
+            if (position == CodeSnip::End)
+                s << endl;
+
+            QString code;
+            QTextStream tmpStream(&code);
+            snip.formattedCode(tmpStream, INDENT);
+            ArgumentMap map = snip.argumentMap;
+            ArgumentMap::iterator it = map.begin();
+            for (;it!=map.end();++it) {
+                int pos = it.key() - 1;
+                QString meta_name = it.value();
+
+                if (pos >= 0 && pos < java_function->arguments().count()) {
+                    code = code.replace(meta_name, java_function->arguments().at(pos)->indexedName());
+                } else {
+                    QString debug = QString("argument map specifies invalid argument index %1"
+                                            "for function '%2'")
+                                            .arg(pos + 1).arg(java_function->name());
+                    ReportHandler::warning(debug);
+                }
+
+            }
+            s << code;
+            if (position == CodeSnip::Beginning)
+                s << endl;
+        }
+    }
+}
+
+static QString function_call_for_ownership(TypeSystem::Ownership owner, const QString &var_name)
+{
+    if (owner == TypeSystem::CppOwnership) {
+        return "setCppOwnership(__jni_env, " + var_name + ")";
+    } else if (owner == TypeSystem::TargetLangOwnership) {
+        return "setJavaOwnership(__jni_env, " + var_name + ")";
+    } else if (owner == TypeSystem::DefaultOwnership) {
+        return "setDefaultOwnership(__jni_env, " + var_name + ")";
+    } else {
+        Q_ASSERT(false);
+        return "bogus()";
+    }
+}
+
+void CppImplGenerator::writeOwnership(QTextStream &s,
+                                      const AbstractMetaFunction *java_function,
+                                      const QString &var_name,
+                                      int var_index,
+                                      const AbstractMetaClass *implementor)
+{
+    TypeSystem::Ownership owner = TypeSystem::InvalidOwnership;
+    const AbstractMetaClass *cls = implementor;
+    while (cls != 0 && owner == TypeSystem::InvalidOwnership) {
+        owner = java_function->ownership(cls, TypeSystem::ShellCode, var_index);
+        cls = cls->baseClass();
+    }
+
+    if (owner == TypeSystem::InvalidOwnership)
+        return;
+
+    if (var_index != -1) {
+        s << INDENT << "if (" << var_name << " != 0) {" << endl;
+        {
+            Indentation indent(INDENT);
+            s << INDENT << "QtJambiLink *__link = QtJambiLink::findLink(__jni_env, "
+                        << var_name << ");" << endl
+            << INDENT << "Q_ASSERT(__link != 0);" << endl;
+
+            s << INDENT << "__link->" << function_call_for_ownership(owner, var_name) << ";" << endl;
+        }
+        s << INDENT << "}" << endl;
+    } else {
+        s << INDENT << "if (m_link) {" << endl;
+        {
+            Indentation indent(INDENT);
+            s << INDENT << "m_link->" << function_call_for_ownership(owner, "m_link->javaObject(__jni_env)") << ";" << endl;
+        }
+        s << INDENT << "}" << endl;
+    }
+
+}
+
+void CppImplGenerator::writeShellFunction(QTextStream &s, const AbstractMetaFunction *java_function,
+                                          const AbstractMetaClass *implementor, int id)
+{
+    writeFunctionSignature(s, java_function, implementor, QString(), OriginalName);
+
+    s << endl
+      << "{" << endl;
+
+    Indentation indent(INDENT);
+
+    QString java_function_signature = java_function->signature();
+/*    s << INDENT << "QTJAMBI_DEBUG_TRACE(\"(shell) entering: " << implementor->name() << "::"
+      << java_function_signature << "\");" << endl;
+*/
+    writeCodeInjections(s, java_function, implementor, CodeSnip::Beginning, TypeSystem::ShellCode);
+
+    //     s << "    printf(\"%s : %s\\n\", \"" << java_function->enclosingClass()->name() << "\""
+    //       << ", \"" << java_function->name() << "\");" << endl;
+
+    if (!java_function->isFinalInCpp() || java_function->isVirtualSlot()) {
+        s << INDENT << "jmethodID method_id = m_vtable->method(" << id << ");" << endl;
+        s << INDENT << "if (method_id) {" << endl;
+
+        {
+            Indentation indent(INDENT);
+            s << INDENT << "JNIEnv *__jni_env = qtjambi_current_environment();" << endl;
+
+            // This nasty case comes up when we're shutting down while receiving virtual
+            // calls.. With these checks we safly abort...
+            s << INDENT << "if (!__jni_env) {" << endl
+              << "    ";
+            writeBaseClassFunctionCall(s, java_function, implementor);
+            if (!java_function->type()) {
+                s << INDENT << "    return;" << endl;
+            }
+            s << INDENT << "}" << endl;
+
+            // otherwise, continue with the function call...
+            s << INDENT << "__jni_env->PushLocalFrame(100);" << endl;
+
+            AbstractMetaArgumentList arguments = java_function->arguments();
+            AbstractMetaArgumentList argumentsToReset;
+            foreach (AbstractMetaArgument *argument, arguments) {
+                if (!java_function->argumentRemoved(argument->argumentIndex()+1)) {
+                    if (!argument->type()->isPrimitive()
+                        || !java_function->conversionRule(TypeSystem::NativeCode, argument->argumentIndex()+1).isEmpty()) {
+                        writeQtToJava(s,
+                                    argument->type(),
+                                    argument->indexedName(),
+                                    "__java_" + argument->indexedName(),
+                                    java_function,
+                                    argument->argumentIndex() + 1);
+                    }
+
+                    if (java_function->resetObjectAfterUse(argument->argumentIndex()+1))
+                        argumentsToReset.append(argument);
+                }
+            }
+
+            for (int i=0; i<arguments.size(); ++i)
+                writeOwnership(s, java_function, "__java_" + arguments.at(i)->indexedName(), i+1, implementor);
+
+
+            AbstractMetaType *function_type = java_function->type();
+            QString new_return_type = java_function->typeReplaced(0);
+            bool has_function_type = ((function_type != 0
+                                      || !new_return_type.isEmpty())
+                                      && new_return_type != "void");
+
+            s << INDENT;
+            if (has_function_type) {
+                if (new_return_type.isEmpty()) {
+                    s << translateType(function_type);
+                } else {
+                    s << jniName(new_return_type);
+                }
+                s << " " << "__d_return_value = ";
+            }
+
+            s << "__jni_env->";
+            if (new_return_type.isEmpty()) {
+                s << callXxxMethod(java_function->type());
+            } else if (!has_function_type) {
+                s << "CallVoidMethod";
+            } else {
+                s << callXxxMethod(new_return_type);
+            }
+
+            s << "(m_link->javaObject(__jni_env), method_id";
+            if (arguments.size() > 0)
+                s << ", ";
+            writeFunctionCallArguments(s, java_function, "__java_", Option(NoCasts | SkipRemovedArguments));
+            s << ");" << endl
+              << INDENT << "qtjambi_exception_check(__jni_env);" << endl;
+
+            if (has_function_type) {
+                writeJavaToQt(s, function_type, "__qt_return_value", "__d_return_value",
+                              java_function, 0, GlobalRefJObject);
+
+                if (java_function->nullPointersDisabled()) {
+                    s << INDENT << "if (__d_return_value == 0) {" << endl;
+                    {
+                        Indentation indent(INDENT);
+                        s << INDENT << "fprintf(stderr, \"QtJambi: Unexpected null pointer returned from override of '" << java_function->name() << "' in class '%s'\\n\"," << endl
+                          << INDENT << "        qPrintable(qtjambi_object_class_name(__jni_env, m_link->javaObject(__jni_env))));" << endl;
+                        s << INDENT << "__qt_return_value = ";
+                        QString defaultValue = java_function->nullPointerDefaultValue();
+                        if (!defaultValue.isEmpty())
+                            s << defaultValue << ";";
+                        else
+                            writeBaseClassFunctionCall(s, java_function, implementor, NoReturnStatement);
+                        s << endl;
+                    }
+
+                    s << INDENT << "}" << endl;
+                }
+            } else if (!java_function->conversionRule(TypeSystem::ShellCode, 0).isEmpty()) {
+                writeConversionRule(s, TypeSystem::ShellCode, java_function, 0, "<invalid>", "<invalid>");
+            }
+
+            writeOwnership(s, java_function, "this", -1, implementor);
+            writeOwnership(s, java_function, "__d_return_value", 0, implementor);
+
+            foreach (AbstractMetaArgument *argumentToReset, argumentsToReset) {
+
+                QString argumentName = "__java_" + argumentToReset->indexedName();
+
+                s << INDENT;
+                if (argumentToReset->type()->isContainer())
+                    s << "qtjambi_invalidate_collection(";
+                else
+                    s << "qtjambi_invalidate_object(";
+
+                s << "__jni_env, " << argumentName << ");" << endl;
+            }
+
+            s << INDENT << "__jni_env->PopLocalFrame(0);" << endl;
+
+            s << INDENT << "QTJAMBI_DEBUG_TRACE(\"(shell) -> leaving: "  << implementor->name()
+              << "::" << java_function_signature << "\");" << endl;
+
+            if (function_type)
+                s << INDENT << "return __qt_return_value;" << endl;
+
+        }
+
+        s << INDENT << "} else {" << endl;
+
+        {
+            Indentation indent(INDENT);
+            s << INDENT << "QTJAMBI_DEBUG_TRACE(\"(shell) -> super() and leaving: "
+              << implementor->name() << "::" << java_function_signature << "\");" << endl;
+            writeBaseClassFunctionCall(s, java_function, implementor);
+        }
+
+
+        s << INDENT << "}" << endl;
+
+        writeCodeInjections(s, java_function, implementor, CodeSnip::End, TypeSystem::ShellCode);
+
+        // A little trick to close open painters on a widget
+        if (java_function->name() == "paintEvent") {
+            s << INDENT << "JNIEnv *env = qtjambi_current_environment();" << endl
+              << INDENT << "qtjambi_end_paint(env, m_link->javaObject(env));" << endl;
+        }
+
+    } else {
+        if(java_function->isRemovedFrom(implementor, TypeSystem::TargetLangCode)){
+            // Avoid compiler warnings for unused parameters
+            AbstractMetaArgumentList arguments = java_function->arguments();
+
+            foreach (const AbstractMetaArgument *argument, arguments) {
+                s << INDENT << "Q_UNUSED(" << argument->indexedName() << ")" << endl;
+            }
+        }
+        writeBaseClassFunctionCall(s, java_function, implementor);
+        writeCodeInjections(s, java_function, implementor, CodeSnip::End, TypeSystem::ShellCode);
+    }
+
+    s << "}" << endl << endl;
+
+}
+
+// ### kill implementor
+
+void CppImplGenerator::writePublicFunctionOverride(QTextStream &s,
+                                                   const AbstractMetaFunction *java_function,
+                                                   const AbstractMetaClass *implementor)
+{
+    Q_ASSERT(java_function->originalAttributes()
+             & (AbstractMetaAttributes::Protected
+                | AbstractMetaAttributes::Final));
+
+    // The write a public override version of this function to be used by native functions
+    writeFunctionSignature(s, java_function, implementor, "__public_",
+                           Option(EnumAsInts | UnderscoreSpaces
+                           | (java_function->isAbstract() ? SkipName : NoOption)));
+    s << endl
+      << "{" << endl;
+    Indentation indent(INDENT);
+    writeBaseClassFunctionCall(s, java_function, implementor);
+    s << "}" << endl << endl;
+}
+
+
+void CppImplGenerator::writeVirtualFunctionOverride(QTextStream &s,
+                                                    const AbstractMetaFunction *java_function,
+                                                    const AbstractMetaClass *implementor)
+{
+    Q_ASSERT(!java_function->isFinalInCpp());
+
+    Option options = Option(EnumAsInts | UnderscoreSpaces);
+
+    // The write a public override version of this function to be used by native functions
+    writeFunctionSignature(s, java_function, implementor, "__override_",
+                           options,
+                           QString());
+    s << endl
+      << "{" << endl;
+    Indentation indent(INDENT);
+/* qtd    s << INDENT << "if (static_call) {" << endl;
+    {
+        Indentation indent(INDENT); */
+        writeBaseClassFunctionCall(s, java_function, implementor);
+/* qtd   }
+    s << INDENT << "} else {" << endl;
+    {
+        Indentation indent(INDENT);
+        writeBaseClassFunctionCall(s, java_function, implementor, VirtualCall);
+    }
+
+    s << INDENT << "}" << endl */
+    s << "}" << endl << endl;
+}
+
+
+void CppImplGenerator::writeBaseClassFunctionCall(QTextStream &s,
+                                                  const AbstractMetaFunction *java_function,
+                                                  const AbstractMetaClass *,
+                                                  Option options)
+{
+    bool static_call = !(options & VirtualCall);
+    if ((options & NoReturnStatement) == 0)
+        s << INDENT;
+    if (java_function->isAbstract() && static_call) {
+        s << default_return_statement_qt(java_function->type(), options) << ";" << endl;
+    } else {
+        if (java_function->type() && (options & NoReturnStatement) == 0)
+            s << "return ";
+        if (static_call) {
+            const AbstractMetaClass *implementor = java_function->implementingClass();
+            if (java_function->isInterfaceFunction())
+                implementor = java_function->interfaceClass()->primaryInterfaceImplementor();
+            s << implementor->qualifiedCppName() << "::";
+        }
+        s << java_function->originalName() << "(";
+        writeFunctionCallArguments(s, java_function, QString(), Option(options | ForceEnumCast));
+        s << ");" << endl;
+    }
+}
+
+
+void CppImplGenerator::writeFunctionName(QTextStream &s,
+                                         const AbstractMetaFunction *java_function,
+                                         const AbstractMetaClass *java_class,
+                                         uint options)
+{
+    const AbstractMetaClass *cls = java_class ? java_class : java_function->ownerClass();
+    AbstractMetaArgumentList arguments = java_function->arguments();
+
+    // Function signature
+    QString return_type = jniReturnName(java_function, options);
+
+    QString function_name;
+
+    bool callThrough = java_function->needsCallThrough();
+/* qtd    if (!callThrough)
+        function_name = java_function->name();
+    else */
+    function_name = java_function->marshalledName();
+
+    QString args = "__";
+
+    if (callThrough && !java_function->isStatic() && !java_function->isConstructor())
+        args += "J";
+
+    if (!arguments.isEmpty()) {
+        foreach (const AbstractMetaArgument *argument, arguments) {
+            if (!java_function->argumentRemoved(argument->argumentIndex() + 1)) {
+                if (!argument->type()->hasNativeId()) {
+                    QString modified_type = java_function->typeReplaced(argument->argumentIndex()+1);
+                    if (modified_type.isEmpty())
+                        args += jni_signature(argument->type(), Underscores);
+                    else
+                        args += jni_signature(modified_type, Underscores);
+                } else {
+                    args += "J";
+                }
+            }
+        }
+    }
+
+    s << jni_function_signature(cls->package(), cls->name(), function_name,
+                                return_type, args, options);
+
+}
+
+void CppImplGenerator::writeFinalFunctionArguments(QTextStream &s, const AbstractMetaFunction *java_function, bool d_export)
+{
+    bool callThrough = java_function->needsCallThrough();
+    s << "(";
+/* qtd
+      << "JNIEnv *__jni_env," << endl;
+    if (!java_function->isConstructor()) {
+        if (java_function->isStatic())
+            s << " jclass";
+        else
+            s << " jobject";
+    } else
+        s << " jobject " << java_object_name;
+*/
+    uint nativeArgCount = 0;
+    const AbstractMetaClass *cls = java_function->ownerClass();
+    if (java_function->isConstructor() &&
+        ( cls->hasVirtualFunctions()
+        || cls->typeEntry()->isObject() ) )
+    {
+        s << "void *d_ptr";
+        nativeArgCount++;
+    }
+
+    // passing pointer to C++ object
+    bool hasNativeId = (callThrough && !java_function->isStatic() && !java_function->isConstructor());
+    if (hasNativeId) {
+        if (nativeArgCount > 0)
+            s << "," << endl << " ";
+        /* qtd << "," << endl */ s << "void* __this_nativeId";
+        nativeArgCount++;
+    }
+
+    AbstractMetaType *f_type = java_function->type();
+
+    // return values as strings, arrays or QModelIndex'es we return as arguments
+    bool return_arg = false;
+    if (f_type) {
+        if (f_type->isTargetLangString() ||
+            f_type->isContainer() ||
+            f_type->name() == "QModelIndex")
+            return_arg = true;
+
+        if (return_arg && nativeArgCount > 0)
+                s << "," << endl << " ";
+
+        if (f_type->isTargetLangString() || f_type->isContainer())
+            s << "void*";
+        else if (f_type->name() == "QModelIndex")
+            s << "QModelIndexAccessor*";
+
+        if(return_arg) {
+            s << " __d_return_value";
+            nativeArgCount++;
+        }
+    }
+
+    // the function arguments
+    AbstractMetaArgumentList arguments = java_function->arguments();
+    foreach (const AbstractMetaArgument *argument, arguments) {
+        if (!java_function->argumentRemoved(argument->argumentIndex() + 1)) {
+            AbstractMetaType *d_type = argument->type();
+            const TypeEntry *te = d_type->typeEntry();
+
+            QString arg_name = argument->indexedName();
+
+            if (nativeArgCount > 0)
+                s << "," << endl << " ";
+            // if has QString argument we have to pass char* and str.length to QString constructor
+            if (argument->type()->isTargetLangString()
+                || (argument->type()->typeEntry() && argument->type()->typeEntry()->qualifiedCppName() == "QString")) {
+                s << QString("char* %1, uint %1_size").arg(arg_name);
+            } else if (d_type->isContainer()) {
+                const ContainerTypeEntry *cte =
+                        static_cast<const ContainerTypeEntry *>(te);
+                if(isLinearContainer(cte))
+                    s << QString("void *%1, size_t %1_size").arg(arg_name);
+            } else {
+                if (!d_type->hasNativeId()) {
+                    if(d_type->isVariant()) {
+                        if (d_export) s << "void*";
+                        else s << "QVariant*";
+                    } else
+                        s << translateType(argument->type(), EnumAsInts, d_export);
+                }
+                else if (d_type->name() == "QModelIndex")
+                    s << "QModelIndexAccessor";
+                else if (te->isStructInD())
+                    s << te->qualifiedCppName();
+                else
+                    s << "void*";
+
+                s << " " << arg_name;
+            }
+            nativeArgCount++;
+        }
+    }
+    s << ")";
+}
+
+
+/*!
+    Generates type conversion from Java -> Qt for all the arguments
+    that are to be to be passed to the function
+*/
+void CppImplGenerator::writeFinalFunctionSetup(QTextStream &s, const AbstractMetaFunction *java_function,
+                                               const QString &qt_object_name,
+                                               const AbstractMetaClass *cls)
+{
+
+    // Translate each of the function arguments into qt types
+    AbstractMetaArgumentList arguments = java_function->arguments();
+    foreach (const AbstractMetaArgument *argument, arguments) {
+        if (!argument->type()->isPrimitive()
+            || !java_function->conversionRule(TypeSystem::NativeCode, argument->argumentIndex() + 1).isEmpty()) {
+                writeJavaToQt(s,
+                            argument->type(),
+                            "__qt_" + argument->indexedName(),
+                            argument->indexedName(),
+                            java_function,
+                            argument->argumentIndex() + 1,
+                            Option(UseNativeIds | EnumAsInts));
+        }
+    }
+
+    // Extract the qt equivalent to the this pointer and name it "qt_object_name"
+    if (!java_function->isStatic() && !java_function->isConstructor()) {
+// qtd2        QString className = java_function->isFinalOverload() ? cls->name() : shellClassName(cls);
+        QString className = java_function->isFinalOverload() ? cls->name() : shellClassName(cls);
+        s << INDENT
+          << className << " *" << qt_object_name
+          << " = (" << className << " *) __this_nativeId;"
+          << endl;
+//          << INDENT << "QTJAMBI_EXCEPTION_CHECK(__jni_env);" << endl
+// qtd          << INDENT << "Q_ASSERT(" << qt_object_name << ");" << endl;
+    }
+}
+
+void CppImplGenerator::writeFinalFunction(QTextStream &s, const AbstractMetaFunction *java_function,
+                                          const AbstractMetaClass *java_class)
+{
+    Q_ASSERT(java_class);
+
+    if (java_function->isModifiedRemoved(TypeSystem::NativeCode))
+        return;
+
+    const AbstractMetaClass *cls = java_class ? java_class : java_function->ownerClass();
+
+    QString java_function_signature = cls->name() + "::" + java_function->signature();
+
+    s << "// " << java_function_signature << endl;
+
+    const AbstractMetaType *function_type = java_function->type();
+    QString new_return_type = java_function->typeReplaced(0);
+    bool has_function_type = new_return_type != "void"
+                             && (!new_return_type.isEmpty() || function_type != 0)
+                         && java_function->argumentReplaced(0).isEmpty();
+
+    const QString qt_object_name = java_function->isStatic() ? shellClassName(cls) : "__qt_this";
+    const QString java_object_name = java_function->isStatic() ? "__jni_class" : "__jni_object";
+
+    // we are not wrapping some functions depending on arguments because API is not yet full
+    if (notWrappedYet(java_function))
+        return;
+
+    // function signature...
+    bool callThrough = java_function->needsCallThrough();
+    uint options = m_native_jump_table ? ReturnType | ExternC : StandardJNISignature;
+    writeFunctionName(s, java_function, cls, options);
+    s << endl;
+    writeFinalFunctionArguments(s, java_function);
+    s << endl << "{" << endl;
+    Indentation indent(INDENT);
+
+// qtd2    s << INDENT << "QTJAMBI_DEBUG_TRACE(\"(native) entering: " << java_function_signature << "\");" << endl;
+    bool hasNativeId = (callThrough && !java_function->isStatic() && !java_function->isConstructor());
+/*    if (hasNativeId)
+        s << INDENT << "Q_UNUSED(__this_nativeId)" << endl;
+    // Avoid compiler warnings when the variables are unused
+    {
+        s << INDENT << "Q_UNUSED(__jni_env)" << endl;
+
+        if (java_function->isConstructor())
+            s << INDENT << "Q_UNUSED(" << java_object_name << ")" << endl;
+
+        bool hasNativeId = (callThrough && !java_function->isStatic() && !java_function->isConstructor());
+        if (hasNativeId)
+            s << INDENT << "Q_UNUSED(__this_nativeId)" << endl;
+    }
+*/
+
+    if (cls->isFinal() && (!java_function->isAbstract() || !java_function->isFinalInTargetLang()) && !java_function->wasPublic()) {
+        QString debug = QString("protected function '%1' in final class '%2'")
+            .arg(java_function->signature()).arg(java_class->name());
+        ReportHandler::warning(debug);
+        // Avoid compiler warnings for unused parameters
+        AbstractMetaArgumentList arguments = java_function->arguments();
+
+        foreach (const AbstractMetaArgument *argument, arguments) {
+            s << INDENT << "Q_UNUSED(" << argument->indexedName() << ")" << endl;
+        }
+        s << INDENT << default_return_statement_qt(java_function->type()) << "";
+    } else {
+        writeFinalFunctionSetup(s, java_function, qt_object_name, cls);
+
+        writeCodeInjections(s, java_function, java_function->implementingClass(), CodeSnip::Beginning, TypeSystem::NativeCode);
+
+        if (java_function->isConstructor()) {
+            writeFinalConstructor(s, java_function, qt_object_name, java_object_name);
+        } else {
+
+            QString function_prefix = "";
+            QStringList extra_param;
+            Option option = NoOption;
+
+            bool hasShell = cls->generateShellClass();
+
+            if (java_function->isFinalOverload()) {
+                // no prefix
+            } else if (java_function->isFinalInCpp() && !java_function->wasPublic() && hasShell) {
+                function_prefix = "__public_";
+            } else if (!java_function->isFinalInCpp() && !java_function->isStatic() && hasShell) {
+                function_prefix = "__override_";
+/* qtd                extra_param.append("__do_static_call");
+                s << INDENT
+                  << "bool __do_static_call = __this_nativeId ? ((QtJambiLink *) "
+                  << "__this_nativeId)->createdByJava() : false;" << endl;
+*/            } else {
+                option = OriginalName;
+            }
+
+            // Call the Qt function on the java object
+            s << "    ";
+            if (has_function_type) {
+                const QString qt_return_value = "__qt_return_value";
+                const QString java_return_value = "__d_return_value";
+                if (function_type) {
+                    writeTypeInfo(s, function_type, EnumAsInts);
+                    s << " " << qt_return_value
+                      << " = ";
+                }
+
+                writeFunctionCall(s, qt_object_name, java_function, function_prefix, option,
+                                  extra_param);
+                s << endl;
+
+                writeQtToJava(s, function_type, qt_return_value, java_return_value,
+                              java_function, 0, EnumAsInts);
+
+// qtd                s << INDENT << "QTJAMBI_DEBUG_TRACE(\"(native) -> leaving: "
+//                  << java_function_signature << "\");";
+
+                if (function_type && function_type->name() != "QModelIndex") {
+                    if(function_type->typeEntry()->isStructInD())
+                        s << endl << INDENT << "return " << qt_return_value << ";";
+                    else if (!function_type->isTargetLangString() && !function_type->isContainer())
+                        s << endl << INDENT << "return " << java_return_value << ";";
+                }
+
+            } else {
+                writeFunctionCall(s, qt_object_name, java_function, function_prefix, option,
+                                  extra_param);
+/* qtd
+                s << INDENT << "QTJAMBI_DEBUG_TRACE(\"(native) -> leaving: "
+                  << java_function_signature << "\");" << endl;
+                  */
+            }
+        }
+    }
+    if(!java_function->argumentReplaced(0).isEmpty()) {
+    s << INDENT << "return 0;" << endl;
+    }
+
+    s << endl << "}";
+    s << endl << endl;
+}
+
+void CppImplGenerator::writeAssignment(QTextStream &s, const QString &destName, const QString &srcName,
+                                       const AbstractMetaType *java_type)
+{
+    if (java_type->isArray()) {
+        for (int i=0; i<java_type->arrayElementCount(); ++i) {
+            writeAssignment(s, destName + "[" + QString::number(i) + "]",
+                srcName + "[" + QString::number(i) + "]", java_type->arrayElementType());
+        }
+    } else {
+        s << INDENT << destName << " = " << srcName << ";" << endl;
+    }
+}
+
+void CppImplGenerator::writeFieldAccessors(QTextStream &s, const AbstractMetaField *java_field)
+{
+    Q_ASSERT(java_field);
+    Q_ASSERT(java_field->isPublic() || java_field->isProtected());
+
+    const AbstractMetaFunction *setter = java_field->setter();
+    const AbstractMetaFunction *getter = java_field->getter();
+
+    const AbstractMetaClass *cls = java_field->enclosingClass();
+    FieldModification mod = cls->typeEntry()->fieldModification(java_field->name());
+
+    if(notWrappedYet(getter))
+        return;
+
+    if (mod.isReadable()) {
+        // Getter
+        if (getter->wasProtected()) {
+            writeFunctionSignature(s, getter, getter->ownerClass());
+            s << endl
+              << "{" << endl;
+            {
+                Indentation indent(INDENT);
+                s << INDENT << "return " << java_field->name() << ";" << endl;
+            }
+            s << "}" << endl << endl;
+        }
+
+
+        writeFunctionName(s, getter, getter->ownerClass());
+        s << endl;
+        writeFinalFunctionArguments(s, getter);
+        s << "{" << endl;
+        {
+            Indentation indent(INDENT);
+
+
+            writeFinalFunctionSetup(s, getter, "__qt_object", getter->ownerClass());
+
+            const QString java_return_value = "__d_return_value";
+            QString qt_return_value;
+            if (setter->isStatic())
+                qt_return_value = shellClassName(setter->ownerClass()) + "::";
+            else
+                qt_return_value = "__qt_object->";
+
+
+            // To avoid "taking address of tmp"
+            s << INDENT;
+            writeTypeInfo(s, getter->type(), Option(ArrayAsPointer));
+            QString tmp_name = "__tmp_" + getter->name();
+            s << tmp_name << " = ";
+
+            if (getter->wasPublic())
+                qt_return_value += java_field->name();
+            else
+                qt_return_value += getter->name() + "_getter()";
+            s << qt_return_value << ";" << endl;
+
+            writeQtToJava(s, getter->type(), tmp_name, java_return_value, 0, -1, EnumAsInts);
+            if (getter->type()->isTargetLangString())
+                ;
+            else if(getter->type()->typeEntry()->isStructInD())
+                s << INDENT << "return " << tmp_name << ";" << endl;
+            else
+                s << INDENT << "return " << java_return_value << ";" << endl;
+        }
+        s << "}" << endl << endl;
+    }
+
+    if(notWrappedYet(setter))
+        return;
+
+    // Setter
+    if (mod.isWritable() && !java_field->type()->isConstant()) {
+        // Write public override for protected fields
+        if (setter->wasProtected()) {
+            writeFunctionSignature(s, setter, setter->ownerClass());
+            s << endl
+              << "{" << endl;
+            {
+                Indentation indent(INDENT);
+
+                Q_ASSERT(setter->arguments().count() > 0);
+                const AbstractMetaArgument *argument = setter->arguments().at(0);
+
+                QString thisRef = java_field->isStatic()
+                    ? setter->ownerClass()->qualifiedCppName() + QString("::")
+                    : QString("this->");
+                writeAssignment(s, thisRef + java_field->name(), argument->indexedName(), argument->type());
+            }
+            s << "}" << endl << endl;
+        }
+
+        writeFunctionName(s, setter, setter->ownerClass());
+        s << endl;
+        writeFinalFunctionArguments(s, setter);
+        s  << "{" << endl;
+
+        {
+            Indentation indent(INDENT);
+
+            writeFinalFunctionSetup(s, setter, "__qt_object", setter->ownerClass());
+
+            Q_ASSERT(setter->arguments().count() == 1);
+            const AbstractMetaArgument *argument = setter->arguments().at(0);
+
+            QString dest;
+            if (setter->isStatic())
+                dest = shellClassName(setter->ownerClass()) + "::";
+            else
+                dest = "__qt_object->";
+
+            QString src;
+            if (!argument->type()->isPrimitive() && !argument->type()->typeEntry()->isStructInD())
+                src = "__qt_" + argument->indexedName();
+            else
+                src = argument->indexedName();
+
+            if (setter->wasPublic())
+                writeAssignment(s, dest + java_field->name(), src, argument->type());
+            else
+                s << INDENT << dest << setter->name() << "_setter(" << src << ");" << endl;
+        }
+        s << "}" << endl << endl;
+    }
+}
+
+void CppImplGenerator::writeFinalDestructor(QTextStream &s, const AbstractMetaClass *cls)
+{
+    if (cls->hasConstructors()) {
+        s << INDENT << "extern \"C\" DLL_PUBLIC void qtd_" << cls->name() << "_destructor(void *ptr)" << endl
+          << INDENT << "{" << endl;
+        {
+            Indentation indent(INDENT);
+/* qtd
+            if (!cls->isQObject() && !cls->generateShellClass()) {
+                s << INDENT << "QtJambiLink *link = QtJambiLink::findLinkForUserObject(ptr);" << endl
+                  << INDENT << "if (link) link->resetObject(qtjambi_current_environment());" << endl;
+            }
+
+            // Code injectsions...
+            foreach (const CodeSnip &snip, cls->typeEntry()->codeSnips()) {
+                if (snip.language == TypeSystem::DestructorFunction) {
+                    s << snip.code();
+                }
+            }
+*/
+            s << INDENT << "delete (" << shellClassName(cls) << " *)ptr;" << endl;
+
+#if defined(QTJAMBI_DEBUG_TOOLS)
+            s << INDENT << "qtjambi_increase_destructorFunctionCalledCount(QString::fromLatin1(\"" << cls->name() << "\"));" << endl;
+#endif
+        }
+
+        s << INDENT << "}" << endl << endl;
+    }
+}
+
+void CppImplGenerator::writeFinalConstructor(QTextStream &s,
+                                         const AbstractMetaFunction *java_function,
+                                         const QString &qt_object_name,
+                                         const QString &java_object_name)
+{
+    const AbstractMetaClass *cls = java_function->ownerClass();
+    AbstractMetaArgumentList arguments = java_function->arguments();
+    QString className = cls->typeEntry()->qualifiedCppName();
+
+    bool hasShellClass = cls->generateShellClass();
+
+    s << INDENT << shellClassName(cls) << " *" << qt_object_name
+      << " = new " << shellClassName(cls)
+      << "(";
+    writeFunctionCallArguments(s, java_function, "__qt_");
+    s << ");" << endl;
+    s << INDENT << "return (void *) " << qt_object_name << ";" << endl; // qtd
+
+/* qtd    s << INDENT << "QtJambiLink *__qt_java_link = ";
+    if (cls->isQObject()) {
+        s << "qtjambi_construct_qobject(__jni_env, " << java_object_name << ", "
+          << qt_object_name << ")";
+    } else {
+        s << "qtjambi_construct_object(__jni_env, " << java_object_name << ", " << qt_object_name;
+        if (cls->typeEntry()->isValue())
+            s << ", \"" << className << "\")";
+        else // non-QObject, object type
+            s << ", QMetaType::Void, QLatin1String(\"" << cls->fullName().replace(".", "/") << "\"), true)";
+    }
+    s << ";" << endl
+      << INDENT << "if (!__qt_java_link) {" << endl;
+    {
+        Indentation indent(INDENT);
+        s << INDENT << "qWarning(\"object construction failed for type: "
+          << className << "\");" << endl
+          << INDENT << "return;" << endl;
+    }
+    s << INDENT << "}" << endl;
+
+
+    if (cls->isQObject()) {
+        // Make sure all qobjects created by Java are owned by java only if
+        // parent object has not been set.
+        // All other objects will default to split ownership.
+        s << INDENT << "if(!__qt_this->QObject::parent()){" << endl;
+        s << INDENT << "    __qt_java_link->setJavaOwnership(__jni_env, " << java_object_name << ");" << endl;
+        s << INDENT << "}" << endl;
+    } else {
+        // All non-qobjects created by Java are owned by java
+        s << INDENT << "__qt_java_link->setJavaOwnership(__jni_env, " << java_object_name << ");" << endl;
+    }
+
+    if (hasCustomDestructor(cls)) {
+        s << INDENT << "__qt_java_link->setDestructorFunction(qtjambi_destructor);" << endl;
+    }
+
+    if (cls->typeEntry()->typeFlags() & ComplexTypeEntry::DeleteInMainThread)
+        s << INDENT << "__qt_java_link->setDeleteInMainThread(true);" << endl;
+
+    if (!cls->hasVirtualFunctions() && !cls->hasInconsistentFunctions() && !cls->typeEntry()->isObject())
+        return;
+
+    if (hasShellClass) {
+        // Set up the link object
+        s << INDENT << qt_object_name << "->m_link = __qt_java_link;" << endl;
+
+        // Make sure the user data in the QObject has bindings to the qobject's meta object
+        // (this has to be done after the link is set, so that the fake meta object
+        //  can access the java object, for which it gets a reference in the link)
+        if (cls->isQObject())
+            s << INDENT << qt_object_name << "->m_link->setMetaObject(" << qt_object_name << "->metaObject());" << endl;
+
+        s << INDENT << qt_object_name << "->m_link->setCreatedByJava(true);" << endl;
+
+
+
+        AbstractMetaClassList interfaces = cls->interfaces();
+        if (interfaces.size() + (cls->baseClass() != 0 ? 1 : 0) > 1)  {
+            if (cls->baseClass() != 0)
+                interfaces += cls->baseClass();
+            foreach (AbstractMetaClass *iface, interfaces) {
+                AbstractMetaClass *impl = iface->isInterface() ? iface->primaryInterfaceImplementor() : iface;
+                s << INDENT << qt_object_name << "->m_link->registerSubObject((" << impl->qualifiedCppName() << " *) " << qt_object_name << ");" << endl;
+            }
+        }
+    }
+
+    if (!cls->hasVirtualFunctions() && !cls->hasInconsistentFunctions())
+        return;
+
+    // Set up the vtable
+    s << INDENT;
+    QString space(24, ' ');
+    if (hasShellClass)
+        s << qt_object_name << "->m_vtable = ";
+    s << "qtjambi_setup_vtable(__jni_env, " << endl << space << "__jni_object, " << endl;
+
+    if (cls->hasInconsistentFunctions()) {
+        s << space << "qtjambi_inconsistent_count, " << endl
+          << space << "qtjambi_inconsistent_names, " << endl
+          << space << "qtjambi_inconsistent_signatures, " << endl;
+    } else {
+        s << space << "0, 0, 0, // no inconsistent functions" << endl;
+    }
+
+    if (cls->hasVirtualFunctions()) {
+        s << space << "qtjambi_method_count, " << endl
+          << space << "qtjambi_method_names, " << endl
+          << space << "qtjambi_method_signatures" << endl;
+    } else {
+        s << space << "0, 0, 0 // no virtual functions" << endl;
+    }
+
+    s << space << ");" << endl; */
+}
+
+void CppImplGenerator::writeSignalInitialization(QTextStream &s, const AbstractMetaClass *java_class)
+{
+    if (!java_class->isQObject()
+        || java_class->queryFunctions(AbstractMetaClass::Signals | AbstractMetaClass::Visible | AbstractMetaClass::NotRemovedFromTargetLang).size() == 0) {
+        return ;
+    }
+
+    s << jni_function_signature(java_class->package(), java_class->name(), "__qt_signalInitialization", "jboolean")
+      << endl << "(JNIEnv *__jni_env, jobject java_object, jlong ptr, jstring java_signal_name)" << endl
+      << "{" << endl
+      << "   QtJambiLink *link = (QtJambiLink *) ptr;" << endl
+      << "   if (link == 0)" << endl
+      << "       return true;" << endl << endl
+      << "   QObject *qt_this = link->qobject();" << endl
+      << "   Q_ASSERT(qt_this);" << endl << endl
+      << "   QtJambi_SignalWrapper_" << java_class->name() << " *qt_wrapper = "
+      << "   (QtJambi_SignalWrapper_" << java_class->name() << " *) link->signalWrapper();" << endl
+      << "   if (qt_wrapper == 0) {" << endl
+      << "       qt_wrapper = new QtJambi_SignalWrapper_" << java_class->name() << ";" << endl
+      << "       link->setSignalWrapper(qt_wrapper);" << endl
+      << "       qt_wrapper->link = link;" << endl << endl
+      << "       qtjambi_resolve_signals(__jni_env," << endl
+      << "                               java_object," << endl
+      << "                               qt_wrapper->m_signals," << endl
+      << "                               qtjambi_signal_count," << endl
+      << "                               (char **) qtjambi_signal_names," << endl
+      << "                               (int *) qtjambi_signal_argumentcounts);" << endl
+      << "   }" << endl
+      << "   QString signal_name = qtjambi_to_qstring(__jni_env, java_signal_name);" << endl
+      << "   return qtjambi_connect_cpp_to_java(__jni_env," << endl
+      << "                                      signal_name," << endl
+      << "                                      qt_this," << endl
+      << "                                      qt_wrapper," << endl
+      << "                                      QLatin1String(\"" << java_class->fullName() << "\")," << endl
+      << "                                      QLatin1String(\"" << signalWrapperPrefix() << "\"));" << endl
+      << "}";
+}
+
+QString CppImplGenerator::fromObject(const TypeEntry *entry,
+                                     const QString &var_name)
+{
+    QString returned;
+    QString package = entry->javaPackage();
+    const ComplexTypeEntry *centry = entry->isComplex()
+                                     ? static_cast<const ComplexTypeEntry *>(entry)
+                                     : 0;
+
+    if (centry == 0 || centry->polymorphicIdValue().isEmpty()) {
+/* qtd        returned = "qtjambi_from_object(__jni_env, " + var_name + ", \""
+                   + entry->lookupName()
+                   + "\", \"" + QString(package).replace(".", "/") + "/\", true);";
+*/
+        if(entry->isObject())
+            returned = var_name + ";";
+        else
+            returned = "new " + entry->lookupName() + "(" + var_name +");";
+    } else {
+        AbstractMetaClass *cls = classes().findClass(centry->qualifiedCppName());
+        if (!cls) {
+            qFatal("CppImplGenerator::fromObject(): class '%s' could not be resolved...",
+                   qPrintable(centry->qualifiedCppName()));
+        }
+
+        while (cls != 0 && !cls->typeEntry()->isPolymorphicBase())
+            cls = cls->baseClass();
+
+        QString full_name;
+        if (cls != 0) {
+            full_name = cls->fullName();
+        } else {
+            ReportHandler::warning(QString("class '%1' has polymorphic id but does not inherit a polymorphic class")
+                                   .arg(centry->qualifiedCppName()));
+        }
+/* qtd
+        returned = "qtjambi_from_object(__jni_env, " + var_name + ", \""
+                   + centry->lookupName()
+                   + "\", \"" + QString(package).replace(".", "/") + "/\","
+                   + "\"" + jni_signature(full_name, Underscores) + "\", true); // fucking complex";
+*/
+        if(entry->isObject())
+            returned = var_name + "; // complex entry";
+        else
+            returned = "new " + centry->lookupName() + "(" + var_name +");  // complex entry";
+    }
+
+    return returned;
+}
+
+void CppImplGenerator::writeOriginalMetaObjectFunction(QTextStream &s, const AbstractMetaClass *java_class)
+{
+    Q_ASSERT(java_class->isQObject());
+
+    s << jni_function_signature(java_class->package(),
+                                java_class->name(),
+                                "originalMetaObject",
+                                "jlong");
+
+    s << endl
+      << "(JNIEnv *," << endl
+      << " jclass)" << endl
+      << "{" << endl;
+    {
+        Indentation indent(INDENT);
+        s << INDENT << "return reinterpret_cast<jlong>(&" << java_class->qualifiedCppName() << "::staticMetaObject);" << endl;
+    }
+    s << "}" << endl << endl;
+}
+
+void CppImplGenerator::writeFromNativeFunction(QTextStream &s, const AbstractMetaClass *java_class)
+{
+    s << jni_function_signature(java_class->package(),
+                                java_class->name(),
+                                "fromNativePointer",
+                                "jobject");
+    s << endl
+      << "(JNIEnv *__jni_env," << endl
+      << " jclass," << endl
+      << " jobject nativePointer)" << endl
+      << "{" << endl;
+    {
+        Indentation indent(INDENT);
+        s << INDENT << "void *ptr = qtjambi_to_cpointer(__jni_env, nativePointer, 1);" << endl
+            << INDENT << "return " << fromObject(java_class->typeEntry(), "ptr") << endl
+          << "}" << endl;
+    }
+}
+
+void CppImplGenerator::writeFromArrayFunction(QTextStream &s, const AbstractMetaClass *java_class)
+{
+    s << jni_function_signature(java_class->package(),
+                                java_class->name(),
+                                "nativePointerArray",
+                                "jobject");
+    s << endl
+      << "(JNIEnv *__jni_env," << endl
+      << " jclass," << endl
+      << " jobjectArray array)" << endl
+      << "{" << endl;
+    {
+        Indentation indent(INDENT);
+        s << INDENT << "return qtjambi_array_to_nativepointer(__jni_env, " << endl
+          << INDENT << "                                     array, " << endl
+          << INDENT << "                                     sizeof("
+                    << java_class->qualifiedCppName() << "));" << endl;
+    }
+    s << "}" << endl;
+}
+
+
+void CppImplGenerator::writeInterfaceCastFunction(QTextStream &s,
+                                                  const AbstractMetaClass *java_class,
+                                                  const AbstractMetaClass *interface)
+{
+    Q_ASSERT(interface->isInterface());
+    const InterfaceTypeEntry *ie = static_cast<const InterfaceTypeEntry *>(interface->typeEntry());
+    QString interface_name = ie->origin()->targetLangName();
+
+    s << endl
+      << jni_function_signature(java_class->package(),
+                                java_class->name(),
+                                QString("__qt_cast_to_%1").arg(interface_name),
+                                "jlong",
+                                "__J");
+
+    s << endl
+      << "(JNIEnv *," << endl
+      << " jobject," << endl
+      << " jlong ptr)" << endl
+      << "{" << endl
+      << "    return (jlong) (" << interface->primaryInterfaceImplementor()->qualifiedCppName() << " *) "
+      << "(" << java_class->qualifiedCppName() << " *) ptr;" << endl
+      << "}" << endl;
+}
+
+bool CppImplGenerator::writeConversionRule(QTextStream &s,
+                                           TypeSystem::Language target_language,
+                                           const AbstractMetaFunction *java_function,
+                                           int argument_index,
+                                           const QString &qt_name,
+                                           const QString &java_name)
+{
+    if (argument_index < 0 || java_function == 0)
+        return false;
+
+    QString conversion_rule = java_function->conversionRule(target_language, argument_index);
+
+    if (!conversion_rule.isEmpty()) {
+        QString qt_name_var;
+        QString java_name_var;
+
+        if ((argument_index == 0 && target_language == TypeSystem::NativeCode)
+             || (argument_index != 0 && target_language == TypeSystem::ShellCode)) {
+            qt_name_var = "%in";
+            java_name_var = "%out";
+        } else {
+            qt_name_var = "%out";
+            java_name_var = "%in";
+        }
+
+        conversion_rule  = conversion_rule.replace(qt_name_var, qt_name)
+                                          .replace(java_name_var, java_name);
+
+        AbstractMetaArgumentList arguments = java_function->arguments();
+        for (int i=0; i<arguments.size(); ++i) {
+            conversion_rule = conversion_rule.replace("%" + QString::number(i+1),
+                                                      arguments.at(i)->indexedName());
+        }
+
+        QStringList lines = conversion_rule.split("\n");
+        foreach (QString line, lines) {
+            s << INDENT << line.trimmed() << endl;
+        }
+
+        return true;
+    } else {
+        return false;
+    }
+}
+
+
+void CppImplGenerator::writeJavaToQt(QTextStream &s,
+                                     const AbstractMetaClass *java_class,
+                                     const AbstractMetaType *function_return_type,
+                                     const QString &qt_name,
+                                     const QString &java_name,
+                                     const AbstractMetaFunction *java_function,
+                                     int argument_index)
+{
+    // Conversion to C++: Shell code for return values, native code for arguments
+    TypeSystem::Language lang = argument_index == 0 ? TypeSystem::ShellCode : TypeSystem::NativeCode;
+    if (writeConversionRule(s, lang, java_function, argument_index, qt_name, java_name))
+        return;
+
+    s << INDENT << shellClassName(java_class) << " *" << qt_name << " = ("
+      << shellClassName(java_class) << " *) ";
+    if (java_class->isQObject())
+        s << "qtjambi_to_qobject";
+    else
+        s << "qtjambi_to_object";
+    s << "(__jni_env, " << java_name << ");" << endl;
+    if (java_class->isQObject()) {
+        // ### throw exceptions when objects are null...
+        s << INDENT << "if (!" << qt_name << ") "
+          << default_return_statement_java(function_return_type) << ";"  << endl << endl;
+    }
+}
+
+
+void CppImplGenerator::writeJavaToQt(QTextStream &s,
+                                     const AbstractMetaType *java_type,
+                                     const QString &qt_name,
+                                     const QString &java_name,
+                                     const AbstractMetaFunction *java_function,
+                                     int argument_index,
+                                     Option options)
+{
+    // Conversion to C++: Shell code for return values, native code for arguments
+    TypeSystem::Language lang = argument_index == 0 ? TypeSystem::ShellCode : TypeSystem::NativeCode;
+    if (java_function && writeConversionRule(s, lang, java_function, argument_index, qt_name, java_name))
+        return;
+
+    if (java_type == 0) {
+        QString warn = QString("no conversion possible for argument '%1' in function '%2::%3' for "
+                               "language '%4'")
+                               .arg(argument_index)
+                               .arg(java_function->implementingClass()->name())
+                               .arg(java_function->name())
+                               .arg(int(lang));
+        ReportHandler::warning(warn);
+        return;
+    }
+    if (java_type->name() == "QModelIndex") {
+        s << INDENT << "QModelIndex " << qt_name << " = qtd_to_QModelIndex("
+                << java_name << ");" << endl;
+    } else if (java_type->typeEntry()->isStructInD()) {
+        // empty
+    } else if (java_type->typeEntry() && java_type->typeEntry()->qualifiedCppName() == "QString") {
+        s << INDENT << "QString " << qt_name
+          << " = " << "QString::fromUtf8(" << java_name << ", " << java_name << "_size);" << endl;
+    } else if (java_type->isJObjectWrapper()) {
+        s << INDENT << "JObjectWrapper " << qt_name
+          << " = qtjambi_to_jobjectwrapper(__jni_env, " << java_name << ");" << endl;
+    } else if (java_type->isVariant()) {
+        s << INDENT << "QVariant " << qt_name
+          << " = " << java_name << " == NULL ? QVariant() : QVariant(*" << java_name << ");" << endl;
+    } else if (java_type->isArray() && java_type->arrayElementType()->isPrimitive()) {
+        AbstractMetaType *elementType = java_type->arrayElementType();
+
+        // ### Don't assert on wrong array lengths
+        s << INDENT << "Q_ASSERT(__jni_env->GetArrayLength((jarray) " << java_name << ") == " << java_type->arrayElementCount() << ");" << endl;
+        s << INDENT;
+        writeTypeInfo(s, elementType);
+        s << " " << qt_name << "[" << java_type->arrayElementCount() << "];" << endl;
+
+        s << INDENT << "__jni_env->" << getXxxArrayRegion(elementType) << "( (" << translateType(java_type, options)
+          << ")" << java_name << ", 0, " << java_type->arrayElementCount() << ", "
+          << "(" << translateType(elementType, options) << " *" << ")"
+          << qt_name << ");" << endl;
+
+    } else if (java_type->isArray()) {
+        AbstractMetaType *elementType = java_type->arrayElementType();
+
+        s << INDENT << "Q_ASSERT(__jni_env->GetArrayLength((jarray) " << java_name << ") == " << java_type->arrayElementCount() << ");" << endl;
+        writeTypeInfo(s, elementType);
+        s << "[" << java_type->arrayElementCount() << "]" << qt_name << ";" << endl;
+
+        for (int i=0; i<java_type->arrayElementCount(); ++i) {
+            writeJavaToQt(s, elementType, qt_name + "[" + QString::number(i) + "]",
+                "__jni_env->GetObjectArrayElement(" + java_name + ", " + QString::number(i) + ")", 0, -1, options);
+        }
+
+    } else if (java_type->isTargetLangString()) {
+        s << INDENT << "QString " << qt_name
+          << " = " << "QString::fromUtf8(" << java_name << ", " << java_name << "_size);" << endl;
+// qtd          << " =  qtjambi_to_qstring(__jni_env, (jstring) " << java_name << ");" << endl;
+
+    } else if (java_type->isTargetLangChar()) {
+        s << INDENT << "QChar " << qt_name
+          << " = (ushort)" << java_name << ";" << endl;
+
+    } else if (java_type->isEnum() || java_type->isFlags()) {
+
+        bool written = false;
+        if (java_type->isEnum()) {
+            AbstractMetaEnum *java_enum =
+                m_classes.findEnum(static_cast<const EnumTypeEntry *>(java_type->typeEntry()));
+            if (java_enum && !java_enum->isPublic()) {
+
+                s << INDENT << "int " << qt_name << " = ";
+                written = true;
+            }
+        }
+
+        if (!written) {
+            QString qualified_name = java_type->typeEntry()->qualifiedCppName();
+            s << INDENT << qualified_name << " " << qt_name
+              << " = (" << qualified_name << ") ";
+        }
+
+        if ((options & EnumAsInts) == 0 && (java_type->isTargetLangEnum() || java_type->isTargetLangFlags())) {
+            s << "qtjambi_to_enumerator(__jni_env, " << java_name << ");" << endl;
+
+        } else if (options & BoxedPrimitive) {
+            const PrimitiveTypeEntry *pentry = TypeDatabase::instance()->findTargetLangPrimitiveType("int");
+            Q_ASSERT(pentry);
+
+            s << java_name << ";" << endl;
+
+        } else {
+            s << java_name << ';' << endl;
+        }
+
+    } else if (java_type->isContainer()) {
+        writeJavaToQtContainer(s, java_type, qt_name, java_name, 0, -1);
+
+    } else if (java_type->isThread()) {
+        s << INDENT << "QThread *" << qt_name << " = qtjambi_to_thread(__jni_env, " << java_name
+          << ");" << endl;
+
+    } else if (java_type->typeEntry()->isCustom()) {
+        const CustomTypeEntry *custom_type =
+            static_cast<const CustomTypeEntry *>(java_type->typeEntry());
+        s << INDENT;
+        custom_type->generateCppJavaToQt(s, java_type, "__jni_env", qt_name, java_name);
+        s << ";" << endl;
+
+    } else {
+
+        const TypeEntry *type = java_type->typeEntry();
+        QString class_name = type->name();
+        QString qualified_class_name = fixCppTypeName(type->qualifiedCppName());
+
+        // Declaration and the c-cast
+        s << INDENT;
+        writeTypeInfo(s, java_type);
+        s << ' ' << qt_name << " = (";
+        writeTypeInfo(s, java_type);
+        s << ") ";
+
+        if (java_type->isPrimitive()) {
+            if (options & BoxedPrimitive) {
+                const PrimitiveTypeEntry *pentry = static_cast<const PrimitiveTypeEntry *>(type);
+//std::cout << "---error_here " << type->targetLangName().toStdString() << " \n";
+//std::cout << "----func_here " << java_function->marshalledName().toStdString() << " \n";
+
+                if (!pentry->preferredConversion())
+                    pentry = TypeDatabase::instance()->findTargetLangPrimitiveType(pentry->targetLangName());
+                Q_ASSERT(pentry);
+
+                s << java_name << ";" << endl;
+
+            } else if ((options & GlobalRefJObject) && type->jniName() == QLatin1String("jobject")) {
+                s << "__jni_env->NewGlobalRef(" << java_name << ");" << endl;
+            } else {
+                s << java_name << ';' << endl;
+            }
+
+#if 0
+        } else if (java_type->isEnum()) {
+            s << "qtjambi_to_enum(__jni_env, " << java_name << ");" << endl;
+#endif
+
+        } else if ((java_type->isQObject() || java_type->isObject())
+                   && static_cast<const ObjectTypeEntry *>(type)->designatedInterface()) {
+/* qtd           const InterfaceTypeEntry *ie =
+                static_cast<const ObjectTypeEntry *>(type)->designatedInterface();
+            s << "qtjambi_to_interface(__jni_env, ";
+
+            // This cast is only valid if we're dealing with a native id
+            if ((options & UseNativeIds) == UseNativeIds)
+                s << "(QtJambiLink *)";
+*/
+            s << java_name << ";" << endl;
+/* qtd
+            s << "\"" << ie->targetLangName() << "\", \""
+              << ie->javaPackage().replace(".", "/") << "/\", "
+              << "\"__qt_cast_to_" << type->targetLangName() << "\");" << endl;
+*/
+        } else if (java_type->isObject() || java_type->isQObject() || java_type->isNativePointer()) {
+            if (java_type->isReference()) {
+                s << "* (" << qualified_class_name << " "
+                  << QString(java_type->actualIndirections(), '*') << ") ";
+            }
+
+            if (java_type->isNativePointer()) {
+/* qtd                s << "qtjambi_to_cpointer("
+                << "__jni_env, "
+                << java_name << ", "
+                << java_type->actualIndirections() << ");" << endl; */
+                s << java_name << ";" << endl; // qtd
+            }/* qtd else if (java_type->isQObject()) {
+                if ((options & UseNativeIds) == 0)
+                    s << "qtjambi_to_qobject(__jni_env, ";
+                else
+                    s << "qtjambi_from_jlong(";
+                s << java_name;
+                s << ");" << endl;
+            }*/ else {
+/* qtd                if ((options & UseNativeIds) == 0)
+                    s << "qtjambi_to_object(__jni_env, ";
+                else
+                    s << "qtjambi_from_jlong(";
+*/                s << java_name;
+                s << ";" << endl; // +
+// qtd                s << ");" << endl;
+            }
+
+        } else {
+            // Return values...
+            if (argument_index == 0) {
+                s << "(" << java_name << " != 0 ? *(" << qualified_class_name << " *)";
+/* qtd                if ((options & UseNativeIds) == 0)
+                    s << "qtjambi_to_object(__jni_env, ";
+                else
+                    s << "qtjambi_from_jlong(";
+*/                s << java_name;
+                s << " : " << qualified_class_name << "());" << endl;
+            } else {
+                s << "*"
+                  << "(" << qualified_class_name << " *)";
+                bool null_check = false;
+/* qtd               if ((options & UseNativeIds) == 0) {
+                    s << "qtjambi_to_object(__jni_env, ";
+                } else if (hasDefaultConstructor(java_type)) {
+                    null_check = true;
+                    s << "(" << java_name << " != 0 ? qtjambi_from_jlong(";
+                } else {
+                    s << "qtjambi_from_jlong(";
+                }
+*/                s << java_name;
+// qtd                s << ")";
+
+                if (null_check)
+                    s << " : default_" << QString(qualified_class_name).replace("::", "_") << "())";
+                s << ";" << endl;
+            }
+
+        }
+    }
+// qtd    s << INDENT << "QTJAMBI_EXCEPTION_CHECK(__jni_env);" << endl;
+}
+
+static int nativePointerType(const AbstractMetaType *java_type)
+{
+    Q_ASSERT(java_type);
+    Q_ASSERT(java_type->isNativePointer());
+
+    if (!java_type->typeEntry()->isPrimitive())
+        return PointerType;
+
+    if (java_type->indirections() > 1)
+        return PointerType;
+
+    static QHash<QString, int> types;
+    if (types.isEmpty()) {
+        types["boolean"] = BooleanType;
+        types["byte"] = ByteType;
+        types["char"] = CharType;
+        types["short"] = ShortType;
+        types["int"] = IntType;
+        types["long"] = LongType;
+        types["float"] = FloatType;
+        types["double"] = DoubleType;
+    }
+
+    QString targetLangName = java_type->typeEntry()->targetLangName();
+    if (!types.contains(targetLangName))
+        return PointerType;
+
+    return types[targetLangName];
+}
+
+void CppImplGenerator::writeQtToJava(QTextStream &s,
+                                     const AbstractMetaType *java_type,
+                                     const QString &qt_name,
+                                     const QString &java_name,
+                                     const AbstractMetaFunction *java_function,
+                                     int argument_index,
+                                     Option option)
+{
+
+    // Conversion to Java: Native code for return values, shell code for arguments
+    TypeSystem::Language lang = argument_index == 0 ? TypeSystem::NativeCode : TypeSystem::ShellCode;
+/* qtd    if (java_function && writeConversionRule(s, lang, java_function, argument_index, qt_name, java_name))
+        return;
+*/
+    if (java_type == 0) {
+        QString warn = QString("no conversion possible for argument '%1' in function '%2::%3' for "
+                               "language '%4'")
+                               .arg(argument_index)
+                               .arg(java_function->implementingClass()->name())
+                               .arg(java_function->name())
+                               .arg(int(lang));
+        ReportHandler::warning(warn);
+        return;
+    }
+
+    if (java_type->name() == "QModelIndex") {
+        QString prefix = "*";
+        if (option & BoxedPrimitive)
+            s << INDENT << "QModelIndexAccessor tmp_index = qtd_from_QModelIndex(" << qt_name << ");" << endl
+                    << INDENT << "QModelIndexAccessor *" << java_name << " = &tmp_index;" << endl;
+        else
+            s << INDENT << "*" << java_name << " = qtd_from_QModelIndex(" << qt_name << ");" << endl;
+
+    } else if(java_type->typeEntry()->isStructInD()) {
+        s << INDENT << java_type->typeEntry()->name() << " *" << java_name << " = (" << java_type->typeEntry()->name() << " *) &"
+                << qt_name << ";" << endl; // do nothing
+    } else if (java_type->isArray() && java_type->arrayElementType()->isPrimitive()) {
+        AbstractMetaType *elementType = java_type->arrayElementType();
+
+        s << INDENT << translateType(java_type, option) << " " << java_name << " = __jni_env->" << newXxxArray(elementType)
+          << "(" << java_type->arrayElementCount() << ");" << endl;
+
+        s << INDENT << "__jni_env->" << setXxxArrayRegion(elementType) << "("
+          << "(" << translateType(java_type, option) << ")" << java_name
+          << ", 0, " << java_type->arrayElementCount() << ", "
+          << "(" << translateType(elementType, option) << " *" << ")"
+          << qt_name << ");" << endl;
+
+    } else if (java_type->isArray()) {
+        AbstractMetaType *elementType = java_type->arrayElementType();
+
+        s << INDENT << "jobject " << java_name << " = __jni_env->NewObjectArray("
+          << java_type->arrayElementCount() << ");" << endl;
+
+        s << "jobject __qt_element = 0;";
+
+        for (int i=0; i<java_type->arrayElementCount(); ++i) {
+            writeQtToJava(s, elementType, qt_name + "[" + QString::number(i) + "]",
+                "__qt_element", 0, -1, option);
+            s << "__jni_env->SetObjectArrayElement((jobjectArray) " << java_name << ", "
+              << i << ", __qt_element);" << endl;
+        }
+
+    } else if (java_type->isPrimitive()) {
+        const PrimitiveTypeEntry *type =
+                static_cast<const PrimitiveTypeEntry *>(java_type->typeEntry());
+
+        Q_ASSERT(type);
+        QString ret_val;
+        if (java_function)
+            ret_val = jniReturnName(java_function);
+        else
+            ret_val = fixCppTypeName(java_type->typeEntry()->qualifiedCppName());
+        s << INDENT << ret_val <<  " " << java_name << " = " << qt_name << ";" << endl;
+    } else if (java_type->isJObjectWrapper()) {
+        s << INDENT << "jobject " << java_name << " = qtjambi_from_jobjectwrapper(__jni_env, "
+          << qt_name << ");" << endl;
+    } else if (java_type->isVariant()) {
+        s << INDENT << "QVariant *" << java_name
+          << " = new QVariant(" << qt_name << ");" << endl;
+
+    } else if (java_type->isTargetLangString()) {
+
+//        if (option & BoxedPrimitive)
+        s << INDENT << "_d_toUtf8(" << qt_name << ".utf16(), "
+          << qt_name << ".size(), " << java_name << ");" << endl;
+
+    } else if (java_type->isTargetLangChar()) {
+        s << INDENT << "jchar " << java_name << " = " << qt_name << ".unicode();" << endl;
+
+    } else if (java_type->isIntegerEnum() || java_type->isIntegerFlags()
+               || ((option & EnumAsInts) && (java_type->isEnum() || java_type->isFlags()))) {
+//     } else if (java_type->isEnum() || java_type->isFlags()) {
+
+//         if (option & EnumAsInts) {
+//             qDebug() << java_type->name() << "should be int...";
+//         }
+
+/*        if (option & BoxedPrimitive) {
+            s << INDENT << "jobject " << java_name << " = qtjambi_from_int(__jni_env, "
+            << qt_name << ");" << endl;
+        } else */{
+            s << INDENT << "int " << java_name << " = " << qt_name << ";" << endl;
+        }
+
+    } else if (java_type->isTargetLangEnum()) {
+        Q_ASSERT((option & EnumAsInts) == 0);
+        const EnumTypeEntry *et = static_cast<const EnumTypeEntry *>(java_type->typeEntry());
+        s << INDENT << "int " << java_name << " = " << qt_name << ";" << endl;
+
+    } else if (java_type->isTargetLangFlags()) {
+        Q_ASSERT((option & EnumAsInts) == 0);
+        const FlagsTypeEntry *ft = static_cast<const FlagsTypeEntry *>(java_type->typeEntry());
+        s << INDENT << "jobject " << java_name << " = qtjambi_from_flags(__jni_env, "
+          << qt_name << ", \"" << ft->javaPackage().replace('.', '/') << '/'
+          << ft->originator()->javaQualifier() << '$' << ft->targetLangName() << "\");" << endl;
+
+    } else if (java_type->isContainer()) {
+        writeQtToJavaContainer(s, java_type, qt_name, java_name, 0, -1);
+
+    } else if (java_type->isThread()) {
+        s << INDENT << "jobject " << java_name << " = qtjambi_from_thread(__jni_env, " << qt_name
+          << ");" << endl;
+
+    } else if (!java_type->isNativePointer() && java_type->typeEntry()->isCustom()) {
+        s << INDENT;
+        static_cast<const CustomTypeEntry *>(java_type->typeEntry())
+            ->generateCppQtToJava(s, java_type, "__jni_env", qt_name, java_name);
+        s << ";" << endl;
+
+    } else {
+        QString return_type;
+        if (java_function)
+            return_type = jniReturnName(java_function);
+        else {
+            return_type = jniReturnType(java_type);
+            return_type = fixCppTypeName(return_type);
+//            return_type = fixCppTypeName(java_type->typeEntry()->qualifiedCppName());
+        }
+/*        if( (java_type->isValue() && !java_type->typeEntry()->isStructInD())
+            || java_type->isObject() )
+            s << INDENT << return_type << " *" << java_name << " = (" << return_type << "*) ";
+        else*/
+            s << INDENT << return_type << " " << java_name << " = (" << return_type << ") ";
+
+        if (java_type->isQObject()) {
+/* qtd            s << "qtjambi_from_qobject(__jni_env, " << "(QObject *) ";
+
+            if (java_type->isReference() && java_type->indirections() == 0)
+                s << "&";
+
+            s << qt_name
+              << ", \"" << java_type->typeEntry()->lookupName() << "\""
+              << ", \"" << java_type->package().replace(".", "/") << "/\""
+              << ");" << endl;
+*/
+            s << qt_name << ";" << endl;
+
+#if 0
+        } else if (java_type->isEnum()) {
+
+            const EnumTypeEntry *et = static_cast<const EnumTypeEntry *>(java_type->typeEntry());
+            s << "qtjambi_from_enum(__jni_env, " << qt_name << ", \""
+              << et->javaQualifier() << "$" << et->targetLangName() << "\");" << endl;
+#endif
+        } else if (java_type->isNativePointer()) {
+/* qtd            s << "qtjambi_from_cpointer(__jni_env, ";
+            if (java_type->isReference())
+                s << "&";
+            s << qt_name << ", " << nativePointerType(java_type) << ", "
+              << java_type->actualIndirections() << ");" << endl;
+*/
+            if (java_type->isReference())
+                s << "&";
+            s << qt_name << ";" << "// qtjambi_from_cpointer" << endl;
+        } else if (java_type->isValue()) {
+// qtd            s << fromObject(java_type->typeEntry(), "&" + qt_name) << endl;
+            s << "new " << java_type->typeEntry()->qualifiedCppName() << "(" << qt_name << ");" << endl;
+        } else {
+// qtd            s << fromObject(java_type->typeEntry(),
+// qtd                            (java_type->isReference() ? "&" : "") + qt_name) << endl;
+            s << qt_name << ";" << endl;
+        }
+    }
+
+}
+
+QString CppImplGenerator::getTypeName(const TypeEntry *entry, Option option)
+{
+    if(entry->isEnum() && (option & EnumAsInts))
+        return "int";
+
+    return entry->lookupName();
+}
+
+void CppImplGenerator::writeQtToJavaContainer(QTextStream &s,
+                                              const AbstractMetaType *java_type,
+                                              const QString &qt_name,
+                                              const QString &java_name,
+                                              const AbstractMetaFunction *java_function,
+                                              int argument_index)
+{
+    // Language for conversion to Java: Native code for return values and Shell code for arguments
+    TypeSystem::Language lang = argument_index == 0 ? TypeSystem::NativeCode : TypeSystem::ShellCode;
+    if (java_function && writeConversionRule(s, lang, java_function, argument_index, qt_name, java_name))
+        return;
+
+    if (java_type == 0) {
+        QString warn = QString("no conversion possible for argument '%1' in function '%2::%3' for "
+                               "language '%4'")
+                               .arg(argument_index)
+                               .arg(java_function->implementingClass()->name())
+                               .arg(java_function->name())
+                               .arg(int(lang));
+        ReportHandler::warning(warn);
+        return;
+    }
+
+    Q_ASSERT(java_type->isContainer());
+    const ContainerTypeEntry *type =
+        static_cast<const ContainerTypeEntry *>(java_type->typeEntry());
+
+    if (type->type() == ContainerTypeEntry::ListContainer
+        || type->type() == ContainerTypeEntry::VectorContainer
+        || type->type() == ContainerTypeEntry::StringListContainer
+        || type->type() == ContainerTypeEntry::LinkedListContainer
+        || type->type() == ContainerTypeEntry::StackContainer
+        || type->type() == ContainerTypeEntry::SetContainer
+        || type->type() == ContainerTypeEntry::QueueContainer) {
+
+        Q_ASSERT(java_type->instantiations().size() == 1);
+        AbstractMetaType *targ = java_type->instantiations().first();
+
+        QString cls_name = getTypeName(targ->typeEntry(), EnumAsInts);
+        cls_name.remove("_ConcreteWrapper");
+
+        s << endl
+          << INDENT;
+
+        switch (type->type()) {
+        case ContainerTypeEntry::LinkedListContainer:
+        case ContainerTypeEntry::QueueContainer:
+            s << "qtjambi_linkedlist_new(__jni_env)";
+            break;
+        case ContainerTypeEntry::StackContainer:
+            s << "qtjambi_stack_new(__jni_env)";
+            break;
+        case ContainerTypeEntry::SetContainer:
+            s << "qtjambi_hashset_new(__jni_env)";
+            break;
+        default:
+            s << "qtd_allocate_" << cls_name
+              << "_array(" << java_name << ", " << qt_name << ".size())";
+            break;
+        }
+
+        s << ";" << endl
+          << INDENT;
+
+
+        writeTypeInfo(s, java_type, ForceValueType);
+        s << "::const_iterator " << qt_name << "_end_it = " << qt_name << ".constEnd();" << endl
+          << INDENT << "int i = 0;" << endl
+          << INDENT;
+        s << "for (";
+        writeTypeInfo(s, java_type, ForceValueType);
+        s << "::const_iterator " << qt_name << "_it = " << qt_name << ".constBegin(); "
+          << qt_name << "_it != " << qt_name << "_end_it; ++" << qt_name << "_it) {" << endl;
+        {
+            Indentation indent(INDENT);
+            s << INDENT;
+            writeTypeInfo(s, targ);
+            s << " __qt_tmp = *" << qt_name << "_it;" << endl;
+
+            if(targ->isTargetLangString())
+                s << INDENT << "void *__java_tmp = qtd_string_from_array(" << java_name << ", i);" << endl;
+
+            writeQtToJava(s, targ, "__qt_tmp", "__java_tmp", 0, -1, BoxedPrimitive);
+
+            s << INDENT << "qtd_assign_" << cls_name << "_array_element(" << java_name << ", i, __java_tmp);" << endl;
+            s << INDENT << "++i;" << endl;
+        }
+        s << INDENT << "}" << endl;
+
+    } else if (type->type() == ContainerTypeEntry::PairContainer) {
+        QList<AbstractMetaType *> args = java_type->instantiations();
+        Q_ASSERT(args.size() == 2);
+
+        s << INDENT << "jobject " << java_name << ";" << endl
+          << INDENT << "{" << endl;
+        {
+            Indentation indent(INDENT);
+            writeQtToJava(s, args.at(0), qt_name + ".first", "__java_tmp_first", 0, -1, BoxedPrimitive);
+            writeQtToJava(s, args.at(1), qt_name + ".second", "__java_tmp_second", 0, -1, BoxedPrimitive);
+            s << INDENT << java_name << " = qtjambi_pair_new(__jni_env, "
+              << "__java_tmp_first, __java_tmp_second);" << endl;
+        }
+
+        s << INDENT << "}" << endl;
+
+    } else if (type->type() == ContainerTypeEntry::MultiMapContainer) {
+
+        Q_ASSERT(java_type->instantiations().size() == 2);
+        AbstractMetaType *targ_key = java_type->instantiations().at(0);
+        AbstractMetaType *targ_val = java_type->instantiations().at(1);
+
+        s << endl
+          << INDENT << "jobject " << java_name << " = qtjambi_treemap_new(__jni_env, " << qt_name << ".keys().size());" << endl
+          << INDENT << "QList<";
+        writeTypeInfo(s, targ_key);
+        s << "> __qt_keys = " << qt_name << ".keys();" << endl
+          << INDENT << "for (int i=0; i<__qt_keys.size(); ++i) {" << endl;
+        {
+            Indentation indent(INDENT);
+
+            s << INDENT;
+            writeTypeInfo(s, targ_key);
+            s << " __qt_tmp_key = __qt_keys.at(i);" << endl;
+            writeQtToJava(s, targ_key, "__qt_tmp_key", "__java_tmp_key", 0, -1, BoxedPrimitive);
+
+            s << INDENT << "QList<";
+            writeTypeInfo(s, targ_val);
+            s << "> __qt_values = " << qt_name << ".values(__qt_tmp_key);" << endl
+              << INDENT << "jobject __java_value_list = qtjambi_arraylist_new(__jni_env, __qt_values.size());" << endl
+              << INDENT << "for (int j=0; j<__qt_values.size(); ++j) {" << endl;
+            {
+                Indentation indent(INDENT);
+
+                s << INDENT;
+                writeTypeInfo(s, targ_val);
+                s << " __qt_tmp_val = __qt_values.at(j);" << endl;
+                writeQtToJava(s, targ_val, "__qt_tmp_val", "__java_tmp_val", 0, -1, BoxedPrimitive);
+
+                s << INDENT << "qtjambi_collection_add(__jni_env, __java_value_list, __java_tmp_val);" << endl;
+            }
+            s << INDENT << "}" << endl
+              << INDENT << "qtjambi_map_put(__jni_env, " << java_name << ", __java_tmp_key, __java_value_list);" << endl;
+        }
+        s << INDENT << "}" << endl;
+
+    } else if (type->type() == ContainerTypeEntry::MapContainer
+               || type->type() == ContainerTypeEntry::HashContainer) {
+        QString constructor = type->type() == ContainerTypeEntry::MapContainer
+                              ? "qtjambi_treemap_new"
+                              : "qtjambi_hashmap_new";
+
+        Q_ASSERT(java_type->instantiations().size() == 2);
+        AbstractMetaType *targ_key = java_type->instantiations().at(0);
+        AbstractMetaType *targ_val = java_type->instantiations().at(1);
+
+        s << endl
+          << INDENT << "jobject " << java_name << " = " << constructor << "(__jni_env, " << qt_name
+          << ".size());" << endl
+          << INDENT;
+        writeTypeInfo(s, java_type, Option(ExcludeReference | ExcludeConst));
+        s << "::const_iterator it;" << endl
+          << INDENT << "for (it=" << qt_name << ".constBegin(); it!=" << qt_name << ".constEnd(); ++it) {" << endl;
+        {
+            Indentation indent(INDENT);
+            s << INDENT;
+            writeTypeInfo(s, targ_key);
+            s << " __qt_tmp_key = it.key();" << endl
+              << INDENT;
+            writeTypeInfo(s, targ_val);
+            s << " __qt_tmp_val = it.value();" << endl;
+            writeQtToJava(s, targ_key, "__qt_tmp_key", "__java_tmp_key", 0, -1, BoxedPrimitive);
+            writeQtToJava(s, targ_val, "__qt_tmp_val", "__java_tmp_val", 0, -1, BoxedPrimitive);
+            s << INDENT << "qtjambi_map_put(__jni_env, " << java_name
+              << ", __java_tmp_key, __java_tmp_val);" << endl;
+        }
+        s << INDENT << "}" << endl;
+
+    } else {
+        ReportHandler::warning(QString("unable to generate container type %1, type=%2")
+                               .arg(java_type->name()).arg(type->type()));
+    }
+
+// qtd    s << INDENT << "QTJAMBI_EXCEPTION_CHECK(__jni_env);" << endl;
+}
+
+
+void CppImplGenerator::writeJavaToQtContainer(QTextStream &s,
+                                              const AbstractMetaType *java_type,
+                                              const QString &qt_name,
+                                              const QString &java_name,
+                                              const AbstractMetaFunction *java_function,
+                                              int argument_index)
+{
+    // Conversion to C++: Shell code for return value, native code for arguments
+    TypeSystem::Language lang = argument_index == 0 ? TypeSystem::ShellCode : TypeSystem::NativeCode;
+    if (java_function && writeConversionRule(s, lang, java_function, argument_index, qt_name, java_name))
+        return;
+
+    if (java_type == 0) {
+        QString warn = QString("no conversion possible for argument '%1' in function '%2::%3' for "
+                               "language '%4'")
+                               .arg(argument_index)
+                               .arg(java_function->implementingClass()->name())
+                               .arg(java_function->name())
+                               .arg(int(lang));
+        ReportHandler::warning(warn);
+        return;
+    }
+
+
+    Q_ASSERT(java_type->isContainer());
+    const ContainerTypeEntry *type =
+        static_cast<const ContainerTypeEntry *>(java_type->typeEntry());
+
+    if (type->type() == ContainerTypeEntry::ListContainer
+        || type->type() == ContainerTypeEntry::VectorContainer
+        || type->type() == ContainerTypeEntry::StringListContainer
+        || type->type() == ContainerTypeEntry::LinkedListContainer
+        || type->type() == ContainerTypeEntry::StackContainer
+        || type->type() == ContainerTypeEntry::SetContainer
+        || type->type() == ContainerTypeEntry::QueueContainer) {
+        Q_ASSERT(java_type->instantiations().size() == 1);
+        AbstractMetaType *targ = java_type->instantiations().first();
+        QString elem_type = getTypeName(targ->typeEntry(), EnumAsInts);
+        elem_type.remove("_ConcreteWrapper");
+
+        s << INDENT;
+        writeTypeInfo(s, java_type, ForceValueType);
+        s << qt_name << ";" << endl;
+
+// qtd       s << INDENT << "if (" << java_name << " != 0) {" << endl;
+        {
+/* qtd           Indentation indent(INDENT);
+            s << INDENT << "jobjectArray __qt__array = qtjambi_collection_toArray(__jni_env, "
+              << java_name << ");" << endl
+              << INDENT << "jsize __qt__size = __jni_env->GetArrayLength(__qt__array);" << endl;
+*/
+            if (type->type() == ContainerTypeEntry::VectorContainer
+                || type->type() == ContainerTypeEntry::StackContainer)
+                s << INDENT << qt_name << ".reserve(" << java_name << "_size);" << endl;
+
+            s << INDENT << "for (int i=0; i<" << java_name << "_size; ++i) {" << endl;
+            {
+                Indentation indent(INDENT);
+                if(targ->isTargetLangString())
+                    s << INDENT << "char* __d_element;" << endl
+                      << INDENT << "size_t __d_element_size;" << endl
+                      << INDENT << "qtd_get_string_from_array(" << java_name << ", i, &__d_element, &__d_element_size);" << endl;
+                else {
+                    s << INDENT;
+                    writeTypeInfo(s, targ, Option(VirtualDispatch | ForcePointer));
+                    QString cast_string = "";
+                    const TypeEntry* centry = targ->typeEntry();
+                    if (centry->isComplex() && (centry->isObject() || centry->isValue() || centry->isInterface()))
+                        cast_string = "(void**)";
+                    s << "__d_element;" << endl
+                      << INDENT << "qtd_get_" << elem_type << "_from_array(" << java_name << ", i, &__d_element);" << endl;
+                }
+/* qtd                   s << INDENT << "jobject __d_element = "
+                      << "__jni_env->GetObjectArrayElement(__qt__array, i);" << endl;*/
+                writeJavaToQt(s, targ, "__qt_element", "__d_element", 0, -1, BoxedPrimitive);
+                QString cont_element = "__qt_element";
+                if(targ->typeEntry()->isStructInD() && targ->name() != "QModelIndex")
+                    cont_element = "__d_element";
+                s << INDENT << qt_name << " << " << cont_element << ";" << endl;
+            }
+// qtd            s << INDENT << "}" << endl;
+        }
+        s << INDENT << "}" << endl;
+    } else if (type->type() == ContainerTypeEntry::PairContainer) {
+        QList<AbstractMetaType *> targs = java_type->instantiations();
+        Q_ASSERT(targs.size() == 2);
+
+        s << INDENT;
+        writeTypeInfo(s, java_type, ForceValueType);
+        s << " " << qt_name << ";" << endl
+          << INDENT << "if (" << java_name << " != 0) {" << endl;
+        {
+            // separate scope required just in case function takes two QPair's.
+            Indentation indent(INDENT);
+            s << INDENT << "jobject __java_first = qtjambi_pair_get(__jni_env, "
+              << java_name << ", 0);" << endl;
+            writeJavaToQt(s, targs.at(0), "__qt_first", "__java_first", 0, -1, BoxedPrimitive);
+
+            s << INDENT << "jobject __java_second = qtjambi_pair_get(__jni_env, "
+              << java_name << ", 1);" << endl;
+            writeJavaToQt(s, targs.at(1), "__qt_second", "__java_second", 0, -1, BoxedPrimitive);
+
+            s << INDENT << qt_name << ".first = __qt_first;" << endl
+              << INDENT << qt_name << ".second = __qt_second;" << endl;
+        }
+        s << INDENT << "}" << endl;
+    } else if (type->type() == ContainerTypeEntry::MapContainer
+               || type->type() == ContainerTypeEntry::HashContainer) {
+        Q_ASSERT(java_type->instantiations().size() == 2);
+        AbstractMetaType *targ_key = java_type->instantiations().at(0);
+        AbstractMetaType *targ_val = java_type->instantiations().at(1);
+
+        s << INDENT;
+        writeTypeInfo(s, java_type, ForceValueType);
+        s << qt_name << ";" << endl;
+        s << INDENT << "if (" << java_name << " != 0) {" << endl;
+        {
+            Indentation indent(INDENT);
+            s << INDENT << "int __qt_list_size = qtjambi_map_size(__jni_env, " << java_name
+              << ");" << endl
+              << INDENT
+              << "jobjectArray __java_entry_set = qtjambi_map_entryset_array(__jni_env, " << java_name
+              << ");" << endl;
+
+            s << INDENT << "for (int i=0; i<__qt_list_size; ++i) {" << endl;
+            {
+                Indentation indent(INDENT);
+                s << INDENT
+                  << "QPair<jobject, jobject> __java_entry = "
+                  << "qtjambi_entryset_array_get(__jni_env, __java_entry_set, i);"
+                  << endl
+                  << INDENT << "jobject __java_key = __java_entry.first;" << endl
+                  << INDENT << "jobject __java_val = __java_entry.second;" << endl;
+                writeJavaToQt(s, targ_key, "__qt_key", "__java_key", 0, -1, BoxedPrimitive);
+                writeJavaToQt(s, targ_val, "__qt_val", "__java_val", 0, -1, BoxedPrimitive);
+                s << INDENT << qt_name << ".insert(__qt_key, __qt_val);" << endl;
+            }
+            s << INDENT << "}" << endl;
+        }
+        s << INDENT << "}" << endl;
+
+    } else {
+        ReportHandler::warning(QString("unable to generate container type %1, %2")
+                               .arg(java_type->name()).arg(type->type()));
+    }
+
+}
+
+
+void CppImplGenerator::writeFunctionCall(QTextStream &s, const QString &object_name,
+                                         const AbstractMetaFunction *java_function,
+                                         const QString &prefix,
+                                         Option option,
+                                         const QStringList &extra_arguments)
+{
+    QString function_name = option & OriginalName ? java_function->originalName() : java_function->name();
+
+    AbstractMetaClassList interfaces = java_function->implementingClass()->interfaces();
+
+    QString classPrefix;
+    if (prefix.isEmpty()
+        && !java_function->implementingClass()->interfaces().isEmpty()
+        && !java_function->implementingClass()->inheritsFrom(java_function->declaringClass())) {
+        classPrefix = java_function->declaringClass()->qualifiedCppName() + "::";
+    }
+
+    if (java_function->isInGlobalScope()) {
+
+        // Global scope stream operators need the arguments to be reordered (this ref at end)
+        // so we special case them in order to simplify this code
+        bool stream_operator = java_function->originalName() == "operator<<"
+                               || java_function->originalName() == "operator>>";
+
+        if (java_function->type() == 0)
+            s << "if (" << object_name << " != 0) ";
+        else
+            s << "(" << object_name << " != 0) ? ";
+        s << "::" << prefix << function_name << "(";
+        if (!stream_operator)
+            s << "*" << object_name << ", ";
+        writeFunctionCallArguments(s, java_function, "__qt_");
+        if (stream_operator)
+            s << ", *" << object_name;
+        s << ")";
+        if (java_function->type() != 0)
+            s << " : " << default_return_statement_qt(java_function->type(), Generator::Option(option | Generator::NoReturnStatement));
+        s << ";";
+    } else {
+        s << object_name << (java_function->isStatic() ? QLatin1String("::") : QLatin1String("->") + classPrefix)
+          << prefix << function_name << "(";
+        writeFunctionCallArguments(s, java_function, "__qt_");
+
+        // The extra arguments...
+        for (int i=0; i<extra_arguments.size(); ++i) {
+            if (i > 0 || java_function->arguments().size() != 0)
+                s << ", ";
+            s << extra_arguments.at(i);
+        }
+
+        s << ");";
+    }
+
+    s << endl;
+
+}
+
+
+void CppImplGenerator::writeFunctionCallArguments(QTextStream &s,
+                                                  const AbstractMetaFunction *java_function,
+                                                  const QString &prefix,
+                                                  Option options)
+{
+    AbstractMetaArgumentList arguments = java_function->arguments();
+
+    int written_arguments = 0;
+    const AbstractMetaClass *cls = java_function->ownerClass();
+    if (java_function->isConstructor() && cls->hasVirtualFunctions()) {
+        s << "d_ptr";
+        written_arguments++;
+    }
+    for (int i=0; i<arguments.size(); ++i) {
+        const AbstractMetaArgument *argument = arguments.at(i);
+        AbstractMetaType *a_type = argument->type();
+
+        if ((options & SkipRemovedArguments) == SkipRemovedArguments
+            && java_function->argumentRemoved(i+1)) {
+            continue;
+        }
+
+        if (written_arguments++ > 0) {
+            s << ", ";
+        }
+
+        bool enum_as_int = (options & EnumAsInts) && (argument->type()->typeEntry()->isEnum()
+                                                      || argument->type()->typeEntry()->isFlags());
+        if (a_type->isEnum()) {
+            AbstractMetaEnum *java_enum =
+                m_classes.findEnum(static_cast<const EnumTypeEntry *>(argument->type()->typeEntry()));
+            if (java_enum == 0) {
+                ReportHandler::warning(QString("enum not found: '%1'")
+                    .arg(argument->type()->typeEntry()->qualifiedCppName()));
+            } else {
+                enum_as_int |= !java_enum->isPublic();
+            }
+        }
+
+        if ( (options & VirtualDispatch)
+             && a_type->isContainer()) {
+            s << "__d_" << argument->indexedName();
+            continue;
+        }
+
+        if ((!(options & NoCasts) && !enum_as_int) || ((options & ForceEnumCast) && a_type->isEnum())) {
+
+            // If the type in the signature is specified without template instantiation, but the
+            // class is actually a template class, then we have troubles.
+            AbstractMetaClass *cls = classes().findClass(argument->type()->typeEntry()->qualifiedCppName());
+
+            if ( (options & VirtualDispatch) && !a_type->typeEntry()->isStructInD()
+                  && ( a_type->isValue()
+                       || (a_type->isReference() && (a_type->typeEntry()->isValue() || a_type->typeEntry()->isObject() || a_type->typeEntry()->isPrimitive()) && !a_type->isTargetLangString())
+                       ) )
+                s << "&";
+
+            if( (options & VirtualDispatch) && a_type->typeEntry()->isStructInD() && a_type->isReference())
+                s << "&";
+
+            if ( (options & VirtualDispatch)
+                 && ( a_type->isTargetLangString() || a_type->name() == "QModelIndex" ) )
+                ;
+            else if (cls == 0 || cls->templateArguments().size() == a_type->instantiations().size()) {
+                s << "(";
+                writeTypeInfo(s, a_type, options);
+                s << ")";
+            }
+        }
+
+        if (a_type->isNativePointer() && a_type->typeEntry()->name() == "QString" && !a_type->isReference())
+            s << "&";
+
+        if ( ( !a_type->isPrimitive()
+            || !java_function->conversionRule(TypeSystem::NativeCode, argument->argumentIndex()+1).isEmpty() )
+             && (!a_type->typeEntry()->isStructInD() || a_type->name() == "QModelIndex") ) {
+            s << prefix;
+        }
+
+        if (options & VirtualDispatch) {
+            if( argument->type()->isTargetLangString())
+                s << argument->indexedName() << ".utf16(), " << argument->indexedName() << ".size()";
+            else if (argument->type()->name() == "QModelIndex")
+                s << "qtd_from_QModelIndex(" << argument->indexedName() << ")";
+            else
+                s << argument->indexedName();
+        } else
+            s << argument->indexedName();
+    }
+}
+
+
+QString CppImplGenerator::translateType(const AbstractMetaType *java_type, Option option, bool d_export)
+{
+    if (!java_type)
+        return "void";
+
+    const TypeEntry *type = java_type->typeEntry();
+    QString class_name = type->name();
+    QString qualified_class_name = fixCppTypeName(type->qualifiedCppName());
+    QString d_name = qualified_class_name;
+    if (d_export)
+        d_name = type->lookupName();
+
+    if (java_type->isPrimitive()
+        || java_type->isTargetLangString()
+        || java_type->isVariant()
+        || java_type->isJObjectWrapper()
+        || java_type->isTargetLangChar()
+        || java_type->isArray()) {
+        return d_name;
+    } else if (java_type->isIntegerEnum() || java_type->isIntegerFlags()
+               || ((option & EnumAsInts) && (java_type->isEnum() || java_type->isFlags()))) {
+         return "int";
+     } else if (java_type->isReference()) {
+         if (java_type->typeEntry()->isValue())
+             return "void*";
+         else
+             return d_name + " "+ QString(java_type->actualIndirections(), '*');
+     } else if (java_type->isNativePointer()) {
+         if (java_type->typeEntry()->isValue())
+             return "void*";
+         else if (java_type->typeEntry()->isEnum() && d_export)
+             return "int" + QString(java_type->indirections(), '*');
+         else
+             return d_name + QString(java_type->indirections(), '*');
+     } else {
+         return d_name + QString(java_type->indirections(), '*');
+     }
+ }
+
+void CppImplGenerator::writeExtraIncludes(QTextStream &s, const AbstractMetaClass *java_class)
+{
+    IncludeList includes = java_class->typeEntry()->extraIncludes();
+    qSort(includes.begin(), includes.end());
+
+    int used = 0;
+    foreach (const Include &i, includes) {
+        if (i.type != Include::TargetLangImport) {
+            s << i.toString() << endl;
+            ++used;
+        }
+    }
+
+
+    if (used)
+        s << endl;
+
+}
+
+
+void CppImplGenerator::writeDefaultConstructedValues_helper(QSet<QString> &values,
+                                                            const AbstractMetaFunction *func)
+{
+    foreach (AbstractMetaArgument *arg, func->arguments()) {
+        AbstractMetaType *type = arg->type();
+        if (func->typeReplaced(arg->argumentIndex()+1).isEmpty() && type->isValue() && hasDefaultConstructor(type))
+            values << type->typeEntry()->qualifiedCppName();
+    }
+}
+
+
+void CppImplGenerator::writeDefaultConstructedValues(QTextStream &s, const AbstractMetaClass *java_class) {
+
+    QSet<QString> values;
+
+    // Class functions, more or less copied from the logic in write(Class) above...
+    AbstractMetaFunctionList class_funcs;
+
+    // Add normal final functions
+    foreach (AbstractMetaFunction *function, java_class->functionsInTargetLang()) {
+        if (!function->isEmptyFunction())
+            class_funcs << function;
+    }
+
+    // Add abstract functions, I think...
+    foreach (AbstractMetaFunction *function, java_class->queryFunctions(AbstractMetaClass::NormalFunctions
+                                                                        | AbstractMetaClass::AbstractFunctions
+                                                                        | AbstractMetaClass::NotRemovedFromTargetLang)) {
+        if (function->implementingClass() != java_class)
+            class_funcs << function;
+    }
+
+    // Signals (their c++ wrapper calls actually...)
+    class_funcs += java_class->queryFunctions(AbstractMetaClass::Signals);
+
+    //
+    foreach (AbstractMetaFunction *f, class_funcs) {
+        writeDefaultConstructedValues_helper(values, f);
+    }
+
+    foreach (AbstractMetaField *field, java_class->fields()) {
+        writeDefaultConstructedValues_helper(values, field->setter());
+    }
+
+    if (!values.isEmpty()) {
+        s << endl << endl
+          << "// Default constructed values used throughout final functions..." << endl;
+        for (QSet<QString>::const_iterator it = values.constBegin(); it != values.constEnd(); ++it) {
+            s << "Q_GLOBAL_STATIC(" << *it << ", default_" << QString(*it).replace("::", "_")
+              << ");" << endl;
+        }
+        s << endl << endl;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/cppimplgenerator.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,228 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#ifndef CPPIMPLGENERATOR_H
+#define CPPIMPLGENERATOR_H
+
+#include "cppgenerator.h"
+#include "metajava.h"
+
+enum JNISignatureFormat {
+    Underscores,        // Used in the jni exported function names
+    SlashesAndStuff     // Used for looking up functions through jni
+};
+
+QString jni_signature(const QString &full_name, JNISignatureFormat format);
+QString jni_signature(const AbstractMetaType *java_type, JNISignatureFormat format = Underscores);
+
+class CppImplGenerator : public CppGenerator
+{
+    Q_OBJECT
+
+public:
+    enum JNISignatureMode {
+        JNIExport       = 0x0001,
+        ReturnType      = 0x0002,
+        ExternC         = 0x0004,
+
+        StandardJNISignature = JNIExport | ReturnType | ExternC
+    };
+
+    CppImplGenerator(PriGenerator *pri)
+        : m_native_jump_table(false)
+    {
+        priGenerator = pri;
+    }
+
+    virtual QString fileNameForClass(const AbstractMetaClass *cls) const;
+
+    void write(QTextStream &s, const AbstractMetaClass *java_class);
+
+    static void writeExtraIncludes(QTextStream &s, const AbstractMetaClass *java_class);
+
+    void writeAssignment(QTextStream &s, const QString &destName, const QString &srcName,
+        const AbstractMetaType *java_type);
+    void writeSignalInitialization(QTextStream &s, const AbstractMetaClass *java_class);
+    void writeCodeInjections(QTextStream &s, const AbstractMetaFunction *java_function,
+        const AbstractMetaClass *implementor, CodeSnip::Position position, TypeSystem::Language language);
+    void writeExtraFunctions(QTextStream &s, const AbstractMetaClass *java_class);
+    void writeToStringFunction(QTextStream &s, const AbstractMetaClass *java_class);
+    void writeCloneFunction(QTextStream &s, const AbstractMetaClass *java_class);
+    void writeShellSignatures(QTextStream &s, const AbstractMetaClass *java_class);
+    void writeShellConstructor(QTextStream &s, const AbstractMetaFunction *java_function);
+    void writeShellDestructor(QTextStream &s, const AbstractMetaClass *java_class);
+    void writeSignalFunction(QTextStream &s, const AbstractMetaFunction *java_function,
+                             const AbstractMetaClass *implementor, int pos);
+    void writeShellFunction(QTextStream &s, const AbstractMetaFunction *java_function,
+                            const AbstractMetaClass *implementor, int pos);
+    void writeShellVirtualFunction(QTextStream &s, const AbstractMetaFunction *java_function,
+                                   const AbstractMetaClass *implementor, int pos);
+    void writePublicFunctionOverride(QTextStream &s,
+                                     const AbstractMetaFunction *java_function,
+                                     const AbstractMetaClass *java_class);
+    void writeVirtualFunctionOverride(QTextStream &s,
+                                      const AbstractMetaFunction *java_function,
+                                      const AbstractMetaClass *java_class);
+    void writeBaseClassFunctionCall(QTextStream &s,
+                                    const AbstractMetaFunction *java_function,
+                                    const AbstractMetaClass *java_class,
+                                    Option options = NoOption);
+    void writeFinalDestructor(QTextStream &s, const AbstractMetaClass *cls);
+    void writeFinalConstructor(QTextStream &s,
+                               const AbstractMetaFunction *java_function,
+                               const QString &qt_object_name,
+                               const QString &java_object_name);
+    void writeQObjectFunctions(QTextStream &s, const AbstractMetaClass *java_class);
+    void writeFunctionCall(QTextStream &s,
+                           const QString &variable_name,
+                           const AbstractMetaFunction *java_function,
+                           const QString &prefix = QString(),
+                           Option option = NoOption,
+                           const QStringList &extraParameters = QStringList());
+    void writeFunctionCallArguments(QTextStream &s, const AbstractMetaFunction *java_function,
+                                    const QString &prefix = QString(), Option option = NoOption);
+    static void writeFunctionName(QTextStream &s,
+                                  const AbstractMetaFunction *java_function,
+                                  const AbstractMetaClass *java_class = 0,
+                                  uint options = StandardJNISignature);
+
+    void writeJavaToQt(QTextStream &s,
+                       const AbstractMetaClass *java_class,
+                       const AbstractMetaType *function_return_type,
+                       const QString &qt_name,
+                       const QString &java_name,
+                       const AbstractMetaFunction *java_function,
+                       int argument_index);
+    void writeJavaToQt(QTextStream &s,
+                       const AbstractMetaType *java_type,
+                       const QString &qt_name,
+                       const QString &java_name,
+                       const AbstractMetaFunction *java_function,
+                       int argument_index,
+                       Option option = OriginalName);
+
+    void writeFinalFunction(QTextStream &s,
+                            const AbstractMetaFunction *java_function,
+                            const AbstractMetaClass *java_class);
+    static void writeFinalFunctionArguments(QTextStream &s,
+                                            const AbstractMetaFunction *java_function, bool d_export = false);
+    static void writeVirtualDispatchArguments(QTextStream &s,
+                                              const AbstractMetaFunction *java_function, bool d_export = false);
+    void writeFinalFunctionSetup(QTextStream &s,
+                                 const AbstractMetaFunction *java_function,
+                                 const QString &qt_object_name,
+                                 const AbstractMetaClass *java_class);
+    void writeOwnership(QTextStream &s,
+                        const AbstractMetaFunction *java_function,
+                        const QString &var_name,
+                        int var_index,
+                        const AbstractMetaClass *implementor);
+    void writeQtToJava(QTextStream &s,
+                       const AbstractMetaType *java_type,
+                       const QString &qt_name,
+                       const QString &java_name,
+                       const AbstractMetaFunction *java_function,
+                       int argument_index,
+                       Option option = NoOption);
+
+    bool writeConversionRule(QTextStream &s,
+                             TypeSystem::Language target_language,
+                             const AbstractMetaFunction *java_function,
+                             int argument_index,
+                             const QString &qt_name,
+                             const QString &java_name);
+
+    void writeFieldAccessors(QTextStream &s, const AbstractMetaField *java_field);
+
+    void writeOriginalMetaObjectFunction(QTextStream &s, const AbstractMetaClass *java_class);
+    void writeFromNativeFunction(QTextStream &s,
+                                 const AbstractMetaClass *java_class);
+    void writeFromArrayFunction(QTextStream &s, const AbstractMetaClass *java_class);
+    void writeJavaLangObjectOverrideFunctions(QTextStream &s, const AbstractMetaClass *cls);
+
+    void writeInterfaceCastFunction(QTextStream &s,
+                                    const AbstractMetaClass *java_class,
+                                    const AbstractMetaClass *interface);
+
+    void writeQtToJavaContainer(QTextStream &s,
+                                const AbstractMetaType *java_type,
+                                const QString &qt_name,
+                                const QString &java_name,
+                                const AbstractMetaFunction *java_function,
+                                int argument_index);
+    void writeJavaToQtContainer(QTextStream &s,
+                                const AbstractMetaType *java_type,
+                                const QString &qt_name,
+                                const QString &java_name,
+                                const AbstractMetaFunction *java_function,
+                                int argument_index);
+
+    void writeDefaultConstructedValues(QTextStream &s, const AbstractMetaClass *java_class);
+
+    bool hasCustomDestructor(const AbstractMetaClass *java_class) const;
+
+    static QString translateType(const AbstractMetaType *java_type, Option option = NoOption, bool d_export = false);
+
+    inline bool nativeJumpTable() const { return m_native_jump_table; }
+    inline void setNativeJumpTable(bool n) { m_native_jump_table = n; }
+
+    static QString jniReturnName(const AbstractMetaFunction *java_function, uint options = StandardJNISignature, bool d_export = false);
+    static void writeVirtualFunctionDispatchName(QTextStream &s, const AbstractMetaFunction *function, bool d_export = false);
+    static void writeVirtualDispatchFunction(QTextStream &s, const AbstractMetaFunction *function, bool d_export = false);
+    static void writeInterfaceCasts(QTextStream &s, const AbstractMetaClass *java_class);
+    void writeSignalsHandling(QTextStream &s, const AbstractMetaClass *java_class);
+    void writeSignalHandler(QTextStream &s, const AbstractMetaClass *java_class, AbstractMetaFunction *signal);
+    static void writeInitCallbacks(QTextStream &s, const AbstractMetaClass *java_class);
+
+
+private:
+    void writeDefaultConstructedValues_helper(QSet<QString> &values,
+                                              const AbstractMetaFunction *function);
+    QString fromObject(const TypeEntry *centry, const QString &var_name);
+
+    //qtd
+    QString jniReturnType(const AbstractMetaType *f_type, uint options = StandardJNISignature);
+    QString getTypeName(const TypeEntry *entry, Option option);
+
+    bool m_native_jump_table;
+};
+
+#endif // CPPIMPLGENERATOR_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/customtypes.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#include "customtypes.h"
+
+#include "metajava.h"
+
+#include <QtCore/QDebug>
+#include <QtCore/QTextStream>
+
+
+void QModelIndexTypeEntry::generateCppJavaToQt(QTextStream &s,
+                                               const AbstractMetaType *,
+                                               const QString &env_name,
+                                               const QString &qt_name,
+                                               const QString &java_name) const
+{
+    s << "QModelIndex " << qt_name << " = qtjambi_to_QModelIndex(" << env_name << ", "
+      << java_name << ")";
+}
+
+
+void QModelIndexTypeEntry::generateCppQtToJava(QTextStream &s,
+                                               const AbstractMetaType *,
+                                               const QString &env_name,
+                                               const QString &qt_name,
+                                               const QString &java_name) const
+{
+    s << "jobject " << java_name << " = qtjambi_from_QModelIndex(" << env_name << ", "
+      << qt_name << ")";
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/customtypes.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#ifndef CUSTOMTYPES_H
+#define CUSTOMTYPES_H
+
+#include "typesystem.h"
+
+
+class QModelIndexTypeEntry : public CustomTypeEntry
+{
+public:
+    QModelIndexTypeEntry() : CustomTypeEntry("QModelIndex")
+    {
+        setCodeGeneration(GenerateNothing);
+    }
+
+    virtual QString javaPackage() const { return "qt.core"; }
+
+    virtual bool isValue() const { return true; }
+
+    virtual void generateCppJavaToQt(QTextStream &s,
+                                     const AbstractMetaType *java_type,
+                                     const QString &env_name,
+                                     const QString &qt_name,
+                                     const QString &java_name) const;
+
+    virtual void generateCppQtToJava(QTextStream &s,
+                                     const AbstractMetaType *java_type,
+                                     const QString &env_name,
+                                     const QString &qt_name,
+                                     const QString &java_name) const;
+
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/dgenerator.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,3316 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+*
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#include "dgenerator.h"
+#include "reporthandler.h"
+#include "docparser.h"
+#include "jumptable.h"
+#include "cppimplgenerator.h"
+#include "fileout.h"
+
+#include <QtCore/QDir>
+#include <QtCore/QTextStream>
+#include <QtCore/QVariant>
+#include <QtCore/QRegExp>
+#include <QDebug>
+
+#include <iostream>
+
+
+static Indentor INDENT;
+
+DGenerator::DGenerator()
+    : m_doc_parser(0),
+      m_docs_enabled(false),
+      m_native_jump_table(false),
+      m_recursive(0),
+      m_isRecursive(false)
+{
+    excludedTypes << "long long" << "bool" << "int" << "QString" << "char" << "WId"
+                  << "unsigned char" << "uint" << "double" << "short" << "float"
+                  << "signed char" << "unsigned short" << "QBool" << "unsigned int"
+                  << "Qt::HANDLE" << "QChar" << "java.lang.JObjectWrapper" << "void"
+                  << "QLatin1String" << "unsigned long long" << "signed int"
+                  << "signed short" << "Array" << "GLuint" << "GLenum" << "GLint"
+                  << "unsigned long" << "ulong" << "long" << "QByteRef"
+                  << "QStringList" << "QList" << "QVector" << "QPair";
+}
+
+QString DGenerator::fileNameForClass(const AbstractMetaClass *d_class) const
+{
+    return QString("%1.d").arg(d_class->name());
+}
+
+void DGenerator::writeFieldAccessors(QTextStream &s, const AbstractMetaField *field)
+{
+    Q_ASSERT(field->isPublic() || field->isProtected());
+
+    const AbstractMetaClass *declaringClass = field->enclosingClass();
+
+    FieldModification mod = declaringClass->typeEntry()->fieldModification(field->name());
+
+    // Set function
+    if (mod.isWritable() && !field->type()->isConstant()) {
+        const AbstractMetaFunction *setter = field->setter();
+        if (declaringClass->hasFunction(setter)) {
+            QString warning =
+                QString("class '%1' already has setter '%2' for public field '%3'")
+                .arg(declaringClass->name()).arg(setter->name()).arg(field->name());
+            ReportHandler::warning(warning);
+        } else {
+            if (!notWrappedYet(setter)) // qtd2
+                writeFunction(s, setter);
+        }
+    }
+
+    // Get function
+    const AbstractMetaFunction *getter = field->getter();
+    if (mod.isReadable()) {
+        if (declaringClass->hasFunction(getter)) {
+            QString warning =
+                QString("class '%1' already has getter '%2' for public field '%3'")
+                .arg(declaringClass->name()).arg(getter->name()).arg(field->name());
+            ReportHandler::warning(warning);
+        } else {
+            if (!notWrappedYet(getter)) // qtd2
+                writeFunction(s, getter);
+        }
+    }
+}
+
+QString DGenerator::translateType(const AbstractMetaType *d_type, const AbstractMetaClass *context, Option option)
+{
+    QString s;
+
+    if (context != 0 && d_type != 0 && context->typeEntry()->isGenericClass() && d_type->originalTemplateType() != 0)
+        d_type = d_type->originalTemplateType();
+
+    if (!d_type) {
+        s = "void";
+    } else if (d_type->typeEntry() && d_type->typeEntry()->qualifiedCppName() == "QString") {
+        s = "string";
+    } else if (d_type->isArray()) {
+        s = translateType(d_type->arrayElementType(), context) + "[]";
+    } else if (d_type->isEnum() /* qtd2 || d_type->isFlags() */) {
+        if (( d_type->isEnum() && ((EnumTypeEntry *)d_type->typeEntry())->forceInteger() )
+            || ( d_type->isFlags() && ((FlagsTypeEntry *)d_type->typeEntry())->forceInteger() ) ) {
+            if (option & BoxedPrimitive)
+                s = "java.lang.Integer";
+            else
+                s = "int";
+        } else {
+            if (option & EnumAsInts)
+                s = "int";
+            else
+                s = d_type->typeEntry()->qualifiedTargetLangName();
+        }
+    } else if (d_type->isFlags()) { // qtd2 begin
+        if (d_type->isFlags() && ((FlagsTypeEntry *)d_type->typeEntry())->forceInteger()) {
+            if (option & BoxedPrimitive)
+                s = "java.lang.Integer";
+            else
+                s = "int";
+        } else
+            s = "int";
+    } else {
+/* qtd        if (d_type->isPrimitive() && (option & BoxedPrimitive)) {
+            s = static_cast<const PrimitiveTypeEntry *>(d_type->typeEntry())->javaObjectName();
+        } else */ if (d_type->isVariant()) {
+            s = "QVariant";
+        } else if (d_type->isNativePointer()) {
+            if (d_type->typeEntry()->isValue() && !d_type->typeEntry()->isStructInD())
+                s = d_type->typeEntry()->lookupName();
+            else if (d_type->typeEntry()->isEnum())
+                s = "int" + QString(d_type->actualIndirections(), '*');
+            else
+                s = d_type->typeEntry()->lookupName() + QString(d_type->actualIndirections(), '*');
+        } else if (d_type->isContainer()) {
+            const ContainerTypeEntry* c_entry = static_cast<const ContainerTypeEntry*>(d_type->typeEntry());
+            Q_ASSERT(c_entry);
+
+            if ((option & SkipTemplateParameters) == 0) {
+                QList<AbstractMetaType *> args = d_type->instantiations();
+
+                if (args.size() == 1) // QVector or QList
+                    s = translateType(args.at(0), context, BoxedPrimitive) + "[]";
+                else if(args.size() == 2) { // all sorts of maps
+                    s = translateType(args.at(1), context, BoxedPrimitive); // value
+                    bool isMultiMap = static_cast<const ContainerTypeEntry *>(d_type->typeEntry())->type() == ContainerTypeEntry::MultiMapContainer;
+                    if (isMultiMap)
+                        s += "[]";
+                    s += "[" + translateType(args.at(0), context, BoxedPrimitive) + "]";
+                } else {
+                    s = d_type->typeEntry()->qualifiedTargetLangName();
+
+                    for (int i=0; i<args.size(); ++i) {
+                        if (i != 0)
+                            s += ", ";
+                        bool isMultiMap = static_cast<const ContainerTypeEntry *>(d_type->typeEntry())->type() == ContainerTypeEntry::MultiMapContainer
+                                          && i == 1;
+                        if (isMultiMap)
+                            s += "java.util.List<";
+                        s += translateType(args.at(i), context, BoxedPrimitive);
+                        if (isMultiMap)
+                            s += ">";
+                    }
+                    s += '>';
+                }
+            }
+
+        } else {
+            const TypeEntry *type = d_type->typeEntry();
+            if (type->designatedInterface())
+                type = type->designatedInterface();
+            if (type->isString())
+                s = "string";
+            else if (type->isObject()){
+                s = type->name();
+            } else {
+                s = type->lookupName();
+            }
+        }
+    }
+
+    return s;
+}
+
+QString DGenerator::argumentString(const AbstractMetaFunction *d_function,
+                                      const AbstractMetaArgument *d_argument,
+                                      uint options)
+{
+    QString modified_type = d_function->typeReplaced(d_argument->argumentIndex() + 1);
+    QString arg;
+
+    AbstractMetaType *type = d_argument->type();
+    // if argument is "QString &" ref attribute needed
+    if (type->typeEntry()->isValue() && type->isNativePointer() && type->typeEntry()->name() == "QString")
+        arg = "ref ";
+
+    if (modified_type.isEmpty())
+        arg += translateType(d_argument->type(), d_function->implementingClass(), (Option) options);
+    else
+        arg += modified_type.replace('$', '.');
+
+    if ((options & SkipName) == 0) {
+        arg += " ";
+        arg += d_argument->argumentName();
+    }
+
+    if (!d_argument->defaultValueExpression().isEmpty()) // qtd
+        arg += " = " + d_argument->defaultValueExpression();
+
+    return arg;
+}
+
+void DGenerator::writeArgument(QTextStream &s,
+                                  const AbstractMetaFunction *d_function,
+                                  const AbstractMetaArgument *d_argument,
+                                  uint options)
+{
+    s << argumentString(d_function, d_argument, options);
+}
+
+
+void DGenerator::writeIntegerEnum(QTextStream &s, const AbstractMetaEnum *d_enum)
+{
+    const AbstractMetaEnumValueList &values = d_enum->values();
+
+    s << "    public static class " << d_enum->name() << "{" << endl;
+    for (int i=0; i<values.size(); ++i) {
+        AbstractMetaEnumValue *value = values.at(i);
+
+        if (d_enum->typeEntry()->isEnumValueRejected(value->name()))
+            continue;
+
+        if (m_doc_parser)
+            s << m_doc_parser->documentation(value);
+
+        s << "        public static final int " << value->name() << " = " << value->value();
+        s << ";";
+        s << endl;
+    }
+
+    s << "    } // end of enum " << d_enum->name() << endl << endl;
+}
+
+void DGenerator::writeEnumAlias(QTextStream &s, const AbstractMetaEnum *d_enum)
+{
+    // aliases for enums to be used in easier way like QFont.Bold instead of QFont.Weight.Bold
+    s << QString("    alias %1 %2;").arg(d_enum->typeEntry()->qualifiedTargetLangName()).arg(d_enum->name()) << endl << endl;
+    const AbstractMetaEnumValueList &values = d_enum->values();
+    for (int i=0; i<values.size(); ++i) {
+        AbstractMetaEnumValue *enum_value = values.at(i);
+
+        if (d_enum->typeEntry()->isEnumValueRejected(enum_value->name()))
+            continue;
+
+        s << QString("    alias %1.%2 %2;").arg(d_enum->typeEntry()->qualifiedTargetLangName()).arg(enum_value->name()) << endl;
+    }
+    s << endl;
+}
+
+void DGenerator::writeEnum(QTextStream &s, const AbstractMetaEnum *d_enum)
+{
+    if (m_doc_parser) {
+        s << m_doc_parser->documentation(d_enum);
+    }
+
+    /* qtd
+
+    if (d_enum->typeEntry()->forceInteger()) {
+        writeIntegerEnum(s, d_enum);
+        return;
+    }
+
+    // Check if enums in QObjects are declared in the meta object. If not
+    if (  (d_enum->enclosingClass()->isQObject() || d_enum->enclosingClass()->isQtNamespace())
+        && !d_enum->hasQEnumsDeclaration()) {
+        s << "    @QtBlockedEnum" << endl;
+    }
+*/
+    // Generates Java 1.5 type enums
+    s << "    public enum " << d_enum->enclosingClass()->name() << "_" << d_enum->name() << " {" << endl;
+    const AbstractMetaEnumValueList &values = d_enum->values();
+    EnumTypeEntry *entry = d_enum->typeEntry();
+
+    for (int i=0; i<values.size(); ++i) {
+        AbstractMetaEnumValue *enum_value = values.at(i);
+
+        if (d_enum->typeEntry()->isEnumValueRejected(enum_value->name()))
+            continue;
+
+        if (m_doc_parser)
+            s << m_doc_parser->documentation(enum_value);
+
+        s << "        " << enum_value->name() << " = " << enum_value->value();
+
+        if (i != values.size() - 1) {
+            AbstractMetaEnumValue *next_value = values.at(i+1); // qtd
+            if (!(d_enum->typeEntry()->isEnumValueRejected(next_value->name()) && i == values.size() - 2)) // qtd
+                s << "," << endl;
+        }
+    }
+/* qtd
+    if (entry->isExtensible())
+        s << "        CustomEnum = 0";
+*/
+    s << endl << INDENT << "}" << endl << endl; // qtd
+
+
+/* qtd    s << ";" << endl << endl;
+
+    s << "        " << d_enum->name() << "(int value) { this.value = value; }" << endl
+      << "        public int value() { return value; }" << endl
+      << endl;
+
+    // Write out the createQFlags() function if its a QFlags enum
+    if (entry->flags()) {
+        FlagsTypeEntry *flags_entry = entry->flags();
+        s << "        public static " << flags_entry->targetLangName() << " createQFlags("
+          << entry->targetLangName() << " ... values) {" << endl
+          << "            return new " << flags_entry->targetLangName() << "(values);" << endl
+          << "        }" << endl;
+    }
+
+    // The resolve functions. The public one that returns the right
+    // type and an internal one that has a generic signature. Makes it
+    // easier to find the right one from JNI.
+    s << "        public static " << d_enum->name() << " resolve(int value) {" << endl
+      << "            return (" << d_enum->name() << ") resolve_internal(value);" << endl
+      << "        }" << endl
+      << "        private static Object resolve_internal(int value) {" << endl
+      << "            switch (value) {" << endl;
+
+    for (int i=0; i<values.size(); ++i) {
+        AbstractMetaEnumValue *e = values.at(i);
+
+        if (d_enum->typeEntry()->isEnumValueRejected(e->name()))
+            continue;
+
+        s << "            case " << e->value() << ": return " << e->name() << ";" << endl;
+    }
+
+    s << "            }" << endl;
+
+    if (entry->isExtensible()) {
+        s << "            if (enumCache == null)" << endl
+          << "                enumCache = new java.util.HashMap<Integer, " << d_enum->name()
+          << ">();" << endl
+          << "            " << d_enum->name() << " e = enumCache.get(value);" << endl
+          << "            if (e == null) {" << endl
+          << "                e = (" << d_enum->name() << ") qt.GeneratorUtilities.createExtendedEnum("
+          << "value, CustomEnum.ordinal(), " << d_enum->name() << ".class, CustomEnum.name());"
+          << endl
+          << "                enumCache.put(value, e);" << endl
+          << "            }" << endl
+          << "            return e;" << endl;
+    } else {
+        s << "            throw new qt.QNoSuchEnumValueException(value);" << endl;
+    }
+
+
+    s << "        }" << endl;
+
+    s << "        private final int value;" << endl
+      << endl;
+    if (entry->isExtensible()) {
+        s << "        private static java.util.HashMap<Integer, " << d_enum->name()
+          << "> enumCache;";
+    }
+    s << "    }" << endl;
+*/
+    // Write out the QFlags if present...
+/*    FlagsTypeEntry *flags_entry = entry->flags();
+    if (flags_entry) {
+        QString flagsName = flags_entry->targetLangName();
+        s << INDENT << "alias QFlags!(" << d_enum->name() << ") " << flagsName << ";" << endl << endl;
+    }*/
+}
+
+void DGenerator::writePrivateNativeFunction(QTextStream &s, const AbstractMetaFunction *d_function)
+{
+    int exclude_attributes = AbstractMetaAttributes::Public | AbstractMetaAttributes::Protected;
+    int include_attributes = 0;
+
+    if (d_function->isEmptyFunction())
+        exclude_attributes |= AbstractMetaAttributes::Native;
+    else
+        include_attributes |= AbstractMetaAttributes::Native;
+
+//     if (!d_function->isConstructor())
+//         include_attributes |= AbstractMetaAttributes::Static;
+
+    writeFunctionAttributes(s, d_function, include_attributes, exclude_attributes,
+                            EnumAsInts | ExternC
+                            | (d_function->isEmptyFunction()
+                               || d_function->isNormal()
+                               || d_function->isSignal() ? 0 : SkipReturnType));
+
+    if (d_function->isConstructor())
+        s << "void* ";
+
+
+    s << d_function->marshalledName();
+/* qtd
+    s << "(";
+
+    AbstractMetaArgumentList arguments = d_function->arguments();
+
+    if (!d_function->isStatic() && !d_function->isConstructor())
+        s << "void *__this__nativeId";
+    for (int i=0; i<arguments.count(); ++i) {
+        const AbstractMetaArgument *arg = arguments.at(i);
+
+        if (!d_function->argumentRemoved(i+1)) {
+            if (i > 0 || (!d_function->isStatic() && !d_function->isConstructor()))
+                s << ", ";
+
+            if (!arg->type()->hasNativeId())
+                writeArgument(s, d_function, arg, EnumAsInts);
+            else
+                s << "void *" << arg->argumentName();
+        }
+    }
+    s << ")";
+*/
+
+    CppImplGenerator::writeFinalFunctionArguments(s, d_function, true); // qtd
+
+    // Make sure people don't call the private functions
+    if (d_function->isEmptyFunction()) {
+        s << endl
+          << INDENT << "{" << endl
+          << INDENT << "// qtd2    throw new qt.QNoImplementationException();" << endl
+          << INDENT << "}" << endl << endl;
+    } else {
+        s << ";" << endl;
+    }
+}
+
+static QString function_call_for_ownership(TypeSystem::Ownership owner)
+{
+    if (owner == TypeSystem::CppOwnership) {
+        return "__set_native_ownership(true)";
+    } else /* qtd 2 if (owner == TypeSystem::TargetLangOwnership) */ {
+        return "__set_native_ownership(false)";
+    }/* else if (owner == TypeSystem::DefaultOwnership) {
+        return "__no_real_delete = false";
+
+    } else {
+        Q_ASSERT(false);
+        return "bogus()";
+    }*/
+}
+
+void DGenerator::writeOwnershipForContainer(QTextStream &s, TypeSystem::Ownership owner,
+                                               AbstractMetaType *type, const QString &arg_name)
+{
+    Q_ASSERT(type->isContainer());
+
+    s << INDENT << "for (" << type->instantiations().at(0)->fullName() << " i : "
+                << arg_name << ")" << endl
+      << INDENT << "    if (i != null) i." << function_call_for_ownership(owner) << ";" << endl;
+
+}
+
+void DGenerator::writeOwnershipForContainer(QTextStream &s, TypeSystem::Ownership owner,
+                                               AbstractMetaArgument *arg)
+{
+    writeOwnershipForContainer(s, owner, arg->type(), arg->argumentName());
+}
+
+static FunctionModificationList get_function_modifications_for_class_hierarchy(const AbstractMetaFunction *d_function)
+{
+    FunctionModificationList mods;
+    const AbstractMetaClass *cls = d_function->implementingClass();
+    while (cls != 0) {
+        mods += d_function->modifications(cls);
+
+        if (cls == cls->baseClass())
+            break;
+        cls = cls->baseClass();
+    }
+    return mods;
+}
+
+void DGenerator::writeInjectedCode(QTextStream &s, const AbstractMetaFunction *d_function,
+                                      CodeSnip::Position position)
+{
+    FunctionModificationList mods = get_function_modifications_for_class_hierarchy(d_function);
+    foreach (FunctionModification mod, mods) {
+        if (mod.snips.count() <= 0)
+            continue ;
+
+        foreach (CodeSnip snip, mod.snips) {
+            if (snip.position != position)
+                continue ;
+
+            if (snip.language != TypeSystem::TargetLangCode)
+                continue ;
+
+            QString code;
+            QTextStream tmpStream(&code);
+            snip.formattedCode(tmpStream, INDENT);
+            ArgumentMap map = snip.argumentMap;
+            ArgumentMap::iterator it = map.begin();
+            for (;it!=map.end();++it) {
+                int pos = it.key() - 1;
+                QString meta_name = it.value();
+
+                if (pos >= 0 && pos < d_function->arguments().count()) {
+                    code = code.replace(meta_name, d_function->arguments().at(pos)->argumentName());
+                } else {
+                    QString debug = QString("argument map specifies invalid argument index %1"
+                                            "for function '%2'")
+                                            .arg(pos + 1).arg(d_function->name());
+                    ReportHandler::warning(debug);
+                }
+
+            }
+            s << code << endl;
+        }
+    }
+}
+
+
+void DGenerator::writeJavaCallThroughContents(QTextStream &s, const AbstractMetaFunction *d_function, uint attributes)
+{
+    Q_UNUSED(attributes);
+    writeInjectedCode(s, d_function, CodeSnip::Beginning);
+/* qtd
+    if (d_function->implementingClass()->isQObject()
+        && !d_function->isStatic()
+        && !d_function->isConstructor()
+        && d_function->name() != QLatin1String("thread")
+        && d_function->name() != QLatin1String("disposeLater")) {
+        s << INDENT << "qt.GeneratorUtilities.threadCheck(this);" << endl;
+    }
+*/
+    AbstractMetaArgumentList arguments = d_function->arguments();
+
+    if (!d_function->isConstructor()) {
+        TypeSystem::Ownership owner = d_function->ownership(d_function->implementingClass(), TypeSystem::TargetLangCode, -1);
+        if (owner != TypeSystem::InvalidOwnership)
+            s << INDENT << "this." << function_call_for_ownership(owner) << ";" << endl;
+    }
+
+    for (int i=0; i<arguments.count(); ++i) {
+        AbstractMetaArgument *arg = arguments.at(i);
+
+        if (!d_function->argumentRemoved(i+1)) {
+            TypeSystem::Ownership owner = d_function->ownership(d_function->implementingClass(), TypeSystem::TargetLangCode, i+1);
+            if (owner != TypeSystem::InvalidOwnership) {
+                s << INDENT << "if (" << arg->argumentName() << " !is null) {" << endl;
+                {
+                    Indentation indent(INDENT);
+                    if (arg->type()->isContainer())
+                        ;// qtd2 writeOwnershipForContainer(s, owner, arg);
+                    else
+                        s << INDENT << arg->argumentName() << "." << function_call_for_ownership(owner) << ";" << endl;
+                }
+                s << INDENT << "}" << endl;
+            }
+/*
+            if (type->isArray()) {
+                s << INDENT << "if (" << arg->argumentName() << ".length != " << type->arrayElementCount() << ")" << endl
+                  << INDENT << "    " << "throw new IllegalArgumentException(\"Wrong number of elements in array. Found: \" + "
+                  << arg->argumentName() << ".length + \", expected: " << type->arrayElementCount() << "\");"
+                  << endl << endl;
+            }
+
+            if (type->isEnum()) {
+                EnumTypeEntry *et = (EnumTypeEntry *) type->typeEntry();
+                if (et->forceInteger()) {
+                    if (!et->lowerBound().isEmpty()) {
+                        s << INDENT << "if (" << arg->argumentName() << " < " << et->lowerBound() << ")" << endl
+                          << INDENT << "    throw new IllegalArgumentException(\"Argument " << arg->argumentName()
+                          << " is less than lowerbound " << et->lowerBound() << "\");" << endl;
+                    }
+                    if (!et->upperBound().isEmpty()) {
+                        s << INDENT << "if (" << arg->argumentName() << " > " << et->upperBound() << ")" << endl
+                          << INDENT << "    throw new IllegalArgumentException(\"Argument " << arg->argumentName()
+                          << " is greated than upperbound " << et->upperBound() << "\");" << endl;
+                    }
+                }
+            }
+            */
+        }
+    }
+
+/* qtd2
+    if (!d_function->isConstructor() && !d_function->isStatic()) {
+        s << INDENT << "if (nativeId() == 0)" << endl
+          << INDENT << "    throw new QNoNativeResourcesException(\"Function call on incomplete object of type: \" +getClass().getName());" << endl;
+    }
+*/
+    for (int i=0; i<arguments.size(); ++i) {
+        if (d_function->nullPointersDisabled(d_function->implementingClass(), i + 1)) {
+            s << INDENT << "/*if (" << arguments.at(i)->argumentName() << " is null)" << endl
+              << INDENT << "    throw new NullPointerException(\"Argument '" << arguments.at(i)->argumentName() << "': null not expected.\"); */" << endl;
+        }
+    }
+
+    QList<ReferenceCount> referenceCounts;
+    for (int i=0; i<arguments.size() + 1; ++i) {
+        referenceCounts = d_function->referenceCounts(d_function->implementingClass(),
+                                                         i == 0 ? -1 : i);
+
+        foreach (ReferenceCount refCount, referenceCounts)
+            writeReferenceCount(s, refCount, i == 0 ? "this" : arguments.at(i-1)->argumentName());
+    }
+
+    referenceCounts = d_function->referenceCounts(d_function->implementingClass(), 0);
+    AbstractMetaType *return_type = d_function->type();
+    QString new_return_type = QString(d_function->typeReplaced(0)).replace('$', '.');
+    bool has_return_type = new_return_type != "void"
+        && (!new_return_type.isEmpty() || return_type != 0);
+// qtd    TypeSystem::Ownership owner = d_function->ownership(d_function->implementingClass(), TypeSystem::TargetLangCode, 0);
+
+    bool has_code_injections_at_the_end = false;
+    FunctionModificationList mods = get_function_modifications_for_class_hierarchy(d_function);
+    foreach (FunctionModification mod, mods) {
+        foreach (CodeSnip snip, mod.snips) {
+            if (snip.position == CodeSnip::End && snip.language == TypeSystem::TargetLangCode) {
+                has_code_injections_at_the_end = true;
+                break;
+            }
+        }
+    }
+
+//    bool needs_return_variable = has_return_type
+//        && (owner != TypeSystem::InvalidOwnership || referenceCounts.size() > 0 || has_code_injections_at_the_end);
+
+    if(d_function->type()) { // qtd
+        if (d_function->type()->isTargetLangString())
+            s << INDENT << "string res;" << endl;
+
+        if(d_function->type()->name() == "QModelIndex")
+            s << INDENT << "QModelIndex res;" << endl;
+
+        if(d_function->type()->isContainer())
+            s << INDENT << this->translateType(d_function->type(), d_function->ownerClass(), NoOption) << " res;" << endl;
+    }
+
+    s << INDENT;
+    if ( (has_return_type && d_function->argumentReplaced(0).isEmpty() ) || d_function->isConstructor()) { //qtd
+        if(d_function->type() && d_function->type()->isQObject()) { // qtd
+            s << "void *__qt_return_value = ";
+        } else if(d_function->type() && (d_function->type()->isTargetLangString() ||
+                                         d_function->type()->name() == "QModelIndex" ||
+                                         d_function->type()->isContainer())) // qtd
+            ;
+/* qtd2 not sure        else if (needs_return_variable) {
+            if (new_return_type.isEmpty())
+                s << translateType(return_type, d_function->implementingClass());
+            else
+                s << new_return_type;
+
+            s << " __qt_return_value = ";
+        }*/ else if (d_function->isConstructor()) { // qtd
+            s << "void* __qt_return_value = ";
+        } else if (d_function->type() && d_function->type()->isValue()  && !d_function->type()->typeEntry()->isStructInD()) {
+            s << "void* __qt_return_value = ";
+        } else if (d_function->type() && d_function->type()->isVariant())
+            s << "void* __qt_return_value = ";
+        else if ( d_function->type() && ( d_function->type()->isObject() ||
+                   (d_function->type()->isNativePointer() && d_function->type()->typeEntry()->isValue()) ||
+                    d_function->type()->typeEntry()->isInterface()) ) {
+            s << "void* __qt_return_value = ";
+        } else {
+            s << "return ";
+        }
+
+        if (return_type && return_type->isTargetLangEnum()) {
+            s << "cast(" << return_type->typeEntry()->qualifiedTargetLangName() << ") ";
+        }/* qtd2 flags else if (return_type && return_type->isTargetLangFlags()) {
+            s << "new " << return_type->typeEntry()->qualifiedTargetLangName() << "(";
+        }*/
+    }
+
+    bool useJumpTable = d_function->jumpTableId() != -1;
+    if (useJumpTable) {
+        // The native function returns the correct type, we only have
+        // java.lang.Object so we may have to cast...
+        QString signature = JumpTablePreprocessor::signature(d_function);
+
+//         printf("return: %s::%s return=%p, replace-value=%s, replace-type=%s signature: %s\n",
+//                qPrintable(d_function->ownerClass()->name()),
+//                qPrintable(d_function->signature()),
+//                return_type,
+//                qPrintable(d_function->argumentReplaced(0)),
+//                qPrintable(new_return_type),
+//                qPrintable(signature));
+
+        if (has_return_type && signature.at(0) == 'L') {
+            if (new_return_type.length() > 0) {
+//                 printf(" ---> replace-type: %s\n", qPrintable(new_return_type));
+                s << "(" << new_return_type << ") ";
+            } else if (d_function->argumentReplaced(0).isEmpty()) {
+//                 printf(" ---> replace-value\n");
+                s << "(" << translateType(return_type, d_function->implementingClass()) << ") ";
+            }
+        }
+
+            s << "JTbl." << JumpTablePreprocessor::signature(d_function) << "("
+          << d_function->jumpTableId() << ", ";
+
+        // Constructors and static functions don't have native id, but
+        // the functions expect them anyway, hence add '0'. Normal
+        // functions get their native ids added just below...
+        if (d_function->isConstructor() || d_function->isStatic())
+            s << "0, ";
+
+    } else {
+/* qtd       if (attributes & SuperCall) {
+            s << "super.";
+        }*/
+        s << d_function->marshalledName() << "(";
+    }
+
+    if (!d_function->isConstructor() && !d_function->isStatic())
+        s << "nativeId";
+
+    if (d_function->isConstructor() &&
+        ( d_function->implementingClass()->hasVirtualFunctions()
+        || d_function->implementingClass()->typeEntry()->isObject() ) ) { // qtd
+        s << "cast(void*) this";
+        if (arguments.count() > 0)
+            s << ", ";
+    }
+
+    //returning string or a struct
+    bool return_in_arg = d_function->type() && (d_function->type()->isTargetLangString() ||
+                                                d_function->type()->name() == "QModelIndex" ||
+                                                d_function->type()->isContainer());
+    if(return_in_arg) { // qtd
+        if (!d_function->isStatic() && !d_function->isConstructor()) // qtd
+            s << ", ";
+        s << "&res";
+    }
+
+    for (int i=0; i<arguments.count(); ++i) {
+        const AbstractMetaArgument *arg = arguments.at(i);
+        const AbstractMetaType *type = arg->type();
+        const TypeEntry *te = type->typeEntry();
+
+        if (!d_function->argumentRemoved(i+1)) {
+            if (i > 0 || (!d_function->isStatic() && !d_function->isConstructor()) || return_in_arg) // qtd
+                s << ", ";
+
+            // qtd
+            QString modified_type = d_function->typeReplaced(arg->argumentIndex() + 1);
+            if (!modified_type.isEmpty())
+                modified_type = modified_type.replace('$', '.');
+
+            QString arg_name = arg->argumentName();
+
+            if (type->isVariant())
+                s << arg_name << " is null ? null : " << arg_name << ".nativeId";
+            else if (te->designatedInterface())
+                s << arg_name << " is null ? null : " << arg_name << ".__ptr_" << te->designatedInterface()->name();
+            else if (modified_type == "string" /* && type->fullName() == "char" */) {
+                s << "toStringz(" << arg_name << ")";
+            } else if(type->isContainer()) {
+                const ContainerTypeEntry *cte =
+                        static_cast<const ContainerTypeEntry *>(te);
+                if(isLinearContainer(cte))
+                    s << QString("%1.ptr, %1.length").arg(arg_name);
+            } else if (type->isTargetLangString() || (te && te->qualifiedCppName() == "QString"))
+                s << QString("%1.ptr, %1.length").arg(arg_name);
+            else if (type->isTargetLangEnum() || type->isTargetLangFlags()) {
+                s << arg_name;
+// qtd                s << arg->argumentName() << ".value()";
+            } else if (!type->hasNativeId() && !(te->isValue() && type->isNativePointer())) { // qtd2 hack for QStyleOption not being a nativeId based for some reason
+                s << arg_name;
+            } else if (te->isStructInD()) {
+                s << arg_name;
+            } else {
+                bool force_abstract = te->isComplex() && (((static_cast<const ComplexTypeEntry *>(te))->typeFlags() & ComplexTypeEntry::ForceAbstract) != 0);
+                if (!force_abstract) {
+                    s << arg_name << " is null ? null : ";
+                } // else if (value type is abstract) then we will get a null pointer exception, which is all right
+
+                s << arg_name << ".nativeId";
+            }
+        }
+    }
+
+    if (useJumpTable) {
+        if ((!d_function->isConstructor() && !d_function->isStatic()) || arguments.size() > 0)
+            s << ", ";
+
+        if (d_function->isStatic())
+            s << "null";
+        else
+            s << "this";
+    }
+
+    s << ")";
+
+    if ( !d_function->argumentReplaced(0).isEmpty() ) {
+        s << ";" << endl;
+        s << INDENT << "return " << d_function->argumentReplaced(0) << ";" << endl;
+        return;
+    }
+
+// qtd2    if (return_type && (/* qtdreturn_type->isTargetLangEnum() ||*/ return_type->isTargetLangFlags()))
+//        s << ")";
+
+    foreach (ReferenceCount referenceCount, referenceCounts) {
+        writeReferenceCount(s, referenceCount, "__qt_return_value");
+    }
+
+    s << ";" << endl;
+
+    // return value marschalling
+    if(d_function->type()) {
+        if ( ( has_return_type && d_function->argumentReplaced(0).isEmpty() )/* || d_function->isConstructor()*/) // qtd
+            if(d_function->type()->isQObject()) {
+
+            QString type_name = d_function->type()->name();
+            const ComplexTypeEntry *ctype = static_cast<const ComplexTypeEntry *>(d_function->type()->typeEntry());
+            if(ctype->isAbstract())
+                type_name = type_name + "_ConcreteWrapper";
+
+            s << INDENT << "if (__qt_return_value is null)" << endl
+                    << INDENT << "    return null;" << endl
+                    << INDENT << "void* d_obj = __QObject_entity(__qt_return_value);" << endl
+                    << INDENT << "if (d_obj is null) {" << endl
+                    << INDENT << "    auto new_obj = new " << type_name << "(__qt_return_value, true);" << endl
+                    << INDENT << "    new_obj.__no_real_delete = true;" << endl
+                    << INDENT << "    return new_obj;" << endl
+                    << INDENT << "} else" << endl
+                    << INDENT << "    return cast(" << d_function->type()->name() << ") d_obj;" << endl;
+        }
+
+
+        if (d_function->type()->isValue() && !d_function->type()->typeEntry()->isStructInD())
+            s << INDENT << "return new " << d_function->type()->name() << "(__qt_return_value, false);" << endl;
+
+        if (d_function->type()->isVariant())
+            s << INDENT << "return new QVariant(__qt_return_value, false);" << endl;
+
+        if (d_function->type()->isNativePointer() && d_function->type()->typeEntry()->isValue())
+            s << INDENT << "return new " << d_function->type()->name() << "(__qt_return_value, true);" << endl;
+
+        if (d_function->type()->isObject()) {
+            if(d_function->storeResult())
+                s << INDENT << QString("__m_%1.nativeId = __qt_return_value;").arg(d_function->name()) << endl
+                        << INDENT << QString("return __m_%1;").arg(d_function->name()) << endl;
+            else {
+                QString type_name = d_function->type()->name();
+                const ComplexTypeEntry *ctype = static_cast<const ComplexTypeEntry *>(d_function->type()->typeEntry());
+                if(ctype->isAbstract())
+                    type_name = type_name + "_ConcreteWrapper";
+
+                QString return_type_name = d_function->type()->name();
+                if(d_function->type()->typeEntry()->designatedInterface())
+                    return_type_name = d_function->type()->typeEntry()->designatedInterface()->name();
+
+                AbstractMetaClass *classForTypeEntry = NULL;
+                // search in AbstractMetaClass list for return type
+                // find a better way to perform TypeEntry -> AbstractMetaClass lookup, maybe create hash before generation
+                // qtd2
+                /*foreach (AbstractMetaClass *cls, m_classes) {
+                    if ( cls->name() == d_function->type()->name() )
+                        classForTypeEntry = cls;
+                }*/
+
+                classForTypeEntry = ClassFromEntry::get(d_function->type()->typeEntry());
+
+                // if class has virtual functions then it has classname_entity function so
+                // we can look for D Object pointer. otherwise create new wrapper
+                if (classForTypeEntry != NULL && classForTypeEntry->hasVirtualFunctions()) {
+                    s << INDENT << "void* d_obj = __" << d_function->type()->name() << "_entity(__qt_return_value);" << endl
+                            << INDENT << "if (d_obj !is null) {" << endl
+                            << INDENT << "    auto d_obj_ref = cast (Object) d_obj;" << endl
+                            << INDENT << "    return cast(" << return_type_name << ") d_obj_ref;" << endl
+                            << INDENT << "} else {" << endl
+                            << INDENT << "    auto return_value = new " << type_name << "(__qt_return_value, true);" << endl
+                            << INDENT << "    return_value.__no_real_delete = true;" << endl
+                            << INDENT << "    return return_value;" << endl
+                            << INDENT << "}";
+                } else {
+                    s << INDENT << "auto return_value = new " << type_name << "(__qt_return_value, true);" << endl
+                            << INDENT << "return_value.__no_real_delete = true;" << endl
+                            << INDENT << "return return_value;" << endl;
+                }
+            }
+            s << endl;
+        }
+    }
+    writeInjectedCode(s, d_function, CodeSnip::End);
+/* qtd2
+    if (needs_return_variable) {
+        if (owner != TypeSystem::InvalidOwnership) {
+            s << INDENT << "if (__qt_return_value != null) {" << endl;
+            if (return_type->isContainer())
+                writeOwnershipForContainer(s, owner, return_type, "__qt_return_value");
+            else
+                s << INDENT << "    __qt_return_value." << function_call_for_ownership(owner) << ";" << endl;
+            s << INDENT << "}" << endl;
+        }
+        s << INDENT << "return __qt_return_value;" << endl;
+    }
+*/
+    if (d_function->isConstructor()) {
+        TypeSystem::Ownership owner = d_function->ownership(d_function->implementingClass(), TypeSystem::TargetLangCode, -1);
+        if (owner != TypeSystem::InvalidOwnership && d_function->isConstructor())
+            s << INDENT << "this." << function_call_for_ownership(owner) << ";" << endl;
+    }
+
+    if(return_in_arg) // qtd
+        s << INDENT << "return res;" << endl;
+}
+
+void DGenerator::retrieveModifications(const AbstractMetaFunction *d_function,
+                                          const AbstractMetaClass *d_class,
+                                          uint *exclude_attributes,
+                                          uint *include_attributes) const
+{
+    FunctionModificationList mods = d_function->modifications(d_class);
+//     printf("name: %s has %d mods\n", qPrintable(d_function->signature()), mods.size());
+    foreach (FunctionModification mod, mods) {
+        if (mod.isAccessModifier()) {
+//             printf(" -> access mod to %x\n", mod.modifiers);
+            *exclude_attributes |= AbstractMetaAttributes::Public
+                                | AbstractMetaAttributes::Protected
+                                | AbstractMetaAttributes::Private
+                                | AbstractMetaAttributes::Friendly;
+
+            if (mod.isPublic())
+                *include_attributes |= AbstractMetaAttributes::Public;
+            else if (mod.isProtected())
+                *include_attributes |= AbstractMetaAttributes::Protected;
+            else if (mod.isPrivate())
+                *include_attributes |= AbstractMetaAttributes::Private;
+            else if (mod.isFriendly())
+                *include_attributes |= AbstractMetaAttributes::Friendly;
+        }
+
+        if (mod.isFinal()) {
+            *include_attributes |= AbstractMetaAttributes::FinalInTargetLang;
+        } else if (mod.isNonFinal()) {
+            *exclude_attributes |= AbstractMetaAttributes::FinalInTargetLang;
+        }
+    }
+
+    *exclude_attributes &= ~(*include_attributes);
+}
+
+QString DGenerator::functionSignature(const AbstractMetaFunction *d_function,
+                                         uint included_attributes, uint excluded_attributes,
+                                         Option option,
+                                         int arg_count)
+{
+    AbstractMetaArgumentList arguments = d_function->arguments();
+    int argument_count = arg_count < 0 ? arguments.size() : arg_count;
+
+    QString result;
+    QTextStream s(&result);
+    QString functionName = d_function->isConstructor() ? "this" : d_function->name(); // qtd
+    // The actual function
+    if (!(d_function->isEmptyFunction() || d_function->isNormal() || d_function->isSignal()))
+        option = Option(option | SkipReturnType);
+    writeFunctionAttributes(s, d_function, included_attributes, excluded_attributes, option);
+
+    s << functionName << "(";
+    writeFunctionArguments(s, d_function, argument_count, option);
+    s << ")";
+
+    return result;
+}
+
+void DGenerator::setupForFunction(const AbstractMetaFunction *d_function,
+                                     uint *included_attributes,
+                                     uint *excluded_attributes) const
+{
+    *excluded_attributes |= d_function->ownerClass()->isInterface() || d_function->isConstructor()
+                            ? AbstractMetaAttributes::Native | AbstractMetaAttributes::Final
+                            : 0;
+    if (d_function->ownerClass()->isInterface())
+        *excluded_attributes |= AbstractMetaAttributes::Abstract;
+    if (d_function->needsCallThrough())
+        *excluded_attributes |= AbstractMetaAttributes::Native;
+
+    const AbstractMetaClass *d_class = d_function->ownerClass();
+    retrieveModifications(d_function, d_class, excluded_attributes, included_attributes);
+}
+
+void DGenerator::writeReferenceCount(QTextStream &s, const ReferenceCount &refCount,
+                                        const QString &argumentName)
+{
+    if (refCount.action == ReferenceCount::Ignore)
+        return;
+
+    QString refCountVariableName = refCount.variableName;
+    if (!refCount.declareVariable.isEmpty() && refCount.action != ReferenceCount::Set) {
+        s << INDENT << "auto __rcTmp = " << refCountVariableName << ";" << endl;
+        refCountVariableName = "__rcTmp";
+    }
+
+    if (refCount.action != ReferenceCount::Set) {
+        s << INDENT << "if (" << argumentName << " !is null";
+
+        if (!refCount.conditional.isEmpty())
+            s << " && " << refCount.conditional;
+
+        s << ") {" << endl;
+    } else {
+         if (!refCount.conditional.isEmpty())
+             s << INDENT << "if (" << refCount.conditional << ") ";
+         s << INDENT << "{" << endl;
+    }
+
+    {
+        Indentation indent(INDENT);
+        switch (refCount.action) {
+        case ReferenceCount::Add:
+        case ReferenceCount::AddAll:
+            s << INDENT << refCountVariableName << " ~= " << argumentName << ";" << endl;
+            break;
+        case ReferenceCount::Remove:
+            s << INDENT << "remove(" << refCountVariableName
+              << ", " << argumentName << ");" << endl;
+            break;
+        case ReferenceCount::Set:
+            {
+                if (refCount.declareVariable.isEmpty())
+                    s << INDENT << refCount.variableName << " = cast(Object) " << argumentName << ";" << endl;
+                else
+                    s << INDENT << refCountVariableName << " = cast(Object) " << argumentName << ";" << endl;
+            }
+        default:
+            break;
+        };
+    }
+    s << INDENT << "}" << endl;
+}
+
+void DGenerator::writeFunction(QTextStream &s, const AbstractMetaFunction *d_function,
+                                  uint included_attributes, uint excluded_attributes)
+{
+    s << endl;
+
+    if (d_function->isModifiedRemoved(TypeSystem::TargetLangCode))
+        return ;
+    QString functionName = d_function->name();
+    setupForFunction(d_function, &included_attributes, &excluded_attributes);
+
+    if (!d_function->ownerClass()->isInterface()) {
+// qtd2        writeEnumOverload(s, d_function, included_attributes, excluded_attributes);
+// qtd        writeFunctionOverloads(s, d_function, included_attributes, excluded_attributes);
+    }
+/* qtd
+    static QRegExp regExp("^(insert|set|take|add|remove|install).*");
+
+    if (regExp.exactMatch(d_function->name())) {
+        AbstractMetaArgumentList arguments = d_function->arguments();
+
+        const AbstractMetaClass *c = d_function->implementingClass();
+        bool hasObjectTypeArgument = false;
+        foreach (AbstractMetaArgument *argument, arguments) {
+            TypeSystem::Ownership d_ownership = d_function->ownership(c, TypeSystem::TargetLangCode, argument->argumentIndex()+1);
+            TypeSystem::Ownership shell_ownership = d_function->ownership(c, TypeSystem::ShellCode, argument->argumentIndex()+1);
+
+            if (argument->type()->typeEntry()->isObject()
+                && d_ownership == TypeSystem::InvalidOwnership
+                && shell_ownership == TypeSystem::InvalidOwnership) {
+                hasObjectTypeArgument = true;
+                break;
+            }
+        }
+
+        if (hasObjectTypeArgument
+            && !d_function->isAbstract()
+            && d_function->referenceCounts(d_function->implementingClass()).size() == 0) {
+            m_reference_count_candidate_functions.append(d_function);
+        }
+    }
+
+
+    if (m_doc_parser) {
+        QString signature = functionSignature(d_function,
+                                              included_attributes | NoBlockedSlot,
+                                              excluded_attributes);
+        s << m_doc_parser->documentationForFunction(signature) << endl;
+    }
+
+    const QPropertySpec *spec = d_function->propertySpec();
+    if (spec && d_function->modifiedName() == d_function->originalName()) {
+        if (d_function->isPropertyReader()) {
+            s << "    @qt.QtPropertyReader(name=\"" << spec->name() << "\")" << endl;
+            if (!spec->designable().isEmpty())
+                s << "    @qt.QtPropertyDesignable(\"" << spec->designable() << "\")" << endl;
+        } else if (d_function->isPropertyWriter()) {
+            s << "    @qt.QtPropertyWriter(name=\"" << spec->name() << "\")" << endl;
+        } else if (d_function->isPropertyResetter()) {
+            s << "    @qt.QtPropertyResetter(name=\"" << spec->name() << "\")"
+              << endl;
+        }
+    }
+*/
+    s << functionSignature(d_function, included_attributes, excluded_attributes);
+
+    if (d_function->isConstructor()) {
+        writeConstructorContents(s, d_function);
+    } else if (d_function->needsCallThrough() || d_function->isStatic()) { // qtd
+        if (d_function->isAbstract()) {
+            s << ";" << endl;
+        } else {
+            s << " {" << endl;
+            {
+                Indentation indent(INDENT);
+                writeJavaCallThroughContents(s, d_function);
+            }
+            s << INDENT << "}" << endl;
+        }
+
+/* qtd
+        if (d_function->jumpTableId() == -1) {
+            writePrivateNativeFunction(s, d_function);
+        }
+*/
+    } else {
+        s << ";" << endl;
+    }
+}
+
+static void write_equals_parts(QTextStream &s, const AbstractMetaFunctionList &lst, char prefix, bool *first) {
+    foreach (AbstractMetaFunction *f, lst) {
+        AbstractMetaArgument *arg = f->arguments().at(0);
+        QString type = f->typeReplaced(1);
+        if (type.isEmpty())
+            type = arg->type()->typeEntry()->qualifiedTargetLangName();
+        s << INDENT << (*first ? "if" : "else if") << " (other instanceof " << type << ")" << endl
+          << INDENT << "    return ";
+        if (prefix != 0) s << prefix;
+        s << f->name() << "((" << type << ") other);" << endl;
+        *first = false;
+    }
+}
+
+static void write_compareto_parts(QTextStream &s, const AbstractMetaFunctionList &lst, int value, bool *first) {
+    foreach (AbstractMetaFunction *f, lst) {
+        AbstractMetaArgument *arg = f->arguments().at(0);
+        QString type = f->typeReplaced(1);
+        if (type.isEmpty())
+            type = arg->type()->typeEntry()->qualifiedTargetLangName();
+        s << INDENT << (*first ? "if" : "else if") << " (other instanceof " << type << ") {" << endl
+          << INDENT << "    if (" << f->name() << "((" << type << ") other)) return " << value << ";" << endl
+          << INDENT << "    else return " << -value << ";" << endl
+          << INDENT << "}" << endl;
+        *first = false;
+    }
+    s << INDENT << "throw new ClassCastException();" << endl;
+}
+
+bool DGenerator::isComparable(const AbstractMetaClass *cls) const
+{
+    AbstractMetaFunctionList eq_functions = cls->equalsFunctions();
+    AbstractMetaFunctionList neq_functions = cls->notEqualsFunctions();
+
+    // Write the comparable functions
+    AbstractMetaFunctionList ge_functions = cls->greaterThanFunctions();
+    AbstractMetaFunctionList geq_functions = cls->greaterThanEqFunctions();
+    AbstractMetaFunctionList le_functions = cls->lessThanFunctions();
+    AbstractMetaFunctionList leq_functions = cls->lessThanEqFunctions();
+
+    bool hasEquals = eq_functions.size() || neq_functions.size();
+    bool isComparable = hasEquals
+                        ? ge_functions.size() || geq_functions.size() || le_functions.size() || leq_functions.size()
+                        : geq_functions.size() == 1 && leq_functions.size() == 1;
+
+    return isComparable;
+}
+
+
+void DGenerator::writeJavaLangObjectOverrideFunctions(QTextStream &s,
+                                                         const AbstractMetaClass *cls)
+{
+    AbstractMetaFunctionList eq_functions = cls->equalsFunctions();
+    AbstractMetaFunctionList neq_functions = cls->notEqualsFunctions();
+
+    if (eq_functions.size() || neq_functions.size()) {
+        s << endl
+          << INDENT << "@SuppressWarnings(\"unchecked\")" << endl
+          << INDENT << "@Override" << endl
+          << INDENT << "public boolean equals(Object other) {" << endl;
+        bool first = true;
+        write_equals_parts(s, eq_functions, (char) 0, &first);
+        write_equals_parts(s, neq_functions, '!', &first);
+        s << INDENT << "    return false;" << endl
+          << INDENT << "}" << endl << endl;
+    }
+
+    // Write the comparable functions
+    AbstractMetaFunctionList ge_functions = cls->greaterThanFunctions();
+    AbstractMetaFunctionList geq_functions = cls->greaterThanEqFunctions();
+    AbstractMetaFunctionList le_functions = cls->lessThanFunctions();
+    AbstractMetaFunctionList leq_functions = cls->lessThanEqFunctions();
+
+    bool hasEquals = eq_functions.size() || neq_functions.size();
+    bool comparable = isComparable(cls);
+    if (comparable) {
+        s << INDENT << "public int compareTo(Object other) {" << endl;
+        {
+            Indentation indent(INDENT);
+            if (hasEquals) {
+                s << INDENT << "if (equals(other)) return 0;" << endl;
+                bool first = false;
+                if (le_functions.size()) {
+                    write_compareto_parts(s, le_functions, -1, &first);
+                } else if (ge_functions.size()) {
+                    write_compareto_parts(s, ge_functions, 1, &first);
+                } else if (leq_functions.size()) {
+                    write_compareto_parts(s, leq_functions, -1, &first);
+                } else if (geq_functions.size()) {
+                    write_compareto_parts(s, geq_functions, 1, &first);
+                }
+
+            } else if (le_functions.size() == 1) {
+                QString className = cls->typeEntry()->qualifiedTargetLangName();
+                s << INDENT << "if (operator_less((" << className << ") other)) return -1;" << endl
+                  << INDENT << "else if (((" << className << ") other).operator_less(this)) return 1;" << endl
+                  << INDENT << "else return 0;" << endl;
+
+            } else if (geq_functions.size() == 1 && leq_functions.size()) {
+                QString className = cls->typeEntry()->qualifiedTargetLangName();
+                s << INDENT << "boolean less = operator_less_or_equal((" << className << ") other);" << endl
+                  << INDENT << "boolean greater = operator_greater_or_equal((" << className << ") other);" << endl
+                  << INDENT << "if (less && greater) return 0;" << endl
+                  << INDENT << "else if (less) return -1;" << endl
+                  << INDENT << "else return 1;" << endl;
+            }
+        }
+
+        s << INDENT << "}" << endl;
+    }
+
+
+    if (cls->hasHashFunction()) {
+        AbstractMetaFunctionList hashcode_functions = cls->queryFunctionsByName("hashCode");
+        bool found = false;
+        foreach (const AbstractMetaFunction *function, hashcode_functions) {
+            if (function->actualMinimumArgumentCount() == 0) {
+                found = true;
+                break;
+            }
+        }
+
+        if (!found) {
+            s << endl
+              << INDENT << "@Override" << endl
+              << INDENT << "public int hashCode() {" << endl
+              << INDENT << "    if (nativeId() == 0)" << endl
+              << INDENT << "        throw new QNoNativeResourcesException(\"Function call on incomplete object of type: \" +getClass().getName());" << endl
+              << INDENT << "    return __qt_hashCode(nativeId());" << endl
+              << INDENT << "}" << endl
+              << INDENT << "native int __qt_hashCode(long __this_nativeId);" << endl;
+        }
+    }
+
+    // Qt has a standard toString() conversion in QVariant?
+    QVariant::Type type = QVariant::nameToType(cls->qualifiedCppName().toLatin1());
+    if (QVariant(type).canConvert(QVariant::String) &&  !cls->hasToStringCapability()) {
+        AbstractMetaFunctionList tostring_functions = cls->queryFunctionsByName("toString");
+        bool found = false;
+        foreach (const AbstractMetaFunction *function, tostring_functions) {
+            if (function->actualMinimumArgumentCount() == 0) {
+                found = true;
+                break;
+            }
+        }
+
+        if (!found) {
+            s << endl
+              << INDENT << "@Override" << endl
+              << INDENT << "public String toString() {" << endl
+              << INDENT << "    if (nativeId() == 0)" << endl
+              << INDENT << "        throw new QNoNativeResourcesException(\"Function call on incomplete object of type: \" +getClass().getName());" << endl
+              << INDENT << "    return __qt_toString(nativeId());" << endl
+              << INDENT << "}" << endl
+              << INDENT << "native String __qt_toString(long __this_nativeId);" << endl;
+        }
+    }
+}
+
+void DGenerator::writeEnumOverload(QTextStream &s, const AbstractMetaFunction *d_function,
+                                      uint include_attributes, uint exclude_attributes)
+{
+    AbstractMetaArgumentList arguments = d_function->arguments();
+
+    if ((d_function->implementingClass() != d_function->declaringClass())
+        || ((!d_function->isNormal() && !d_function->isConstructor()) || d_function->isEmptyFunction() || d_function->isAbstract())) {
+        return ;
+    }
+
+
+    int option = 0;
+    if (d_function->isConstructor())
+        option = Option(option | SkipReturnType);
+    else
+        include_attributes |= AbstractMetaAttributes::FinalInTargetLang;
+
+    int generate_enum_overload = -1;
+    for (int i=0; i<arguments.size(); ++i)
+        generate_enum_overload = arguments.at(i)->type()->isTargetLangFlags() ? i : -1;
+
+    if (generate_enum_overload >= 0) {
+        if (m_doc_parser) {
+            // steal documentation from main function
+            QString signature = functionSignature(d_function,
+                                                  include_attributes | NoBlockedSlot,
+                                                  exclude_attributes);
+            s << m_doc_parser->documentationForFunction(signature) << endl;
+        }
+
+        s << endl;
+
+        writeFunctionAttributes(s, d_function, include_attributes, exclude_attributes, option);
+        s << d_function->name() << "(";
+        if (generate_enum_overload > 0) {
+            writeFunctionArguments(s, d_function, generate_enum_overload);
+            s << ", ";
+        }
+
+        // Write the ellipsis convenience argument
+        AbstractMetaArgument *affected_arg = arguments.at(generate_enum_overload);
+        EnumTypeEntry *originator = ((FlagsTypeEntry *)affected_arg->type()->typeEntry())->originator();
+
+        s << originator->javaPackage() << "." << originator->javaQualifier() << "." << originator->targetLangName()
+          << " ... " << affected_arg->argumentName() << ") {" << endl;
+
+        s << "        ";
+        QString new_return_type = d_function->typeReplaced(0);
+        if (new_return_type != "void" && (!new_return_type.isEmpty() || d_function->type() != 0))
+            s << "return ";
+
+        if (d_function->isConstructor()) {
+            s << "this";
+        } else {
+            if (d_function->isStatic())
+                s << d_function->implementingClass()->fullName() << ".";
+            else
+                s << "this.";
+            s << d_function->name();
+        }
+
+        s << "(";
+        for (int i=0; i<generate_enum_overload; ++i) {
+            s << arguments.at(i)->argumentName() << ", ";
+        }
+        s << "new " << affected_arg->type()->fullName() << "(" << affected_arg->argumentName() << "));" << endl
+          << "    }" << endl;
+    }
+}
+
+void DGenerator::writeInstantiatedType(QTextStream &s, const AbstractMetaType *abstractMetaType) const
+{
+    Q_ASSERT(abstractMetaType != 0);
+
+    const TypeEntry *type = abstractMetaType->typeEntry();
+    s << type->qualifiedTargetLangName();
+
+    if (abstractMetaType->hasInstantiations()) {
+        s << "<";
+        QList<AbstractMetaType *> instantiations = abstractMetaType->instantiations();
+        for(int i=0; i<instantiations.size(); ++i) {
+            if (i > 0)
+                s << ", ";
+
+            writeInstantiatedType(s, instantiations.at(i));
+        }
+        s << ">";
+    }
+}
+
+void DGenerator::writeFunctionOverloads(QTextStream &s, const AbstractMetaFunction *d_function,
+                                           uint include_attributes, uint exclude_attributes)
+{
+    AbstractMetaArgumentList arguments = d_function->arguments();
+    int argument_count = arguments.size();
+
+    // We only create the overloads for the class that actually declares the function
+    // unless this is an interface, in which case we create the overloads for all
+    // classes that directly implement the interface.
+    const AbstractMetaClass *decl_class = d_function->declaringClass();
+    if (decl_class->isInterface()) {
+        AbstractMetaClassList interfaces = d_function->implementingClass()->interfaces();
+        foreach (AbstractMetaClass *iface, interfaces) {
+            if (iface == decl_class) {
+                decl_class = d_function->implementingClass();
+                break;
+            }
+        }
+    }
+    if (decl_class != d_function->implementingClass())
+        return;
+
+    // Figure out how many functions we need to write out,
+    // One extra for each default argument.
+    int overload_count = 0;
+    uint excluded_attributes = AbstractMetaAttributes::Abstract
+                            | AbstractMetaAttributes::Native
+                            | exclude_attributes;
+    uint included_attributes = (d_function->isConstructor() ? 0 : AbstractMetaAttributes::Final) | include_attributes;
+
+    for (int i=0; i<argument_count; ++i) {
+        if (!arguments.at(i)->defaultValueExpression().isEmpty() && !d_function->argumentRemoved(i+1))
+            ++overload_count;
+    }
+    Q_ASSERT(overload_count <= argument_count);
+    for (int i=0; i<overload_count; ++i) {
+        int used_arguments = argument_count - i - 1;
+
+        QString signature = functionSignature(d_function, included_attributes,
+                                              excluded_attributes,
+                                              d_function->isEmptyFunction()
+                                              || d_function->isNormal()
+                                              || d_function->isSignal() ? NoOption
+                                                                           : SkipReturnType,
+                                              used_arguments);
+
+        s << endl;
+        if (m_doc_parser) {
+            s << m_doc_parser->documentationForFunction(signature) << endl;
+        }
+
+        s << signature << " {\n        ";
+        QString new_return_type = d_function->typeReplaced(0);
+        if (new_return_type != "void" && (!new_return_type.isEmpty() || d_function->type()))
+            s << "return ";
+        if (d_function->isConstructor())
+            s << "this";
+        else
+            s << d_function->name();
+        s << "(";
+
+        int written_arguments = 0;
+        for (int j=0; j<argument_count; ++j) {
+            if (!d_function->argumentRemoved(j+1)) {
+                if (written_arguments++ > 0)
+                    s << ", ";
+
+                if (j < used_arguments) {
+                    s << arguments.at(j)->argumentName();
+                } else {
+                    AbstractMetaType *arg_type = 0;
+                    QString modified_type = d_function->typeReplaced(j+1);
+                    if (modified_type.isEmpty()) {
+                        arg_type = arguments.at(j)->type();
+                        if (arg_type->isNativePointer()) {
+                            s << "(qt.QNativePointer)";
+                        } else {
+                            const AbstractMetaType *abstractMetaType = arguments.at(j)->type();
+                            const TypeEntry *type = abstractMetaType->typeEntry();
+                            if (type->designatedInterface())
+                                type = type->designatedInterface();
+                            if (!type->isEnum() && !type->isFlags()) {
+                                s << "(";
+                                writeInstantiatedType(s, abstractMetaType);
+                                s << ")";
+                            }
+                        }
+                    } else {
+                        s << "(" << modified_type.replace('$', '.') << ")";
+                    }
+
+                    QString defaultExpr = arguments.at(j)->defaultValueExpression();
+
+                    int pos = defaultExpr.indexOf(".");
+                    if (pos > 0) {
+                        QString someName = defaultExpr.left(pos);
+                        ComplexTypeEntry *ctype =
+                            TypeDatabase::instance()->findComplexType(someName);
+                        QString replacement;
+                        if (ctype != 0 && ctype->isVariant())
+                            replacement = "qt.QVariant.";
+                        else if (ctype != 0)
+                            replacement = ctype->javaPackage() + "." + ctype->targetLangName() + ".";
+                        else
+                            replacement = someName + ".";
+                        defaultExpr = defaultExpr.replace(someName + ".", replacement);
+                    }
+
+                    if (arg_type != 0 && arg_type->isFlags()) {
+                        s << "new " << arg_type->fullName() << "(" << defaultExpr << ")";
+                    } else {
+                        s << defaultExpr;
+                    }
+                }
+            }
+        }
+        s << ");\n    }" << endl;
+    }
+}
+
+const TypeEntry* DGenerator::fixedTypeEntry(const TypeEntry *type)
+{
+    if (!type)
+        return NULL;
+    if (type->designatedInterface())
+        return type;
+    else if (type->isEnum()) {
+        const EnumTypeEntry *te = static_cast<const EnumTypeEntry *>(type);
+        TypeEntry *ownerTe = TypeDatabase::instance()->findType(te->qualifier());
+        typeEntriesEnums << ownerTe;
+        return NULL;
+//        return ownerTe;
+    } else if (type->isFlags()) {
+        const FlagsTypeEntry *te = static_cast<const FlagsTypeEntry *>(type);
+        TypeEntry *ownerTe = TypeDatabase::instance()->findType(te->qualifier());
+        return NULL;
+//        return ownerTe;
+    } else //if (type->isObject())
+        return type;
+//    else return NULL;
+}
+
+void DGenerator::addInstantiations(const AbstractMetaType* d_type)
+{
+    if (d_type->isContainer()) {
+        QList<AbstractMetaType *> args = d_type->instantiations();
+        for (int i=0; i<args.size(); ++i) {
+            const TypeEntry *type = fixedTypeEntry(args.at(i)->typeEntry());
+            if (type)
+                typeEntries.insert(type);
+        }
+    }
+}
+
+void DGenerator::addTypeEntry(const AbstractMetaClass *d_class, const AbstractMetaFunction *function, QSet<const TypeEntry*> &typeEntries)
+{
+        // If a method in an interface class is modified to be private, this should
+        // not be present in the interface at all, only in the implementation.
+        if (d_class->isInterface()) {
+            uint includedAttributes = 0;
+            uint excludedAttributes = 0;
+            retrieveModifications(function, d_class, &excludedAttributes, &includedAttributes);
+            if (includedAttributes & AbstractMetaAttributes::Private)
+                return;
+        }
+
+        if (notWrappedYet(function)) // qtd2
+            return;
+
+        // return type for function
+        if (function->type()) {
+            addInstantiations(function->type());
+            const TypeEntry *type = fixedTypeEntry(function->type()->typeEntry());
+            if (type)
+                typeEntries.insert(type);
+        }
+
+        AbstractMetaArgumentList arguments = function->arguments();
+        for (int i=0; i<arguments.count(); ++i) {
+            const AbstractMetaArgument *arg = arguments.at(i);
+            addInstantiations(arg->type());
+            const TypeEntry *type = fixedTypeEntry(arg->type()->typeEntry());
+            if (type)
+                typeEntries.insert(type);
+        }
+}
+
+void DGenerator::fillRequiredImports(const AbstractMetaClass *d_class)
+{
+    if (m_recursive < 2) {
+        typeEntries.clear();
+        typeEntriesEnums.clear();
+    }
+
+    // import for base class
+    if(d_class->baseClass())
+        typeEntries << d_class->baseClass()->typeEntry();
+
+    //interfaces
+    AbstractMetaClassList interfaces = d_class->interfaces();
+    if (!interfaces.isEmpty()) {
+        for (int i=0; i<interfaces.size(); ++i) {
+            AbstractMetaClass *iface = interfaces.at(i);
+            InterfaceTypeEntry *te = (InterfaceTypeEntry*) iface->typeEntry();
+            typeEntries << te->origin();
+        }
+    }
+
+    AbstractMetaFunctionList d_funcs = d_class->functionsInTargetLang();
+
+    // in case of ConcreteWrapper - adding extra functions
+    if (!d_class->isInterface() && d_class->isAbstract()) {
+        AbstractMetaFunctionList functions_add = d_class->queryFunctions(AbstractMetaClass::NormalFunctions | AbstractMetaClass::AbstractFunctions | AbstractMetaClass::NonEmptyFunctions | AbstractMetaClass::NotRemovedFromTargetLang);
+        d_funcs << functions_add;
+    }
+
+    for (int i=0; i<d_funcs.size(); ++i) {
+        AbstractMetaFunction *function = d_funcs.at(i);
+        addTypeEntry(d_class, function, typeEntries);
+    }
+
+    // virtual dispatch
+    AbstractMetaFunctionList virtualFunctions = d_class->virtualFunctions();
+    for (int i=0; i<virtualFunctions.size(); ++i) {
+        AbstractMetaFunction *function = virtualFunctions.at(i);
+        addTypeEntry(d_class, function, typeEntries);
+    }
+
+    AbstractMetaFieldList fields = d_class->fields();
+    foreach (const AbstractMetaField *field, fields) {
+        if (field->wasPublic() || (field->wasProtected() && !d_class->isFinal())) {
+            addTypeEntry(d_class, field->setter(), typeEntries);
+            addTypeEntry(d_class, field->getter(), typeEntries);
+        }
+    }
+
+    // signals
+    AbstractMetaFunctionList signal_funcs = d_class->queryFunctions(AbstractMetaClass::Signals
+                                                                   | AbstractMetaClass::Visible
+                                                                   | AbstractMetaClass::NotRemovedFromTargetLang);
+    for (int i=0; i<signal_funcs.size(); ++i)
+        addTypeEntry(d_class, signal_funcs.at(i), typeEntries);
+
+    if(d_class->isQObject() && d_class->name() != "QObject")
+        typeEntries << TypeDatabase::instance()->findType("QObject");
+
+    if(m_recursive == 1)
+        m_recursive++;
+}
+
+void DGenerator::writeImportString(QTextStream &s, const TypeEntry* typeEntry)
+{
+/*    QString visibility = "private";
+    if (typeEntry->isNamespace() || typeEntry->name() == "QObject")
+        visibility = "public";
+    if(d_class->baseClass() && d_class->baseClass()->typeEntry() == typeEntry)
+        visibility = "public";*/
+    QString visibility = "public";
+    s << QString("%1 import ").arg(visibility) << typeEntry->javaPackage() << "." << typeEntry->name() << ";" << endl;
+}
+
+void DGenerator::writeRequiredImports(QTextStream &s, const AbstractMetaClass *d_class)
+{
+    foreach (const TypeEntry *typeEntry, typeEntriesEnums) {
+        if (!excludedTypes.contains(typeEntry->name()) && d_class->typeEntry() != typeEntry
+            && typeEntry->javaQualifier() != typeEntry->name()
+/*also*/            && !excludedTypes2.contains(typeEntry->name()))
+            writeImportString(s, typeEntry);
+    }
+
+    foreach (const TypeEntry *typeEntry, typeEntries) {
+        if (!excludedTypes.contains(typeEntry->name()) && d_class->typeEntry() != typeEntry
+            && typeEntry->javaQualifier() != typeEntry->name()
+/*also*/            && !excludedTypes2.contains(typeEntry->name()))
+            writeImportString(s, typeEntry);
+    }
+    excludedTypes2.clear();
+}
+
+void DGenerator::writeDestructor(QTextStream &s, const AbstractMetaClass *d_class)
+{
+    if (!d_class->hasConstructors())
+        return;
+
+    s << endl;
+    if (d_class->baseClassName().isEmpty()) {
+        s << INDENT << "~this() { " << endl;
+        {
+            Indentation indent(INDENT);
+
+            if(d_class->name() == "QObject")
+                s << INDENT << "if(!__gc_managed)" << endl
+                  << INDENT << "    remove(__gc_ref_list, this);" << endl
+                  << INDENT << "if(!__no_real_delete && __gc_managed)" << endl
+                  << INDENT << "    __free_native_resources();" << endl;
+            else
+                s << INDENT << "if(!__no_real_delete)" << endl
+                  << INDENT << "    __free_native_resources();" << endl;
+        }
+        s << INDENT << "}" << endl << endl;
+    }
+
+    s << INDENT << "protected void __free_native_resources() {" << endl;
+    {
+        Indentation indent(INDENT);
+        s << INDENT << "qtd_" << d_class->name() << "_destructor(nativeId());" << endl;
+    }
+    s << INDENT << "}" << endl << endl;
+}
+
+void DGenerator::writeOwnershipMethods(QTextStream &s, const AbstractMetaClass *d_class)
+{
+    s << INDENT << "void __set_native_ownership(bool ownership_)";
+    if (d_class->isInterface() || d_class->isNamespace())
+        s << ";";
+    else {
+        s << " {" << endl
+          << INDENT << "    __no_real_delete = ownership_;" << endl
+          << INDENT << "}" << endl << endl;
+    }
+}
+
+void DGenerator::writeSignalHandlers(QTextStream &s, const AbstractMetaClass *d_class)
+{
+    AbstractMetaFunctionList signal_funcs = signalFunctions(d_class);
+
+    //TODO: linkage trivia should be abstracted away
+    QString attr;
+
+    s << "// signal handlers" << endl;
+    foreach(AbstractMetaFunction *signal, signal_funcs) {
+        QString sigExternName = signalExternName(d_class, signal);
+
+        s << "private " << attr << "extern(C) void " << sigExternName << "_connect(void* native_id);" << endl;
+        s << "private " << attr << "extern(C) void " << sigExternName << "_disconnect(void* native_id);" << endl;
+
+        QString extra_args;
+
+        AbstractMetaArgumentList arguments = signal->arguments();
+        foreach (AbstractMetaArgument *argument, arguments) {
+            if(argument->type()->isContainer()) {
+                QString arg_name = argument->indexedName();
+                const AbstractMetaType *arg_type = argument->type();
+                QString type_string = translateType(argument->type(), signal->implementingClass(), BoxedPrimitive);
+                extra_args += ", " + type_string + " " + arg_name;
+            }
+        }
+
+        s << "private extern(C) void " << sigExternName << "_handle_in_d(void* d_entity, void** args" << extra_args<< ") {" << endl;
+        {
+            Indentation indent(INDENT);
+            s << INDENT << "auto d_object = cast(" << d_class->name() << ") d_entity;" << endl;
+            int sz = arguments.count();
+
+            for (int j=0; j<sz; ++j) {
+                AbstractMetaArgument *argument = arguments.at(j);
+                QString arg_name = argument->indexedName();
+                AbstractMetaType *type = argument->type();
+                // if has QString argument we have to pass char* and str.length to QString constructor
+
+                QString arg_ptr = QString("args[%1]").arg(argument->argumentIndex() + 1);
+
+                if (type->isTargetLangString())
+                    s << INDENT << "auto " << arg_name << "_ptr = " << arg_ptr << ";" << endl
+                      << INDENT << "string " << arg_name << " = QString.toNativeString(" << arg_name << "_ptr);";
+                else if(type->isPrimitive() || type->isEnum() || type->isFlags() || type->typeEntry()->isStructInD()) {
+                    QString type_name = argument->type()->typeEntry()->qualifiedTargetLangName();
+                    if (type->isFlags())
+                        type_name = "int";
+                    s << INDENT << "auto " << arg_name << " = *(cast(" << type_name << "*)" << arg_ptr << ");";
+                } else if(type->isObject() || type->isQObject()
+                        || (type->typeEntry()->isValue() && type->isNativePointer())
+                        || type->isValue()) {
+                        QString type_name = type->name();
+                        const ComplexTypeEntry *ctype = static_cast<const ComplexTypeEntry *>(type->typeEntry());
+                        if(ctype->isAbstract())
+                            type_name = type_name + "_ConcreteWrapper";
+                        s << INDENT << "scope " << arg_name << " = new " << type_name
+                                    << "(cast(void*)(" << arg_ptr << "), true);" << endl
+                          << INDENT << arg_name << ".__no_real_delete = true;";
+                    }
+                s << endl;
+            }
+//            s << INDENT << "Stdout(\"" << d_class->name() << "\", \"" << signal->name() << "\").newline;" << endl;
+            s << INDENT << "d_object." << signal->name() << ".emit(";
+            for (int j = 0; j<sz; ++j) {
+                AbstractMetaArgument *argument = arguments.at(j);
+                QString arg_name = argument->indexedName();
+                if (j != 0)
+                    s << ", ";
+                s << arg_name;
+            }
+
+            s << ");" << endl;
+        }
+        s << "}" << endl;
+    }
+}
+
+void DGenerator::write(QTextStream &s, const AbstractMetaClass *d_class)
+{
+    ReportHandler::debugSparse("Generating class: " + d_class->fullName());
+
+    bool fakeClass = d_class->attributes() & AbstractMetaAttributes::Fake;
+
+    if (m_docs_enabled) {
+        m_doc_parser = new DocParser(m_doc_directory + "/" + d_class->name().toLower() + ".jdoc");
+    }
+    if (!m_isRecursive)
+        s << "module " << d_class->package() << "." << d_class->name() <<";" << endl << endl;
+
+
+    s << "// some type info" << endl;
+    QString hasVirtuals = d_class->hasVirtualFunctions() ? "has" : "doesn't have";
+    QString isFinal = d_class->isFinal() ? "is" : "is not";
+    QString isNativeId = d_class->typeEntry()->isNativeIdBased() ? "is" : "is not";
+    s << "// " << hasVirtuals << " virtual functions" << endl
+      << "// " << isFinal << " final" << endl
+      << "// " << isNativeId << " native id based" << endl << endl
+      << "// " << d_class->generateShellClass() << " shell class" << endl
+      << "// " << d_class->hasVirtualFunctions() << endl
+      << "// " << d_class->hasProtectedFunctions() << endl
+      << "// " << d_class->hasFieldAccessors() << endl
+      << "// " << d_class->typeEntry()->isObject() << endl;
+
+
+    const ComplexTypeEntry *ctype = d_class->typeEntry();
+    if (!ctype->addedTo.isEmpty() && !m_isRecursive) {
+        ComplexTypeEntry *ctype_parent = TypeDatabase::instance()->findComplexType(ctype->addedTo);
+        s << "public import " << ctype_parent->javaPackage() << "." << ctype_parent->name() << ";" << endl;
+        return;
+    }
+
+    if(d_class->isInterface() && !m_isRecursive) {
+        s << "public import " << ctype->javaPackage() << "." << ctype->qualifiedCppName() << ";" << endl;
+        return;
+    }
+    AbstractMetaClassList includedClassesList;
+
+    /* m_recursive is increasing by 1 each time we fill the import for a class
+       if it equals to 0 or 1 imports Set is cleared before a filling cycle - if there
+       is only one class as usual or if there are many classes in module, but before
+       filling for first class we need to clear Set. Wow :)
+       */
+    if(ctype->includedClasses.size() > 0)
+        m_recursive = 1;
+    else
+        m_recursive = 0;
+
+    foreach(QString child, ctype->includedClasses) {
+        ComplexTypeEntry *ctype_child = TypeDatabase::instance()->findComplexType(child);
+        foreach (AbstractMetaClass *cls, m_classes) {
+            if ( cls->name() == ctype_child->name() ) {
+                includedClassesList << cls;
+                fillRequiredImports(cls);
+                excludedTypes2 << cls->name();
+            }
+        }
+    }
+
+    QString interface;
+    if(d_class->typeEntry()->designatedInterface())
+        interface = d_class->typeEntry()->designatedInterface()->name();
+
+    if(d_class->typeEntry()->designatedInterface()) {
+        foreach (AbstractMetaClass *cls, m_classes) {
+            if ( cls->name() == interface ) {
+                includedClassesList << cls;
+                fillRequiredImports(cls);
+                excludedTypes2 << cls->name();
+            }
+        }
+    }
+
+    fillRequiredImports(d_class);
+    excludedTypes2 << d_class->name();
+    if(ctype->includedClasses.size() > 0)
+        m_recursive = 0;
+
+    QList<Include> includes = d_class->typeEntry()->extraIncludes();
+    foreach (const Include &inc, includes) {
+        if (inc.type == Include::TargetLangImport) {
+            s << inc.toString() << endl;
+        }
+    }
+
+    if (!m_isRecursive) {
+        s << "public import qt.QGlobal;" << endl
+          << "public import qt.core.Qt;" << endl
+          << "import qt.QtDObject;" << endl
+          << "import qt.core.QString;" << endl
+          << "import qt.qtd.Array;" << endl;
+        if (d_class->isQObject()) {
+            s << "public import qt.Signal;" << endl;
+            if (d_class->name() != "QObject")
+                s << "public import qt.core.QObject;" << endl;
+        }
+
+        // qtd2 hack!
+        if (d_class->name() == "QCoreApplication")
+            s << "private import qt.core.ArrayOps;" << endl;
+        else if (d_class->name() == "QApplication")
+            s << "private import qt.gui.ArrayOps;" << endl;
+
+        if (!d_class->enums().isEmpty())
+            s << "public import " << d_class->package() << "." << d_class->name() << "_enum;" << endl << endl;
+
+        s << "// automatic imports-------------" << endl;
+        writeRequiredImports(s, d_class);
+        s << endl;
+        if (dPhobos)
+        {
+            s << "import std.stdio;" << endl
+              << "import std.string;" << endl
+              << "import std.utf;" << endl
+              << "import core.memory;";
+        }
+        else
+        {
+            s << "import tango.io.Stdout;" << endl
+              << "import tango.stdc.stringz;" << endl
+              << "import tango.text.convert.Utf;" << endl
+              << "import tango.core.Memory;";
+        }
+        s << endl << endl << endl;
+    }
+
+    if (m_doc_parser) {
+        s << m_doc_parser->documentation(d_class) << endl << endl;
+    }
+
+/* qtd    s << "@QtJambiGeneratedClass" << endl;
+
+    if ((d_class->typeEntry()->typeFlags() & ComplexTypeEntry::Deprecated) != 0) {
+        s << "@Deprecated" << endl;
+    }
+*/
+
+    // Enums aliases outside of the class - hack
+    if (!d_class->enums().isEmpty()) {
+        QString fileName = QString("%1_enum.d").arg(d_class->name());
+        FileOut fileOut(outputDirectory() + "/" + subDirectoryForClass(d_class) + "/" + fileName);
+
+        fileOut.stream << "module " << d_class->package() << "." << d_class->name() << "_enum;" << endl << endl;
+        foreach (AbstractMetaEnum *d_enum, d_class->enums())
+            writeEnum(fileOut.stream, d_enum);
+    }
+
+
+    s << endl;
+
+    if (d_class->isInterface()) {
+        s << "public interface ";
+    } else {
+        if (d_class->isPublic())
+            s << "public ";
+        // else friendly
+
+        bool force_abstract = (d_class->typeEntry()->typeFlags() & ComplexTypeEntry::ForceAbstract) != 0;
+        if (d_class->isFinal() && !force_abstract)
+            s << "final ";
+        if ((d_class->isAbstract() && !d_class->isNamespace()) || force_abstract)
+            s << "abstract ";
+
+        if (!d_class->typeEntry()->targetType().isEmpty()) {
+            s << d_class->typeEntry()->targetType() << " ";
+        } else if (d_class->isNamespace() && d_class->functionsInTargetLang().size() == 0) {
+            s << "interface ";
+        } else if (d_class->isNamespace()) {
+            s << "class ";
+        } else {
+            s << "class ";
+        }
+
+    }
+
+    const ComplexTypeEntry *type = d_class->typeEntry();
+
+    s << d_class->name();
+
+    if (type->isGenericClass()) {
+        s << "<";
+        QList<TypeEntry *> templateArguments = d_class->templateBaseClass()->templateArguments();
+        for (int i=0; i<templateArguments.size(); ++i) {
+            TypeEntry *templateArgument = templateArguments.at(i);
+            if (i > 0)
+                s << ", ";
+            s << templateArgument->name();
+        }
+        s << ">";
+    }
+
+    if (!d_class->isNamespace() && !d_class->isInterface()) {
+        if (!d_class->baseClassName().isEmpty()) {
+            s << " : " << d_class->baseClass()->name();
+        } else {
+            QString sc = type->defaultSuperclass();
+            if ((sc != d_class->name()) && !sc.isEmpty())
+                s << " : " << sc;
+        }
+    }/* qtd else if (d_class->isInterface()) {
+        s << " extends QtJambiInterface";
+    }*/
+
+    // implementing interfaces...
+    bool implements = false;
+    AbstractMetaClassList interfaces = d_class->interfaces();
+    if (!interfaces.isEmpty()) {
+        if (!d_class->isInterface())
+            s << ", ";
+        else {
+            implements = true;
+            s << ": ";
+        }
+        for (int i=0; i<interfaces.size(); ++i) {
+            AbstractMetaClass *iface = interfaces.at(i);
+            if (i) s << ", ";
+            s << iface->name();
+        }
+    }
+/* qtd
+    if (isComparable(d_class)) {
+        if (!implements) {
+            implements = true;
+            s << endl << "    implements ";
+        }
+        else
+            s << "," << endl << "            ";
+        s << "java.lang.Comparable<Object>";
+    }
+
+    if (d_class->hasCloneOperator()) {
+        if (!implements) {
+            implements = true;
+            s << endl << "    implements ";
+        }
+        else
+            s << "," << endl << "            ";
+        s << "java.lang.Cloneable";
+    }
+*/
+    s << endl << "{" << endl;
+
+    Indentation indent(INDENT);
+
+    // Define variables for reference count mechanism
+    if (!d_class->isInterface() && !d_class->isNamespace()) {
+        QHash<QString, int> variables;
+        foreach (AbstractMetaFunction *function, d_class->functions()) {
+            QList<ReferenceCount> referenceCounts = function->referenceCounts(d_class);
+            foreach (ReferenceCount refCount, referenceCounts) {
+                variables[refCount.variableName] |= refCount.action
+                                                    | refCount.access
+                                                    | (refCount.threadSafe ? ReferenceCount::ThreadSafe : 0)
+                                                    | (function->isStatic() ? ReferenceCount::Static : 0)
+                                                    | (refCount.declareVariable.isEmpty() ? ReferenceCount::DeclareVariable : 0);
+            }
+        }
+
+        foreach (QString variableName, variables.keys()) {
+            int actions = variables.value(variableName) & ReferenceCount::ActionsMask;
+//            bool threadSafe = variables.value(variableName) & ReferenceCount::ThreadSafe;
+            bool isStatic = variables.value(variableName) & ReferenceCount::Static;
+            bool declareVariable = variables.value(variableName) & ReferenceCount::DeclareVariable;
+            int access = variables.value(variableName) & ReferenceCount::AccessMask;
+
+            if (actions == ReferenceCount::Ignore || !declareVariable)
+                continue;
+
+            if (((actions & ReferenceCount::Add) == 0) != ((actions & ReferenceCount::Remove) == 0)) {
+                QString warn = QString("either add or remove specified for reference count variable '%1' in '%2' but not both")
+                    .arg(variableName).arg(d_class->fullName());
+                ReportHandler::warning(warn);
+            }
+            s << endl;
+/* qtd
+            if (TypeDatabase::instance()->includeEclipseWarnings())
+                s << INDENT << "@SuppressWarnings(\"unused\")" << endl;
+*/
+            if (actions != ReferenceCount::Set && actions != ReferenceCount::Ignore) { // qtd2
+
+            s << INDENT;
+            switch (access) {
+            case ReferenceCount::Private:
+                s << "package "; break; // qtd
+            case ReferenceCount::Protected:
+                s << "protected "; break;
+            case ReferenceCount::Public:
+                s << "public "; break;
+            default:
+                s << "protected"; // friendly
+            }
+
+            if (isStatic)
+                s << "static ";
+
+            } // qtd2
+
+            if (actions != ReferenceCount::Set && actions != ReferenceCount::Ignore) {
+                s << "Object[] " << variableName << ";" << endl;
+/*
+                if (threadSafe)
+                    s << "java.util.Collections.synchronizedCollection(";
+                s << "new java.util.ArrayList<Object>()";
+                if (threadSafe)
+                    s << ")";
+                s << ";" << endl;*/
+            } else if (actions != ReferenceCount::Ignore) {
+/* qtd2               if (threadSafe)
+                    s << "synchronized ";*/
+                s << "Object " << variableName << " = null;" << endl;
+            }
+        }
+        s << endl;
+    }
+
+/* qtd2
+    if (!d_class->isInterface() && (!d_class->isNamespace() || d_class->functionsInTargetLang().size() > 0)
+        && (d_class->baseClass() == 0 || d_class->package() != d_class->baseClass()->package())) {
+        s << endl
+          << INDENT << "static {" << endl;
+
+        if (d_class->isNamespace()) {
+            s << INDENT << "    qt.QtJambi_LibraryInitializer.init();" << endl;
+        }
+
+        s << INDENT << "    " << d_class->package() << ".QtJambi_LibraryInitializer.init();" << endl
+          << INDENT << "}" << endl;
+    }
+*/
+
+    // Enums aliaases
+    foreach (AbstractMetaEnum *d_enum, d_class->enums())
+        writeEnumAlias(s, d_enum);
+
+    if (!d_class->enums().isEmpty() && !d_class->functions().isEmpty())
+        s << endl;
+
+    // Signals
+    AbstractMetaFunctionList signal_funcs;
+
+    signal_funcs = signalFunctions(d_class);
+    if (signal_funcs.size())
+    {
+        writeSignalConnectors(s, d_class, signal_funcs);
+        foreach (AbstractMetaFunction *signal, signal_funcs)
+        {
+            if (d_class == signal->implementingClass())
+                writeSignal(s, signal);
+        }
+    }
+
+    // Class has subclasses but also only private constructors
+    if (!d_class->isFinalInTargetLang() && d_class->isFinalInCpp()) {
+        s << endl << INDENT << "/**" << endl
+          << INDENT << " * This constructor is a place holder intended to prevent" << endl
+          << INDENT << " * users from subclassing the class. Certain classes can" << endl
+          << INDENT << " * unfortunately only be subclasses internally. The constructor" << endl
+          << INDENT << " * will indiscriminately throw an exception if called. If the" << endl
+          << INDENT << " * exception is ignored, any use of the constructed object will" << endl
+          << INDENT << " * cause an exception to occur." << endl << endl
+          << INDENT << " * @throws QClassCannotBeSubclassedException" << endl
+          << INDENT << " **/" << endl
+          << INDENT << "protected " << d_class->name() << "() throws QClassCannotBeSubclassedException {" << endl
+          << INDENT << "    throw new QClassCannotBeSubclassedException(" << d_class->name() << ".class);" << endl
+          << INDENT << "}" << endl << endl;
+    }
+    s << "// Functions" << endl;
+
+    // Functions
+    AbstractMetaFunctionList d_funcs = d_class->functionsInTargetLang();
+    for (int i=0; i<d_funcs.size(); ++i) {
+        AbstractMetaFunction *function = d_funcs.at(i);
+
+        // If a method in an interface class is modified to be private, this should
+        // not be present in the interface at all, only in the implementation.
+        if (d_class->isInterface()) {
+            uint includedAttributes = 0;
+            uint excludedAttributes = 0;
+            retrieveModifications(function, d_class, &excludedAttributes, &includedAttributes);
+            if (includedAttributes & AbstractMetaAttributes::Private)
+                continue;
+        }
+
+        if (!notWrappedYet(function)) // qtd2
+            writeFunction(s, function);
+//        s << function->minimalSignature() << endl;
+    }
+    if(d_class->isInterface())
+        s << endl << INDENT << "public void* __ptr_" << d_class->name() << "();" << endl << endl;
+
+
+    s << "// Field accessors" << endl;
+    // Field accessors
+    AbstractMetaFieldList fields = d_class->fields();
+    foreach (const AbstractMetaField *field, fields) {
+        if (field->wasPublic() || (field->wasProtected() && !d_class->isFinal()))
+            writeFieldAccessors(s, field);
+    }
+
+/* qtd
+
+    // the static fromNativePointer function...
+    if (!d_class->isNamespace() && !d_class->isInterface() && !fakeClass) {
+        s << endl
+          << INDENT << "public static native " << d_class->name() << " fromNativePointer("
+          << "QNativePointer nativePointer);" << endl;
+    }
+
+    if (d_class->isQObject()) {
+        s << endl;
+        if (TypeDatabase::instance()->includeEclipseWarnings())
+            s << INDENT << "@SuppressWarnings(\"unused\")" << endl;
+
+        s << INDENT << "private static native long originalMetaObject();" << endl;
+    }
+
+    // The __qt_signalInitialization() function
+    if (signal_funcs.size() > 0) {
+        s << endl
+          << INDENT << "@Override" << endl
+          << INDENT << "@QtBlockedSlot protected boolean __qt_signalInitialization(String name) {" << endl
+          << INDENT << "    return (__qt_signalInitialization(nativeId(), name)" << endl
+          << INDENT << "            || super.__qt_signalInitialization(name));" << endl
+          << INDENT << "}" << endl
+          << endl
+          << INDENT << "@QtBlockedSlot" << endl
+          << INDENT << "private native boolean __qt_signalInitialization(long ptr, String name);" << endl;
+    }
+*/
+    // Add dummy constructor for use when constructing subclasses
+    if (!d_class->isNamespace() && !d_class->isInterface() && !fakeClass) {
+        s << endl
+          << INDENT << "public "
+          << "this";
+
+        if(d_class->name() == "QObject")
+        {
+            {
+                Indentation indent(INDENT);
+                s << "(void* native_id, bool gc_managed) {" << endl
+                  << INDENT << "if(!gc_managed)" << endl
+                  << INDENT << "    __gc_ref_list ~= this;" << endl
+                  << INDENT << "__gc_managed = gc_managed;" << endl
+                  << INDENT << "super(native_id);" << endl;
+            }
+        }
+        else {
+            Indentation indent(INDENT);
+            if(d_class->isQObject())
+                s << "(void* native_id, bool gc_managed) {" << endl
+                  << INDENT << "super(native_id, gc_managed);" << endl;
+            else
+                s << "(void* native_id, bool no_real_delete = false) {" << endl
+                  << INDENT << "super(native_id, no_real_delete);" << endl;
+        }
+
+        // customized store-result instances
+        d_funcs = d_class->functionsInTargetLang();
+        for (int i=0; i<d_funcs.size(); ++i) {
+            AbstractMetaFunction *d_function = d_funcs.at(i);
+            uint included_attributes = 0;
+            uint excluded_attributes = 0;
+            setupForFunction(d_function, &included_attributes, &excluded_attributes);
+            uint attr = d_function->attributes() & (~excluded_attributes) | included_attributes;
+            bool isStatic = (attr & AbstractMetaAttributes::Static);
+
+            if (!isStatic && (attr & AbstractMetaAttributes::Abstract))
+                continue;
+
+            if(d_function->storeResult()) {
+                QString type_name = d_function->type()->name();
+                const ComplexTypeEntry *ctype = static_cast<const ComplexTypeEntry *>(d_function->type()->typeEntry());
+                if(ctype->isAbstract())
+                    type_name = type_name + "_ConcreteWrapper";
+
+                s << INDENT << "    __m_" << d_function->name() << " = new "
+                        << type_name << "(cast(void*)null);" << endl;
+                if (d_function->type()->isQObject())
+                    s << INDENT << "    __m_" << d_function->name() << ".__no_real_delete = true;" << endl;
+            }
+        }
+
+        // pointers to native interface objects for classes that implement interfaces
+        // initializing
+        interfaces = d_class->interfaces();
+        if (!interfaces.isEmpty()) {
+            for (int i=0; i<interfaces.size(); ++i) {
+                AbstractMetaClass *iface = interfaces.at(i);
+
+                s << INDENT << "    __m_ptr_" << iface->name() << " = qtd_" << d_class->name() << "_cast_to_" << iface->qualifiedCppName()
+                  << "(nativeId);" << endl;
+            }
+        }
+
+
+        s << INDENT << "}" << endl << endl;
+
+/******************!!!DUBLICATE OF ABOVE!!!*********************/
+        for (int i=0; i<d_funcs.size(); ++i) {
+            AbstractMetaFunction *d_function = d_funcs.at(i);
+            uint included_attributes = 0;
+            uint excluded_attributes = 0;
+            setupForFunction(d_function, &included_attributes, &excluded_attributes);
+            uint attr = d_function->attributes() & (~excluded_attributes) | included_attributes;
+            bool isStatic = (attr & AbstractMetaAttributes::Static);
+
+            if (!isStatic && (attr & AbstractMetaAttributes::Abstract))
+                continue;
+
+            if(d_function->storeResult()) {
+                QString type_name = d_function->type()->name();
+                const ComplexTypeEntry *ctype = static_cast<const ComplexTypeEntry *>(d_function->type()->typeEntry());
+                if(ctype->isAbstract())
+                    type_name = type_name + "_ConcreteWrapper";
+
+                s << INDENT << type_name << " __m_" << d_function->name() << ";" << endl;
+            }
+        }
+/***************************************************************/
+
+        // pointers to native interface objects for classes that implement interfaces
+        // initializing
+        interfaces = d_class->interfaces();
+        if (!interfaces.isEmpty()) {
+            for (int i=0; i<interfaces.size(); ++i) {
+                AbstractMetaClass *iface = interfaces.at(i);
+
+                s << INDENT << "private void* __m_ptr_" << iface->name() << ";" << endl
+                  << INDENT << "public void* __ptr_" << iface->name() << "() { return __m_ptr_" << iface->name() << "; }" << endl << endl;
+            }
+        }
+
+        writeDestructor(s, d_class);
+    }
+
+/* qtd
+    // Add a function that converts an array of the value type to a QNativePointer
+    if (d_class->typeEntry()->isValue() && !fakeClass) {
+        s << endl
+          << INDENT << "public static native QNativePointer nativePointerArray(" << d_class->name()
+          << " array[]);" << endl;
+    }
+
+    // write the cast to this function....
+    if (d_class->isInterface()) {
+        s << endl
+          << "    public long __qt_cast_to_"
+          << static_cast<const InterfaceTypeEntry *>(type)->origin()->targetLangName()
+          << "(long ptr);" << endl;
+    } else {
+        foreach (AbstractMetaClass *cls, interfaces) {
+            s << endl
+              << "    @QtBlockedSlot public native long __qt_cast_to_"
+              << static_cast<const InterfaceTypeEntry *>(cls->typeEntry())->origin()->targetLangName()
+              << "(long ptr);" << endl;
+        }
+    }
+*/
+
+/* qtd    writeJavaLangObjectOverrideFunctions(s, d_class);
+*/
+    writeOwnershipMethods(s, d_class);
+    s << "// Injected code in class" << endl;
+    writeExtraFunctions(s, d_class);
+// qtd2    writeToStringFunction(s, d_class);
+/* qtd
+    if (d_class->hasCloneOperator()) {
+        writeCloneFunction(s, d_class);
+    }
+*/
+    s << "}" << endl;
+
+    interfaces = d_class->interfaces();
+    if (!interfaces.isEmpty()) {
+        for (int i=0; i<interfaces.size(); ++i) {
+            AbstractMetaClass *iface = interfaces.at(i);
+
+            s << INDENT << "private static extern (C) void*" << "qtd_" << d_class->name() << "_cast_to_" << iface->qualifiedCppName()
+                    << "(void* nativeId);" << endl;
+        }
+    }
+
+    if (!d_class->isInterface() && d_class->isAbstract()) {
+        s << endl;
+/* qtd
+        if (TypeDatabase::instance()->includeEclipseWarnings())
+            s << INDENT << "@SuppressWarnings(\"unused\")" << endl;
+*/
+        s << INDENT << "public class " << d_class->name() << "_ConcreteWrapper : " << d_class->name() << " {" << endl;
+
+        {
+            Indentation indent(INDENT);
+            s << INDENT << "public this(void* native_id, bool no_real_delete = true) {" << endl
+                    << INDENT << "    super(native_id, no_real_delete);" << endl;
+
+
+
+
+            /******************!!!DUBLICATE!!!*********************/
+            d_funcs = d_class->functionsInTargetLang();
+            for (int i=0; i<d_funcs.size(); ++i) {
+                AbstractMetaFunction *d_function = d_funcs.at(i);
+                uint included_attributes = 0;
+                uint excluded_attributes = 0;
+                setupForFunction(d_function, &included_attributes, &excluded_attributes);
+                uint attr = d_function->attributes() & (~excluded_attributes) | included_attributes;
+// qtd                bool isStatic = (attr & AbstractMetaAttributes::Static);
+
+                if(d_function->storeResult()) {
+                    QString type_name = d_function->type()->name();
+                    const ComplexTypeEntry *ctype = static_cast<const ComplexTypeEntry *>(d_function->type()->typeEntry());
+                    if(ctype->isAbstract())
+                        type_name = type_name + "_ConcreteWrapper";
+                    s << INDENT << "    __m_" << d_function->name() << " = new "
+                            << type_name << "(cast(void*)null);" << endl;
+                    if (d_function->type()->isQObject())
+                        s << INDENT << "    __m_" << d_function->name() << ".__no_real_delete = true;" << endl;
+                }
+            }
+
+            s << INDENT << "}" << endl << endl;
+
+            for (int i=0; i<d_funcs.size(); ++i) {
+                AbstractMetaFunction *d_function = d_funcs.at(i);
+                uint included_attributes = 0;
+                uint excluded_attributes = 0;
+                setupForFunction(d_function, &included_attributes, &excluded_attributes);
+                uint attr = d_function->attributes() & (~excluded_attributes) | included_attributes;
+// qtd                bool isStatic = (attr & AbstractMetaAttributes::Static);
+
+                if(d_function->storeResult()) {
+                    QString type_name = d_function->type()->name();
+                    const ComplexTypeEntry *ctype = static_cast<const ComplexTypeEntry *>(d_function->type()->typeEntry());
+                    if(ctype->isAbstract())
+                        type_name = type_name + "_ConcreteWrapper";
+
+                    s << INDENT << d_function->type()->name() << " __m_" << d_function->name() << ";" << endl;
+                }
+            }
+            /***************************************************************/
+
+
+
+
+
+
+            uint exclude_attributes = AbstractMetaAttributes::Native | AbstractMetaAttributes::Abstract;
+            uint include_attributes = 0;
+            AbstractMetaFunctionList functions = d_class->queryFunctions(AbstractMetaClass::NormalFunctions | AbstractMetaClass::AbstractFunctions | AbstractMetaClass::NonEmptyFunctions | AbstractMetaClass::NotRemovedFromTargetLang);
+            foreach (const AbstractMetaFunction *d_function, functions) {
+                retrieveModifications(d_function, d_class, &exclude_attributes, &include_attributes);
+                if (notWrappedYet(d_function))
+                    continue;
+                /* qtd                s << endl
+                  << INDENT << "@Override" << endl; */
+                writeFunctionAttributes(s, d_function, include_attributes, exclude_attributes,
+                                        d_function->isNormal() || d_function->isSignal() ? 0 : SkipReturnType);
+
+                s << d_function->name() << "(";
+                writeFunctionArguments(s, d_function, d_function->arguments().count());
+                s << ") {" << endl;
+                {
+                    Indentation indent(INDENT);
+                    writeJavaCallThroughContents(s, d_function, SuperCall);
+                }
+                s << INDENT << "}" << endl;
+            }
+        }
+        s  << INDENT << "}" << endl << endl;
+    }
+
+    if (d_class->generateShellClass()) { // qtd2
+        if (d_class->hasVirtualFunctions()
+            && (d_class->typeEntry()->isObject() || d_class->typeEntry()->isQObject()) )
+        s << endl << "extern (C) void *__" << d_class->name() << "_entity(void *q_ptr);" << endl << endl;
+    }
+    if (d_class->isQObject()) {
+        s<< "private extern (C) void qtd_D_" << d_class->name() << "_delete(void *d_ptr) {" << endl
+          << "    auto d_ref = cast(QObject) d_ptr;" << endl
+          << "    d_ref.__no_real_delete = true;" << endl
+          << "    delete d_ref;" << endl
+          << "}" << endl;
+    }
+
+    if (d_class->hasConstructors())
+        s << "extern (C) void qtd_" << d_class->name() << "_destructor(void *ptr);" << endl << endl;
+
+    // qtd
+    s << endl << "// C wrappers" << endl;
+    d_funcs = d_class->functionsInTargetLang();
+    if (!d_class->isInterface())
+        for (int i=0; i<d_funcs.size(); ++i) {
+            AbstractMetaFunction *function = d_funcs.at(i);
+
+            if (!notWrappedYet(function)) // qtd2
+                if (function->jumpTableId() == -1)
+                    writePrivateNativeFunction(s, function);
+        }
+
+
+    s << "// Just the private functions for abstract functions implemeneted in superclasses" << endl;
+    // Just the private functions for abstract functions implemeneted in superclasses
+    if (!d_class->isInterface() && d_class->isAbstract()) {
+        d_funcs = d_class->queryFunctions(AbstractMetaClass::NormalFunctions | AbstractMetaClass::AbstractFunctions | AbstractMetaClass::NotRemovedFromTargetLang);
+        foreach (AbstractMetaFunction *d_function, d_funcs) {
+            if (d_function->implementingClass() != d_class) {
+                s << endl;
+                writePrivateNativeFunction(s, d_function);
+            }
+        }
+    }
+
+
+    foreach (const AbstractMetaField *field, fields) {
+        if (field->wasPublic() || (field->wasProtected() && !d_class->isFinal()))
+            writeNativeField(s, field);
+    }
+    s << endl << endl;
+
+    // qtd
+    s << endl << "// Virtual Dispatch functions" << endl;
+    AbstractMetaFunctionList virtualFunctions = d_class->virtualFunctions();
+    for (int pos = 0; pos<virtualFunctions.size(); ++pos) {
+        const AbstractMetaFunction *function = virtualFunctions.at(pos);
+        if (!notWrappedYet(function)) // qtd2
+            writeShellVirtualFunction(s, function, d_class, pos);
+    }
+
+    //init callbacks from dll to D side
+    if (cpp_shared) {
+        bool shellClass = d_class->generateShellClass();
+        if (shellClass && !d_class->isInterface()) {
+            QString initArgs = "void* virtuals";
+            if (d_class->isQObject())
+                initArgs += ", void* signals, void* qobj_del";
+
+            s << "private extern (C) void qtd_" << d_class->name()
+              << QString("_initCallBacks(%1);").arg(initArgs) << endl << endl
+              << "private bool init_flag_" << d_class->name() << " = false;" << endl
+              << "void static_init_" << d_class->name() << "() {" << endl
+              << INDENT << "init_flag_" << d_class->name() << " = true;" << endl << endl
+
+              // virtual functions
+              << INDENT << "void*[" << virtualFunctions.size() << "] virt_arr;" << endl;
+            for (int pos = 0; pos<virtualFunctions.size(); ++pos) {
+                const AbstractMetaFunction *function = virtualFunctions.at(pos);
+                if (!notWrappedYet(function)) // qtd2
+                    s << INDENT << "virt_arr[" << pos << "] = &" << function->marshalledName() << "_dispatch;" <<endl;
+            }
+            if (virtualFunctions.size() == 0)
+                initArgs = "null";
+            else
+                initArgs = "virt_arr.ptr";
+
+            // signals
+            if (d_class->isQObject()) {
+                AbstractMetaFunctionList signal_funcs = signalFunctions(d_class);
+                s << endl << INDENT << "void*[" << signal_funcs.size() << "] sign_arr;" << endl;
+                for(int i = 0; i < signal_funcs.size(); i++) {
+                    AbstractMetaFunction *signal = signal_funcs.at(i);
+                    s << INDENT << "sign_arr[" << i << "] = &" << signalExternName(d_class, signal) << "_handle_in_d;" << endl;
+                }
+                if(signal_funcs.size() == 0)
+                    initArgs += ", null";
+                else
+                    initArgs += ", sign_arr.ptr";
+
+                // QObject_delete
+                s << endl << INDENT << "void *qobj_del;" << endl
+                  << INDENT << "qobj_del = &qtd_D_" << d_class->name() << "_delete;" << endl;
+                initArgs += ", qobj_del";
+            }
+
+            s << INDENT << "qtd_" << d_class->name() << QString("_initCallBacks(%1);").arg(initArgs) << endl
+              << "}" << endl << endl;
+        }
+    }
+
+    writeSignalHandlers(s, d_class);
+    s << endl;
+
+    if (m_docs_enabled) {
+        delete m_doc_parser;
+        m_doc_parser = 0;
+    }
+
+    // qtd multiple classes
+    foreach (AbstractMetaClass *cls, includedClassesList) {
+        m_isRecursive = true;
+        write(s, cls);
+        m_isRecursive = false;
+    }
+}
+
+/*
+void DGenerator::writeMarshallFunction(QTextStream &s, const AbstractMetaClass *d_class)
+{
+
+}
+*/
+void DGenerator::marshallFromCppToD(QTextStream &s, const ComplexTypeEntry* ctype)
+{
+    if(ctype->isQObject()) {
+        QString type_name = ctype->name();
+
+        if(ctype->isAbstract())
+            type_name = type_name + "_ConcreteWrapper";
+
+        s << INDENT << "if (__qt_return_value is null)" << endl
+                << INDENT << "    return null;" << endl
+                << INDENT << "void* d_obj = __QObject_entity(__qt_return_value);" << endl
+                << INDENT << "if (d_obj is null) {" << endl
+                << INDENT << "    auto new_obj = new " << type_name << "(__qt_return_value, true);" << endl
+                << INDENT << "    new_obj.__no_real_delete = true;" << endl
+                << INDENT << "    return new_obj;" << endl
+                << INDENT << "} else" << endl
+                << INDENT << "    return cast(" << ctype->name() << ") d_obj;" << endl;
+    } else if (ctype->isValue() && !ctype->isStructInD())
+        s << INDENT << "return new " << ctype->name() << "(__qt_return_value, false);" << endl;
+    else if (ctype->isVariant())
+        s << INDENT << "return new QVariant(__qt_return_value, false);" << endl;
+    else if (ctype->name() == "QModelIndex" || ctype->isStructInD())
+        s << INDENT << "return __qt_return_value;" << endl;
+    else if (ctype->isObject()) {
+        QString type_name = ctype->name();
+
+        if(ctype->isAbstract())
+            type_name = type_name + "_ConcreteWrapper";
+
+        QString return_type_name = ctype->name();
+        if(ctype->designatedInterface())
+            return_type_name = ctype->designatedInterface()->name();
+
+        AbstractMetaClass *d_class = NULL;
+        
+        d_class = ClassFromEntry::get(ctype);
+        
+        // if class has virtual functions then it has classname_entity function so
+        // we can look for D Object pointer. otherwise create new wrapper
+        if (d_class != NULL && d_class->hasVirtualFunctions()) {
+            s << INDENT << "void* d_obj = __" << ctype->name() << "_entity(__qt_return_value);" << endl
+              << INDENT << "if (d_obj !is null) {" << endl
+              << INDENT << "    auto d_obj_ref = cast (Object) d_obj;" << endl
+              << INDENT << "    return cast(" << return_type_name << ") d_obj_ref;" << endl
+              << INDENT << "} else {" << endl
+              << INDENT << "    auto return_value = new " << type_name << "(__qt_return_value, true);" << endl
+              << INDENT << "    return_value.__no_real_delete = true;" << endl
+              << INDENT << "    return return_value;" << endl
+              << INDENT << "}" << endl;
+        } else {
+            s << INDENT << "auto return_value = new " << type_name << "(__qt_return_value, true);" << endl
+              << INDENT << "return_value.__no_real_delete = true;" << endl
+              << INDENT << "return return_value;" << endl;
+        }
+    }
+
+}
+
+void DGenerator::writeNativeField(QTextStream &s, const AbstractMetaField *field)
+{
+    Q_ASSERT(field->isPublic() || field->isProtected());
+
+    const AbstractMetaClass *declaringClass = field->enclosingClass();
+
+    FieldModification mod = declaringClass->typeEntry()->fieldModification(field->name());
+
+    // Set function
+    if (mod.isWritable() && !field->type()->isConstant()) {
+        const AbstractMetaFunction *setter = field->setter();
+        if (declaringClass->hasFunction(setter)) {
+            QString warning =
+                QString("class '%1' already has setter '%2' for public field '%3'")
+                .arg(declaringClass->name()).arg(setter->name()).arg(field->name());
+            ReportHandler::warning(warning);
+        } else {
+            if (!notWrappedYet(setter))
+                writePrivateNativeFunction(s, setter);
+        }
+    }
+
+    // Get function
+    const AbstractMetaFunction *getter = field->getter();
+    if (mod.isReadable()) {
+        if (declaringClass->hasFunction(getter)) {
+            QString warning =
+                QString("class '%1' already has getter '%2' for public field '%3'")
+                .arg(declaringClass->name()).arg(getter->name()).arg(field->name());
+            ReportHandler::warning(warning);
+        } else {
+            if (!notWrappedYet(getter))
+                writePrivateNativeFunction(s, getter);
+        }
+    }
+}
+
+void DGenerator::writeSignalConnectors(QTextStream &s, const AbstractMetaClass *d_class, AbstractMetaFunctionList signal_funcs)
+{
+    s << INDENT << "private static SlotConnector[" << signal_funcs.size() << "] __slotConnectors;" << endl;
+    s << INDENT << "private static SlotConnector[" << signal_funcs.size() << "] __slotDisconnectors;" << endl << endl;
+
+    s << INDENT << "protected void onSignalHandlerCreated(ref SignalHandler sh) {" << endl;
+    {
+        Indentation indent(INDENT);
+        s << INDENT << "sh.firstSlotConnected = &onFirstSlot;" << endl;
+        s << INDENT << "sh.lastSlotDisconnected = &onLastSlot;" << endl << endl;
+
+        for(int i = 0; i < signal_funcs.size(); i++) {
+            AbstractMetaFunction *signal = signal_funcs.at(i);
+            QString sigExternName = signalExternName(d_class, signal);
+            s << INDENT << "__slotConnectors[" << i << "] = &" << sigExternName << "_connect;" << endl;
+            s << INDENT << "__slotDisconnectors[" << i << "] = &" << sigExternName << "_disconnect;" << endl;
+        }
+    }
+    s << INDENT << "}" << endl << endl;
+
+    s << INDENT << "private final void onFirstSlot(int signalId) {" << endl;
+    {
+        Indentation indent(INDENT);
+        s << INDENT << "if (signalId < __slotConnectors.length) {" << endl;
+        s << INDENT << "    __slotConnectors[signalId](nativeId);" << endl;
+        s << INDENT << "}" << endl;
+    }
+    s << INDENT << "}" << endl;
+
+    s << INDENT << "private final void onLastSlot(int signalId) {" << endl;
+    {
+        Indentation indent(INDENT);
+        s << INDENT << "if (signalId < __slotDisconnectors.length) {" << endl;
+        s << INDENT << "    __slotDisconnectors[signalId](nativeId);" << endl;
+        s << INDENT << "}" << endl;
+    }
+    s << INDENT << "}" << endl;
+}
+
+void DGenerator::writeSignal(QTextStream &s, const AbstractMetaFunction *d_function)
+{
+    Q_ASSERT(d_function->isSignal());
+
+    AbstractMetaArgumentList arguments = d_function->arguments();
+    int sz = arguments.count();
+
+    s << INDENT << "mixin Signal!(\"" << d_function->name() << "\"";
+
+    if (sz > 0) {
+        for (int i=0; i<sz; ++i) {
+                s << ", ";
+
+            QString modifiedType = d_function->typeReplaced(i+1);
+
+            if (modifiedType.isEmpty())
+                s << translateType(arguments.at(i)->type(), d_function->implementingClass(), BoxedPrimitive);
+            else
+                s << modifiedType;
+        }
+    }
+
+    s << ");" << endl;
+}
+
+void DGenerator::writeShellVirtualFunction(QTextStream &s, const AbstractMetaFunction *d_function,
+                                          const AbstractMetaClass *implementor, int id)
+{
+    Q_UNUSED(id);
+    Q_UNUSED(implementor);
+
+    s << "private extern(C) ";
+    CppImplGenerator::writeVirtualDispatchFunction(s, d_function, true);
+    s << "{" << endl;
+
+    const AbstractMetaClass *own_class = d_function->ownerClass();
+
+    s << INDENT << "auto d_object = cast(" << own_class->name() << ") d_entity;" << endl;
+
+    // the function arguments
+    AbstractMetaArgumentList arguments = d_function->arguments();
+    foreach (const AbstractMetaArgument *argument, arguments)
+        if (!d_function->argumentRemoved(argument->argumentIndex() + 1)) {
+            QString arg_name = argument->indexedName();
+            AbstractMetaType *type = argument->type();
+            // if has QString argument we have to pass char* and str.length to QString constructor
+            {
+                if(type->isEnum())
+                    s << INDENT << "auto " << arg_name << "_enum = cast("
+                                << type->typeEntry()->qualifiedTargetLangName() << ") " << arg_name << ";";
+                else if (type->isTargetLangString())
+                    s << INDENT << "string " << arg_name << "_d_ref = toString("
+                                << arg_name << "[0.." << arg_name << "_size]);";
+                else if (type->typeEntry()->isValue() && type->isNativePointer() && type->typeEntry()->name() == "QString") {
+                    s << INDENT << "scope " << arg_name << "_d_qstr = new QString(" << arg_name << ", true);" << endl
+                      << INDENT << "string " << arg_name << "_d_ref = " << arg_name << "_d_qstr.toNativeString();";
+                } else if(type->isVariant())
+                    s << INDENT << "scope " << arg_name << "_d_ref = new QVariant(" << arg_name << ", true);";
+                else if (type->typeEntry()->isStructInD())
+                    continue;
+                else if (!type->hasNativeId() && !(type->typeEntry()->isValue() && type->isNativePointer()))
+                    continue;
+                else if(type->isObject()
+                    || (type->typeEntry()->isValue() && type->isNativePointer())
+                    || type->isValue() || type->isVariant()) {
+                    QString type_name = type->typeEntry()->name();
+                    const ComplexTypeEntry *ctype = static_cast<const ComplexTypeEntry *>(type->typeEntry());
+                    if(ctype->isAbstract())
+                        type_name = type_name + "_ConcreteWrapper";
+                    s << INDENT << "scope " << arg_name << "_d_ref = new " << type_name << "(" << arg_name << ", true);";
+                }
+                else if (type->isQObject()) {
+                    QString type_name = type->name();
+                    const ComplexTypeEntry *ctype = static_cast<const ComplexTypeEntry *>(type->typeEntry());
+                    if(ctype->isAbstract())
+                        type_name = type_name + "_ConcreteWrapper";
+
+                    s << INDENT << "scope " << arg_name << "_d_ref = new " << type_name << "(" << arg_name <<", true);" << endl
+                      << INDENT << arg_name << "_d_ref.__no_real_delete = true;";
+                }
+                s << endl;
+            }
+    }
+
+    s << INDENT;
+    AbstractMetaType *return_type = d_function->type();
+    QString new_return_type = QString(d_function->typeReplaced(0)).replace('$', '.');
+    bool has_return_type = new_return_type != "void"
+        && (!new_return_type.isEmpty() || return_type != 0);
+    if(has_return_type) {
+        AbstractMetaType *f_type = d_function->type();
+        if(f_type && (f_type->isObject() || f_type->isQObject() || f_type->isVariant() ||
+                      (f_type->isValue() && !f_type->typeEntry()->isStructInD())))
+        {
+            QString f_type_name = f_type->name();
+            if(f_type->typeEntry()->designatedInterface())
+                f_type_name = f_type->typeEntry()->designatedInterface()->name();
+            s << f_type_name << " ret_value = ";
+        }
+        else if (f_type && f_type->isTargetLangString())
+            s << "string _d_str = ";
+        else if (f_type && f_type->name() == "QModelIndex")
+            s << "*__d_return_value = ";
+        else
+            s << "auto return_value = ";
+    }
+    s << "d_object." << d_function->name() << "(";
+
+    uint nativeArgCount = 0;
+    foreach (const AbstractMetaArgument *argument, arguments)
+        if (!d_function->argumentRemoved(argument->argumentIndex() + 1)) {
+            QString arg_name = argument->indexedName();
+            const AbstractMetaType *type = argument->type();
+
+            if (nativeArgCount > 0)
+                s << "," << " ";
+
+            QString modified_type = d_function->typeReplaced(argument->argumentIndex() + 1);
+            if (!modified_type.isEmpty())
+                modified_type = modified_type.replace('$', '.');
+
+            if (modified_type == "string" /* && type->fullName() == "char" */)
+                s << "fromStringz(" << arg_name << ")";
+            else {
+                if(type->isContainer()
+                   || (type->isReference() && type->typeEntry()->isStructInD()))
+                    s << "*";
+                s << arg_name;
+            }
+            if (type->typeEntry()->isStructInD()) ;
+            else if (type->isQObject() || type->isObject()
+                || (type->typeEntry()->isValue() && type->isNativePointer())
+                || type->isValue()
+                || type->isTargetLangString() || type->isVariant())
+                s << "_d_ref";
+            else if(type->isEnum())
+                s << "_enum";
+
+            nativeArgCount++;
+        }
+    s << ");" << endl;
+
+    // check for arguments that may return value
+    foreach (const AbstractMetaArgument *argument, arguments)
+        if (!d_function->argumentRemoved(argument->argumentIndex() + 1)) {
+            QString arg_name = argument->indexedName();
+            AbstractMetaType *type = argument->type();
+
+            if (type->typeEntry()->isValue() && type->isNativePointer() && type->typeEntry()->name() == "QString")
+                s << INDENT << arg_name << "_d_qstr.assign(" << arg_name << "_d_ref);" << endl;
+        }
+
+    if(has_return_type) {
+        AbstractMetaType *f_type = d_function->type();
+        if(f_type) {
+            if(f_type->isObject() || f_type->isQObject() || f_type->isVariant() ||
+               (f_type->isValue() && !f_type->typeEntry()->isStructInD())) {
+                QString native_id = "nativeId";
+                if (f_type->typeEntry()->designatedInterface())
+                    native_id =  "__ptr_" + f_type->typeEntry()->designatedInterface()->name();
+                s << INDENT << "return ret_value is null? null : ret_value." << native_id << ";" << endl;
+            } else if (f_type->isTargetLangString())
+                s << INDENT << "ret_str = _d_str.ptr;" << endl
+                  << INDENT << "ret_str_size = _d_str.length;" << endl;
+            else if (f_type->isContainer())
+                s << INDENT << "*__d_arr_ptr = return_value.ptr;" << endl
+                  << INDENT << "*__d_arr_size = return_value.length;" << endl;
+//                  << INDENT << "addReference(return_value.ptr);" << endl;
+            else if (f_type->name() == "QModelIndex")
+                ;
+            else
+                s << INDENT << "return return_value;" << endl;
+        } else
+            s << INDENT << "return return_value;" << endl;
+
+    }
+
+    s << "}" << endl << endl;
+}
+
+void DGenerator::generate()
+{
+    // qtd
+    // code for including classses in 1 module for avoiding circular imports
+    foreach (AbstractMetaClass *cls, m_classes) {
+        const ComplexTypeEntry *ctype = cls->typeEntry();
+
+        if (!cls->isInterface() && cls->isAbstract()) {
+            ComplexTypeEntry *ctype_m = (ComplexTypeEntry *)ctype;
+
+            ctype_m->setAbstract(true);
+        }
+
+        foreach(QString child, ctype->includedClasses) {
+            ComplexTypeEntry *ctype_child = TypeDatabase::instance()->findComplexType(child);
+            ctype_child->addedTo = cls->name();
+        }
+
+        foreach (AbstractMetaFunction *function, cls->functions())
+            function->checkStoreResult();
+    }
+
+
+    Generator::generate();
+
+    {
+        const AbstractMetaClass *last_class = 0;
+        QFile file("mjb_nativepointer_api.log");
+        if (file.open(QFile::WriteOnly)) {
+            QTextStream s(&file);
+
+            AbstractMetaFunctionList nativepointer_functions;
+            for (int i=0; i<m_nativepointer_functions.size(); ++i) {
+                AbstractMetaFunction *f = const_cast<AbstractMetaFunction *>(m_nativepointer_functions[i]);
+                if (f->ownerClass() == f->declaringClass() || f->isFinal())
+                    nativepointer_functions.append(f);
+            }
+
+            s << "Number of public or protected functions with QNativePointer API: " << nativepointer_functions.size() << endl;
+            foreach (const AbstractMetaFunction *f, nativepointer_functions) {
+                if (last_class != f->ownerClass()) {
+                    last_class = f->ownerClass();
+                    s << endl << endl<< "Class " << last_class->name() << ":" << endl;
+                    s << "---------------------------------------------------------------------------------"
+                    << endl;
+                }
+
+                s << f->minimalSignature() << endl;
+            }
+
+            m_nativepointer_functions.clear();        }
+    }
+
+    {
+        const AbstractMetaClass *last_class = 0;
+        QFile file("mjb_object_type_usage.log");
+        if (file.open(QFile::WriteOnly)) {
+            QTextStream s(&file);
+
+            AbstractMetaFunctionList resettable_object_functions;
+            for (int i=0; i<m_resettable_object_functions.size(); ++i) {
+                AbstractMetaFunction *f = const_cast<AbstractMetaFunction *>(m_resettable_object_functions[i]);
+                if (f->ownerClass() == f->declaringClass() || f->isFinal())
+                    resettable_object_functions.append(f);
+            }
+
+            s << "Number of public or protected functions that return a non-QObject object type, or that are virtual and take a non-QObject object type argument: " << resettable_object_functions.size() << endl;
+            foreach (const AbstractMetaFunction *f, resettable_object_functions) {
+                if (last_class != f->ownerClass()) {
+                    last_class = f->ownerClass();
+                    s << endl << endl<< "Class " << last_class->name() << ":" << endl;
+                    s << "---------------------------------------------------------------------------------"
+                    << endl;
+                }
+
+                s << f->minimalSignature() << endl;
+            }
+
+            m_resettable_object_functions.clear();        }
+    }
+
+    {
+        QFile file("mjb_reference_count_candidates.log");
+        if (file.open(QFile::WriteOnly)) {
+            QTextStream s(&file);
+
+            s << "The following functions have a signature pattern which may imply that" << endl
+              << "they need to apply reference counting to their arguments ("
+              << m_reference_count_candidate_functions.size() << " functions) : " << endl;
+
+              foreach (const AbstractMetaFunction *f, m_reference_count_candidate_functions) {
+                  s << f->implementingClass()->fullName() << " : " << f->minimalSignature() << endl;
+              }
+        }
+        file.close();
+    }
+}
+
+void DGenerator::writeFunctionAttributes(QTextStream &s, const AbstractMetaFunction *d_function,
+                                            uint included_attributes, uint excluded_attributes,
+                                            uint options)
+{
+    uint attr = d_function->attributes() & (~excluded_attributes) | included_attributes;
+
+    if ((attr & AbstractMetaAttributes::Public) || (attr & AbstractMetaAttributes::Protected)) {
+
+        // Does the function use native pointer API?
+        bool nativePointer = d_function->type() && d_function->type()->isNativePointer()
+                             && d_function->typeReplaced(0).isEmpty();
+
+        // Does the function need to be considered for resetting the Java objects after use?
+        bool resettableObject = false;
+
+        if (!nativePointer
+            && d_function->type()
+            && d_function->type()->hasInstantiations()
+            && d_function->typeReplaced(0).isEmpty()) {
+
+            QList<AbstractMetaType *> instantiations = d_function->type()->instantiations();
+
+            foreach (const AbstractMetaType *type, instantiations) {
+                if (type && type->isNativePointer()) {
+                    nativePointer = true;
+                    break;
+                }
+            }
+
+        }
+
+        AbstractMetaArgumentList arguments = d_function->arguments();
+        if (!nativePointer || (!resettableObject && !d_function->isFinal())) {
+            foreach (const AbstractMetaArgument *argument, arguments) {
+                if (!d_function->argumentRemoved(argument->argumentIndex()+1)
+                    && d_function->typeReplaced(argument->argumentIndex()+1).isEmpty()) {
+
+                    if (argument->type()->isNativePointer()) {
+
+                        nativePointer = true;
+                        if (resettableObject) break ;
+
+                    } else if (!d_function->isFinalInTargetLang()
+                                && argument->type()->isObject()
+                                && !argument->type()->isQObject()
+                                && !d_function->resetObjectAfterUse(argument->argumentIndex()+1)
+                                && d_function->ownership(d_function->declaringClass(), TypeSystem::ShellCode, argument->argumentIndex()+1) == TypeSystem::InvalidOwnership) {
+
+                        resettableObject = true;
+                        if (nativePointer) break ;
+
+                    } else if (argument->type()->hasInstantiations()) {
+
+                        QList<AbstractMetaType *> instantiations = argument->type()->instantiations();
+                        foreach (AbstractMetaType *type, instantiations) {
+                            if (type && type->isNativePointer()) {
+                                nativePointer = true;
+                                if (resettableObject) break;
+                            } else if (!d_function->isFinal()
+                                       && type
+                                       && type->isObject()
+                                       && !type->isQObject()
+                                       && !d_function->resetObjectAfterUse(argument->argumentIndex()+1)) {
+                                resettableObject = true;
+                                if (nativePointer) break ;
+                            }
+                        }
+
+                        if (nativePointer && resettableObject)
+                            break;
+
+                    }
+                }
+            }
+        }
+
+        if (nativePointer && !m_nativepointer_functions.contains(d_function))
+            m_nativepointer_functions.append(d_function);
+        if (resettableObject && !m_resettable_object_functions.contains(d_function))
+            m_resettable_object_functions.append(d_function);
+    }
+
+    if ((options & SkipAttributes) == 0) {
+        if (d_function->isEmptyFunction()
+            || d_function->isDeprecated()) s << INDENT << "deprecated ";
+/*
+        bool needsSuppressUnusedWarning = TypeDatabase::instance()->includeEclipseWarnings()
+                                          && d_function->isSignal()
+                                          && (((excluded_attributes & AbstractMetaAttributes::Private) == 0)
+                                               && (d_function->isPrivate()
+                                                   || ((included_attributes & AbstractMetaAttributes::Private) != 0)));
+
+        if (needsSuppressUnusedWarning && d_function->needsSuppressUncheckedWarning()) {
+            s << INDENT<< "@SuppressWarnings({\"unchecked\", \"unused\"})" << endl;
+        } else if (d_function->needsSuppressUncheckedWarning()) {
+            s << INDENT<< "@SuppressWarnings(\"unchecked\")" << endl;
+        } else if (needsSuppressUnusedWarning) {
+            s << INDENT<< "@SuppressWarnings(\"unused\")" << endl;
+        }
+
+        if (!(attr & NoBlockedSlot)
+            && !d_function->isConstructor()
+            && !d_function->isSlot()
+            && !d_function->isSignal()
+            && !d_function->isStatic()
+            && !(included_attributes & AbstractMetaAttributes::Static))
+            s << INDENT << "@QtBlockedSlot" << endl;
+*/
+        if (!(options & ExternC))
+            s << INDENT;
+
+        if (attr & AbstractMetaAttributes::Public) s << "public ";
+        else if (attr & AbstractMetaAttributes::Protected) s << "protected ";
+        else if (attr & AbstractMetaAttributes::Private) s << "private ";
+        else if (attr & AbstractMetaAttributes::Native) s << "private extern(C) ";
+        bool isStatic = (attr & AbstractMetaAttributes::Static);
+
+        if (attr & AbstractMetaAttributes::Native) ;
+        else if (!isStatic && (attr & AbstractMetaAttributes::FinalInTargetLang)) s << "final ";
+        else if (!isStatic && (attr & AbstractMetaAttributes::Abstract)) s << "abstract ";
+
+        if (isStatic && !(options & ExternC)) s << "static ";
+    }
+
+    if ((options & SkipReturnType) == 0) {
+        QString modified_type = d_function->typeReplaced(0);
+        if (options & ExternC) {
+            uint options = 0x0004; // qtd externC
+            s << CppImplGenerator::jniReturnName(d_function, options, true) << " ";
+        }
+        else if (modified_type.isEmpty())
+            s << translateType(d_function->type(), d_function->implementingClass(), (Option) options);
+        else
+            s << modified_type.replace('$', '.');
+        s << " ";
+    }
+
+}
+
+void DGenerator::writeConstructorContents(QTextStream &s, const AbstractMetaFunction *d_function)
+{
+    // Write constructor
+    s << " {" << endl;
+    {
+        Indentation indent(INDENT);
+        bool shellClass = d_function->ownerClass()->generateShellClass();
+        if (cpp_shared) {
+            if (shellClass && !d_function->ownerClass()->isInterface())
+                s << INDENT << "if (!init_flag_" << d_function->ownerClass()->name() << ")" << endl
+                  << INDENT << "    static_init_" << d_function->ownerClass()->name() << "();" << endl << endl;
+        }
+        writeJavaCallThroughContents(s, d_function);
+
+        // Write out expense checks if present...
+        const AbstractMetaClass *d_class = d_function->implementingClass();
+        const ComplexTypeEntry *te = d_class->typeEntry();
+        if (te->expensePolicy().isValid()) {
+            s << endl;
+            const ExpensePolicy &ep = te->expensePolicy();
+            s << INDENT << "qt.GeneratorUtilities.countExpense(" << d_class->fullName()
+              << ".class, " << ep.cost << ", " << ep.limit << ");" << endl;
+        }
+
+        foreach (CodeSnip snip, te->codeSnips()) {
+            if (snip.language == TypeSystem::Constructors) {
+                snip.formattedCode(s, INDENT);
+            }
+        }
+
+        if(d_function->implementingClass()->isQObject())
+        {
+            bool hasParentArg = false;
+            AbstractMetaArgumentList arguments = d_function->arguments();
+            for (int i=0; i<arguments.count(); ++i) {
+                const AbstractMetaArgument *arg = arguments.at(i);
+                if (arg->argumentName() == "parent_")
+                    hasParentArg = true;
+            }
+
+//            QString ctor_call = d_function->implementingClass()->name() == "QObject"? "this" : "super";
+            QString ctor_call = "this";
+            if (hasParentArg) {
+                s << INDENT << "bool gc_managed = parent_ is null ? true : false;" << endl
+                  << INDENT << ctor_call << "(__qt_return_value, gc_managed);" << endl;
+            } else {
+                s << INDENT << ctor_call << "(__qt_return_value, true);" << endl;
+            }
+        }
+        else
+            s << INDENT << "super(__qt_return_value);" << endl;
+    }
+    s << INDENT << "}" << endl << endl;
+
+/* qtd    // Write native constructor
+    if (d_function->jumpTableId() == -1)
+        writePrivateNativeFunction(s, d_function);
+*/
+}
+
+void DGenerator::writeFunctionArguments(QTextStream &s, const AbstractMetaFunction *d_function,
+                                           int argument_count, uint options)
+{
+    AbstractMetaArgumentList arguments = d_function->arguments();
+
+    if (argument_count == -1)
+        argument_count = arguments.size();
+
+    for (int i=0; i<argument_count; ++i) {
+        if (!d_function->argumentRemoved(i+1)) {
+            if (i != 0)
+                s << ", ";
+            writeArgument(s, d_function, arguments.at(i), options);
+        }
+    }
+}
+
+
+void DGenerator::writeExtraFunctions(QTextStream &s, const AbstractMetaClass *d_class)
+{
+    const ComplexTypeEntry *class_type = d_class->typeEntry();
+    Q_ASSERT(class_type);
+
+    CodeSnipList code_snips = class_type->codeSnips();
+    foreach (const CodeSnip &snip, code_snips) {
+        if ((!d_class->isInterface() && snip.language == TypeSystem::TargetLangCode)
+            || (d_class->isInterface() && snip.language == TypeSystem::Interface)) {
+            s << endl;
+            snip.formattedCode(s, INDENT);
+        }
+    }
+}
+
+
+void DGenerator::writeToStringFunction(QTextStream &s, const AbstractMetaClass *d_class)
+{
+    bool generate = d_class->hasToStringCapability() && !d_class->hasDefaultToStringFunction();
+    bool core = d_class->package() == QLatin1String("qt.core");
+    bool qevent = false;
+
+    const AbstractMetaClass *cls = d_class;
+    while (cls) {
+        if (cls->name() == "QEvent") {
+            qevent = true;
+            break;
+        }
+        cls = cls->baseClass();
+    }
+
+    if (generate || qevent) {
+
+        if (qevent && core) {
+            s << endl
+              << "    @Override" << endl
+              << "    public String toString() {" << endl
+              << "        return getClass().getSimpleName() + \"(type=\" + type().name() + \")\";" << endl
+              << "    }" << endl;
+        } else {
+            s << endl
+              << "    @Override" << endl
+              << "    public String toString() {" << endl
+              << "        if (nativeId() == 0)" << endl
+              << "            throw new QNoNativeResourcesException(\"Function call on incomplete object of type: \" +getClass().getName());" << endl
+              << "        return __qt_toString(nativeId());" << endl
+              << "    }" << endl
+              << "    native String __qt_toString(long __this_nativeId);" << endl;
+        }
+    }
+}
+
+void DGenerator::writeCloneFunction(QTextStream &s, const AbstractMetaClass *d_class)
+{
+    s << endl
+      << "    @Override" << endl
+      << "    public " << d_class->name() << " clone() {" << endl
+      << "        if (nativeId() == 0)" << endl
+      << "            throw new QNoNativeResourcesException(\"Function call on incomplete object of type: \" +getClass().getName());" << endl
+      << "        return __qt_clone(nativeId());" << endl
+      << "    }" << endl
+      << "    native " << d_class->name() << " __qt_clone(long __this_nativeId);" << endl;
+}
+
+ClassFromEntry* ClassFromEntry::m_instance = NULL;
+
+ClassFromEntry::ClassFromEntry()
+{
+    foreach (AbstractMetaClass *cls, m_classes) {
+        const ComplexTypeEntry *ctype = cls->typeEntry();
+        classFromEntry[ctype] = cls;
+    }
+}
+
+AbstractMetaClass* ClassFromEntry::get(const TypeEntry *ctype)
+{
+    if(!m_instance)
+        m_instance = new ClassFromEntry;
+
+    return m_instance->classFromEntry[ctype];
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/dgenerator.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,191 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+*
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#ifndef DGENERATOR_H
+#define DGENERATOR_H
+
+#include "generator.h"
+#include "metajava.h"
+
+#include <QTextStream>
+
+class DocParser;
+
+class DGenerator : public Generator
+{
+    Q_OBJECT
+
+public:
+    DGenerator();
+
+    static QString translateType(const AbstractMetaType *d_type, const AbstractMetaClass *context, Option option = NoOption);
+
+    void writeInjectedCode(QTextStream &s,
+                           const AbstractMetaFunction *d_function,
+                           CodeSnip::Position position);
+    static void writeArgument(QTextStream &s,
+                       const AbstractMetaFunction *d_function,
+                       const AbstractMetaArgument *d_argument,
+                       uint options = 0);
+    static QString argumentString(const AbstractMetaFunction *d_function,
+                                  const AbstractMetaArgument *d_argument,
+                                  uint options = 0);
+    void writeEnum(QTextStream &s, const AbstractMetaEnum *d_enum);
+    void writeIntegerEnum(QTextStream &s, const AbstractMetaEnum *d_enum);
+    void writeSignal(QTextStream &s, const AbstractMetaFunction *d_function);
+    void writeFunction(QTextStream &s, const AbstractMetaFunction *d_function,
+                       uint included_attributes = 0, uint excluded_attributes = 0);
+    void writeFieldAccessors(QTextStream &s, const AbstractMetaField *field);
+    void writeNativeField(QTextStream &s, const AbstractMetaField *field);
+
+    void write(QTextStream &s, const AbstractMetaClass *d_class);
+
+    void writeFunctionOverloads(QTextStream &s, const AbstractMetaFunction *d_function,
+                                uint included_attributes, uint excluded_attributes);
+    void writeEnumOverload(QTextStream &s, const AbstractMetaFunction *d_function,
+                           uint include_attributes, uint exclude_attributes);
+    void writeExtraFunctions(QTextStream &s, const AbstractMetaClass *d_class);
+    void writeToStringFunction(QTextStream &s, const AbstractMetaClass *d_class);
+    void writeCloneFunction(QTextStream &s, const AbstractMetaClass *d_class);
+    void writeFunctionAttributes(QTextStream &s, const AbstractMetaFunction *d_function,
+                                 uint included_attributes = 0, uint excluded_attributes = 0,
+                                 uint options = 0);
+    void writeConstructorContents(QTextStream &s, const AbstractMetaFunction *d_function);
+    void writeFunctionArguments(QTextStream &s, const AbstractMetaFunction *d_function,
+        int count = -1, uint options = 0);
+    void writeJavaCallThroughContents(QTextStream &s, const AbstractMetaFunction *d_function, uint attributes = 0);
+    void writeOwnershipForContainer(QTextStream &s, TypeSystem::Ownership ownership, AbstractMetaArgument *arg);
+    void writeOwnershipForContainer(QTextStream &s, TypeSystem::Ownership ownership, AbstractMetaType *type,
+                                    const QString &arg_name);
+    void writePrivateNativeFunction(QTextStream &s, const AbstractMetaFunction *d_function);
+    void writeJavaLangObjectOverrideFunctions(QTextStream &s, const AbstractMetaClass *cls);
+    void writeReferenceCount(QTextStream &s, const ReferenceCount &refCount, const QString &argumentName);
+    void retrieveModifications(const AbstractMetaFunction *f, const AbstractMetaClass *d_class,
+         uint *exclude_attributes, uint *include_attributes) const;
+    QString functionSignature(const AbstractMetaFunction *d_function,
+                              uint included_attributes,
+                              uint excluded_attributes,
+                              Option option = NoOption,
+                              int arg_count = -1);
+    void setupForFunction(const AbstractMetaFunction *d_function,
+       uint *included_attributes, uint *excluded_attributes) const;
+
+    virtual QString subDirectoryForClass(const AbstractMetaClass *d_class) const
+    { return subDirectoryForPackage(d_class->package()); }
+
+    virtual QString fileNameForClass(const AbstractMetaClass *d_class) const;
+
+    bool isComparable(const AbstractMetaClass *cls) const;
+
+#if 0
+    void write1_dot_5_enum(QTextStream &s, const AbstractMetaEnum *d_enum);
+#endif
+
+    bool shouldGenerate(const AbstractMetaClass *d_class) const {
+        return !d_class->typeEntry()->isContainer() && !d_class->typeEntry()->isVariant()
+               && (d_class->typeEntry()->codeGeneration() & TypeEntry::GenerateTargetLang);
+    }
+
+    QString documentationDirectory() const { return m_doc_directory; }
+    void setDocumentationDirectory(const QString &docDir) { m_doc_directory = docDir; }
+
+    bool documentationEnabled() const { return m_docs_enabled; }
+    void setDocumentationEnabled(bool e) { m_docs_enabled = e; }
+    void generate();
+
+    inline bool nativeJumpTable() const { return m_native_jump_table; }
+    inline void setNativeJumpTable(bool n) { m_native_jump_table = n; }
+
+    void writeShellVirtualFunction(QTextStream &s, const AbstractMetaFunction *function,
+                                          const AbstractMetaClass *implementor, int id);
+    void marshallFromCppToD(QTextStream &s, const ComplexTypeEntry* ctype);
+
+private:
+    QString subDirectoryForPackage(const QString &package) const { return QString(package).replace(".", "/"); }
+    void writeInstantiatedType(QTextStream &s, const AbstractMetaType *abstractMetaType) const;
+
+    // qtd
+    void addTypeEntry(const AbstractMetaClass *d_class, const AbstractMetaFunction *function, QSet<const TypeEntry*> &typeEntries);
+    void fillRequiredImports(const AbstractMetaClass *d_class);
+    void addInstantiations(const AbstractMetaType* d_type);
+    void writeRequiredImports(QTextStream &s, const AbstractMetaClass *d_class);
+    const TypeEntry* fixedTypeEntry(const TypeEntry *type);
+
+    void writeDestructor(QTextStream &s, const AbstractMetaClass *d_class);
+    void writeOwnershipMethods(QTextStream &s, const AbstractMetaClass *d_class);
+    void writeSignalHandlers(QTextStream &s, const AbstractMetaClass *d_class);
+    void writeEnumAlias(QTextStream &s, const AbstractMetaEnum *d_enum);
+    void writeSignalConnectors(QTextStream &s, const AbstractMetaClass *d_class, AbstractMetaFunctionList signal_funcs);
+//    void writeMarshallFunction(QTextStream &s, const AbstractMetaClass *d_class);
+
+    int m_recursive;
+    bool m_isRecursive;
+    QSet<const TypeEntry*> typeEntries; // imports
+    QSet<const TypeEntry*> typeEntriesEnums; // imports for enums
+    QSet<QString> excludedTypes2;
+
+protected:
+    void writeImportString(QTextStream &s, const TypeEntry* typeEntry);
+
+    QSet<QString> excludedTypes;
+    QString m_package_name;
+    QString m_doc_directory;
+    DocParser *m_doc_parser;
+    bool m_docs_enabled;
+    bool m_native_jump_table;
+    QList<const AbstractMetaFunction *> m_nativepointer_functions;
+    QList<const AbstractMetaFunction *> m_resettable_object_functions;
+    QList<const AbstractMetaFunction *> m_reference_count_candidate_functions;
+};
+
+class ClassFromEntry : Generator
+{
+    Q_OBJECT
+
+private:
+    ClassFromEntry();
+    QHash<const TypeEntry *, AbstractMetaClass *> classFromEntry;
+    static ClassFromEntry* m_instance;
+
+public:
+    static AbstractMetaClass* get(const TypeEntry *te);
+};
+#endif // DGENERATOR_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/docparser.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,200 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#include "docparser.h"
+
+#include "metajava.h"
+#include "reporthandler.h"
+
+#include <QtCore/QFileInfo>
+#include <QtCore/QFile>
+
+#include <QtXml>
+
+DocParser::DocParser(const QString &name)
+    : m_doc_file(name),
+      m_dom(0)
+{
+    build();
+}
+
+DocParser::~DocParser()
+{
+    delete m_dom;
+}
+
+QString DocParser::documentation(const AbstractMetaClass *meta_class) const
+{
+    if (!m_dom)
+        return QString();
+
+    QDomElement root_node = m_dom->documentElement();
+
+    QString class_name = root_node.attribute("name");
+    QString doc = root_node.attribute("doc");
+
+    if (class_name != meta_class->name()) {
+        ReportHandler::warning("Documentelement file contains unexpected class: " + class_name + ", file=" + m_doc_file);
+    }
+
+    return doc;
+}
+
+QString DocParser::documentationForFunction(const QString &signature, const QString &tag) const
+{
+    if (!m_dom)
+        return QString();
+
+    QDomElement root_node = m_dom->documentElement();
+    QDomNodeList functions = root_node.elementsByTagName(tag);
+
+    for (int i=0; i<functions.size(); ++i) {
+        QDomNode node = functions.item(i);
+
+        QDomElement *e = (QDomElement *) &node;
+
+        Q_ASSERT(e->isElement());
+
+        if (e->attribute("name") == signature)
+            return e->attribute("doc");
+    }
+
+    return QString();
+}
+
+
+QString DocParser::documentationForSignal(const QString &signature) const
+{
+    return documentationForFunction(signature, "signal");
+}
+
+QString DocParser::documentationForFunction(const QString &signature) const
+{
+    return documentationForFunction(signature, "method");
+}
+
+QString DocParser::documentation(const AbstractMetaEnum *java_enum) const
+{
+    if (!m_dom)
+        return QString();
+
+    QDomElement root_node = m_dom->documentElement();
+
+    QDomNodeList enums = root_node.elementsByTagName("enum");
+
+    for (int i=0; i<enums.size(); ++i) {
+        QDomNode node = enums.item(i);
+        QDomElement *e = (QDomElement *) &node;
+
+        Q_ASSERT(e->isElement());
+
+        if (e->attribute("name") == java_enum->name()) {
+            return e->attribute("doc");
+        }
+    }
+
+    return QString();
+}
+
+
+QString DocParser::documentation(const AbstractMetaEnumValue *java_enum_value) const
+{
+    if (!m_dom)
+        return QString();
+
+    QDomElement root_node = m_dom->documentElement();
+
+    QDomNodeList enums = root_node.elementsByTagName("enum");
+
+    for (int i=0; i<enums.size(); ++i) {
+        QDomNode node = enums.item(i);
+        QDomElement *e = (QDomElement *) &node;
+        Q_ASSERT(e->isElement());
+
+        QDomNodeList enumValues = e->elementsByTagName("enum-value");
+        for (int j=0; j<enumValues.size(); ++j) {
+            QDomNode node = enumValues.item(j);
+            QDomElement *ev = (QDomElement *) &node;
+            if (ev->attribute("name") == java_enum_value->name()) {
+                return ev->attribute("doc");
+            }
+        }
+    }
+
+    return QString();
+}
+
+
+
+void DocParser::build()
+{
+    if (!QFileInfo(m_doc_file).exists()) {
+        ReportHandler::warning("Missing documentation file: " + m_doc_file);
+        return;
+    }
+
+    QFile f(m_doc_file);
+    if (!f.open(QFile::ReadOnly | QFile::Text)) {
+        ReportHandler::warning("Failed to open documentation file: " + m_doc_file);
+        return;
+    }
+
+    m_dom = new QDomDocument();
+
+    QString error;
+    int line, column;
+
+    if (!m_dom->setContent(&f, &error, &line, &column)) {
+         ReportHandler::warning(QString("Failed to parse the documentation file:"
+                                        " '%1' %2 line=%3 column=%4")
+                                .arg(m_doc_file)
+                                .arg(error)
+                                .arg(line)
+                                .arg(column));
+
+        delete m_dom;
+        m_dom = 0;
+
+        return;
+    }
+
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/docparser.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#ifndef DOCPARSER_H
+#define DOCPARSER_H
+
+#include <QtCore/QString>
+
+
+class AbstractMetaClass;
+class AbstractMetaFunction;
+class AbstractMetaEnum;
+class AbstractMetaEnumValue;
+class QDomDocument;
+
+class DocParser
+{
+public:
+    DocParser(const QString &docFile);
+    ~DocParser();
+
+    QString documentation(const AbstractMetaClass *meta_class) const;
+    QString documentation(const AbstractMetaEnum *meta_enum) const;
+    QString documentation(const AbstractMetaEnumValue *meta_enum) const;
+    QString documentationForFunction(const QString &signature) const;
+    QString documentationForSignal(const QString &signature) const;
+
+private:
+    QString documentationForFunction(const QString &signature, const QString &tag) const;
+    void build();
+
+    QString m_doc_file;
+    QDomDocument *m_dom;
+};
+
+#endif // DOCPARSER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/fileout.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,237 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#include "fileout.h"
+#include "reporthandler.h"
+
+#include <QFileInfo>
+#include <QDir>
+
+bool FileOut::dummy = false;
+bool FileOut::diff = false;
+
+#ifdef Q_OS_LINUX
+const char* colorDelete = "\033[31m";
+const char* colorAdd = "\033[32m";
+const char* colorInfo = "\033[36m";
+const char* colorReset = "\033[0m";
+#else
+const char* colorDelete = "";
+const char* colorAdd = "";
+const char* colorInfo = "";
+const char* colorReset = "";
+#endif
+
+FileOut::FileOut(QString n):
+    m_name(n),
+    stream(&tmp),
+    isDone(false)
+{}
+
+static int* lcsLength(QList<QByteArray> a, QList<QByteArray> b) {
+    const int height = a.size() + 1;
+    const int width = b.size() + 1;
+
+    int *res = new int[width * height];
+
+    for (int row=0; row<height; row++) {
+        res[width * row] = 0;
+    }
+    for (int col=0; col<width; col++) {
+        res[col] = 0;
+    }
+
+    for (int row=1; row<height; row++) {
+        for (int col=1; col<width; col++) {
+
+            if (a[row-1] == b[col-1])
+                res[width * row + col] = res[width * (row-1) + col-1] + 1;
+            else
+                res[width * row + col] = qMax(res[width * row     + col-1],
+                                              res[width * (row-1) + col]);
+        }
+    }
+    return res;
+}
+
+enum Type {Add, Delete, Unchanged};
+
+struct Unit
+{
+    Unit(Type type, int pos) :
+        type(type),
+        start(pos),
+        end(pos)
+    {}
+
+    Type type;
+    int start;
+    int end;
+
+    void print(QList<QByteArray> a, QList<QByteArray> b){
+        {
+            if (type == Unchanged) {
+                if ((end - start) > 9) {
+                    for (int i = start; i <= start+2; i++)
+                        printf("  %s\n", a[i].data());
+                    printf("%s=\n= %d more lines\n=%s\n", colorInfo, end - start - 6, colorReset);
+                    for (int i = end-2; i <= end; i++)
+                        printf("  %s\n", a[i].data());
+                }
+                else
+                    for (int i = start; i <= end; i++)
+                        printf("  %s\n", a[i].data());
+            }
+            else if(type == Add) {
+                printf("%s", colorAdd);
+                for (int i = start; i <= end; i++){
+                    printf("+ %s\n", b[i].data());
+                }
+                printf("%s", colorReset);
+            }
+            else if (type == Delete) {
+                printf("%s", colorDelete);
+                for (int i = start; i <= end; i++) {
+                    printf("- %s\n", a[i].data());
+                }
+                printf("%s", colorReset);
+            }
+        }
+    }
+};
+
+static QList<Unit*> *unitAppend(QList<Unit*> *res, Type type, int pos)
+{
+    if (res == 0) {
+        res = new QList<Unit*>;
+        res->append(new Unit(type, pos));
+        return res;
+    }
+
+    Unit *last = res->last();
+    if (last->type == type) {
+        last->end = pos;
+    } else {
+        res->append(new Unit(type, pos));
+    }
+    return res;
+}
+
+static QList<Unit*> *diffHelper(int *lcs, QList<QByteArray> a, QList<QByteArray> b, int row, int col) {
+    if (row>0 && col>0 && (a[row-1] == b[col-1])) {
+        return unitAppend(diffHelper(lcs, a, b, row-1, col-1), Unchanged, row-1);
+    }
+    else {
+        int width = b.size()+1;
+        if ((col > 0) && ((row==0) ||
+                          lcs[width * row + col-1] >= lcs[width * (row-1) + col]))
+            {
+                return unitAppend(diffHelper(lcs, a, b, row, col-1), Add, col-1);
+            }
+        else if((row > 0) && ((col==0) ||
+                              lcs[width * row + col-1] < lcs[width * (row-1) + col])){
+            return unitAppend(diffHelper(lcs, a, b, row-1, col), Delete, row-1);;
+        }
+    }
+    delete lcs;
+    return 0;
+}
+
+static void diff(QList<QByteArray> a, QList<QByteArray> b) {
+    QList<Unit*> *res = diffHelper(lcsLength(a, b), a, b, a.size(), b.size());
+    for (int i=0; i < res->size(); i++) {
+        Unit *unit = res->at(i);
+        unit->print(a, b);
+        delete(unit);
+    }
+    delete(res);
+}
+
+
+bool FileOut::done() {
+    Q_ASSERT( !isDone );
+    isDone = true;
+    bool fileEqual = false;
+    QFile fileRead(m_name);
+    QFileInfo info(fileRead);
+    stream.flush();
+    QByteArray original;
+    if (info.exists() && (diff || (info.size() == tmp.size()))) {
+        if ( !fileRead.open(QIODevice::ReadOnly) ) {
+            ReportHandler::warning(QString("failed to open file '%1' for reading")
+                                   .arg(fileRead.fileName()));
+            return false;
+        }
+
+        original = fileRead.readAll();
+        fileRead.close();
+        fileEqual = (original == tmp);
+    }
+
+    if( !fileEqual ) {
+        if( !FileOut::dummy ) {
+            QDir dir(info.absolutePath());
+            if (!dir.mkpath(dir.absolutePath())) {
+                ReportHandler::warning(QString("unable to create directory '%1'")
+                                       .arg(dir.absolutePath()));
+                return false;
+            }
+
+            QFile fileWrite(m_name);
+            if (!fileWrite.open(QIODevice::WriteOnly)) {
+                ReportHandler::warning(QString("failed to open file '%1' for writing")
+                                       .arg(fileWrite.fileName()));
+                return false;
+            }
+            stream.setDevice(&fileWrite);
+            stream << tmp;
+        }
+        if (diff) {
+            printf("%sFile: %s%s\n", colorInfo, qPrintable(m_name), colorReset);
+
+            ::diff(original.split('\n'), tmp.split('\n'));
+
+            printf("\n");
+        }
+        return true;
+    }
+    return false;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/fileout.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#ifndef FILEOUT_H
+#define FILEOUT_H
+
+#include <QObject>
+#include <QFile>
+#include <QTextStream>
+
+class FileOut : public QObject
+{
+    Q_OBJECT
+
+private:
+    QByteArray tmp;
+    QString m_name;
+
+public:
+    FileOut(QString name);
+    ~FileOut()
+        {
+            if( !isDone )
+                done();
+        }
+
+    bool done();
+
+    QString name() const { return m_name; }
+
+    QTextStream stream;
+
+    static bool dummy;
+    static bool diff;
+
+ private:
+    bool isDone;
+};
+
+#endif // FILEOUT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/gen	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,5 @@
+#! /bin/bash
+
+rm -f generator
+make
+./generator  --output-directory=../ qtjambi_masterinclude.h build_gui.txt
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/gen.bat	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,1 @@
+release\generator.exe  --output-directory=../ qtjambi_masterinclude.h build_opengl.txt
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/generator.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,217 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#include "generator.h"
+#include "reporthandler.h"
+#include "fileout.h"
+
+#include <QDir>
+#include <QFile>
+#include <QFileInfo>
+
+Generator::Generator()
+{
+    m_num_generated = 0;
+    m_num_generated_written = 0;
+    m_out_dir = ".";
+}
+
+void Generator::generate()
+{
+    if (m_classes.size() == 0) {
+        ReportHandler::warning(QString("%1: no java classes, skipping")
+                               .arg(metaObject()->className()));
+        return;
+    }
+
+
+    foreach (AbstractMetaClass *cls, m_classes) {
+        if (!shouldGenerate(cls))
+            continue;
+
+        QString fileName = fileNameForClass(cls);
+        ReportHandler::debugSparse(QString("generating: %1").arg(fileName));
+
+        FileOut fileOut(outputDirectory() + "/" + subDirectoryForClass(cls) + "/" + fileName);
+        write(fileOut.stream, cls);
+
+        if( fileOut.done() )
+            ++m_num_generated_written;
+        ++m_num_generated;
+    }
+}
+
+
+void Generator::printClasses()
+{
+    QTextStream s(stdout);
+
+    AbstractMetaClassList classes = m_classes;
+    qSort(classes);
+
+    foreach (AbstractMetaClass *cls, classes) {
+        if (!shouldGenerate(cls))
+            continue;
+        write(s, cls);
+        s << endl << endl;
+    }
+}
+
+void Generator::verifyDirectoryFor(const QFile &file)
+{
+    QDir dir = QFileInfo(file).dir();
+    if (!dir.exists()) {
+        if (!dir.mkpath(dir.absolutePath()))
+            ReportHandler::warning(QString("unable to create directory '%1'")
+                                   .arg(dir.absolutePath()));
+    }
+}
+
+QString Generator::subDirectoryForClass(const AbstractMetaClass *) const
+{
+    Q_ASSERT(false);
+    return QString();
+}
+
+QString Generator::fileNameForClass(const AbstractMetaClass *) const
+{
+    Q_ASSERT(false);
+    return QString();
+}
+
+void Generator::write(QTextStream &, const AbstractMetaClass *)
+{
+    Q_ASSERT(false);
+}
+
+bool Generator::hasDefaultConstructor(const AbstractMetaType *type)
+{
+    QString full_name = type->typeEntry()->qualifiedTargetLangName();
+    QString class_name = type->typeEntry()->targetLangName();
+
+    foreach (const AbstractMetaClass *java_class, m_classes) {
+        if (java_class->typeEntry()->qualifiedTargetLangName() == full_name) {
+            AbstractMetaFunctionList functions = java_class->functions();
+            foreach (const AbstractMetaFunction *function, functions) {
+                if (function->arguments().size() == 0 && function->name() == class_name)
+                    return true;
+            }
+            return false;
+        }
+    }
+    return false;
+}
+
+bool isLinearContainer(const ContainerTypeEntry *type)
+{
+    if (type->type() == ContainerTypeEntry::ListContainer
+        || type->type() == ContainerTypeEntry::VectorContainer
+        || type->type() == ContainerTypeEntry::StringListContainer
+        || type->type() == ContainerTypeEntry::LinkedListContainer
+        || type->type() == ContainerTypeEntry::StackContainer
+        || type->type() == ContainerTypeEntry::SetContainer
+        || type->type() == ContainerTypeEntry::QueueContainer)
+        return true;
+    else
+        return false;
+}
+
+bool skipType(const AbstractMetaType *d_type)
+{
+    if (d_type->isContainer()) {
+        const ContainerTypeEntry* c_entry = static_cast<const ContainerTypeEntry*>(d_type->typeEntry());
+        if (c_entry->type() == ContainerTypeEntry::MapContainer ||
+            c_entry->type() == ContainerTypeEntry::MultiMapContainer ||
+            c_entry->type() == ContainerTypeEntry::MapContainer ||
+            c_entry->type() == ContainerTypeEntry::MultiHashContainer)
+            return true;
+
+        QList<AbstractMetaType *> args = d_type->instantiations();
+
+        if (args.size() != 1 || args.at(0)->isContainer()) // not QVector or QList
+            return true;
+    }
+
+    return d_type->isThread() || d_type->isTargetLangChar();
+}
+
+bool notWrappedYet(const AbstractMetaFunction *java_function)
+{
+    AbstractMetaType *d_type = java_function->type();
+    if (d_type)
+    {
+        if(skipType(d_type))
+            return true;
+    }
+
+    AbstractMetaArgumentList arguments = java_function->arguments();
+    foreach (const AbstractMetaArgument *argument, arguments) {
+        if (!java_function->argumentRemoved(argument->argumentIndex() + 1))
+            if (skipType(argument->type()))
+                return true;
+    }
+
+    return false;
+}
+
+AbstractMetaFunctionList signalFunctions(const AbstractMetaClass *cls)
+{
+    AbstractMetaFunctionList r;
+    if (cls->generateShellClass())
+    {
+        AbstractMetaClass *base = cls->baseClass();
+        if (base)
+            r += signalFunctions(base);
+
+        foreach (AbstractMetaFunction *f, cls->functions())
+        {
+            if (!f->isSignal()
+                || cls != f->implementingClass()
+                || notWrappedYet(f)
+                || f->isPrivate()
+                || f->isModifiedRemoved(TypeSystem::TargetLangCode))
+                continue;
+
+            r.append(f);
+        }
+    }
+    return r;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/generator.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,167 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#ifndef GENERATOR_H
+#define GENERATOR_H
+
+#include "metajava.h"
+#include "typesystem.h"
+
+#include "codemodel.h"
+
+#include <QObject>
+#include <QFile>
+
+extern bool cpp_shared;
+extern bool dPhobos;
+extern int dVersion;
+
+class Generator : public QObject
+{
+    Q_OBJECT
+
+    Q_PROPERTY(QString outputDirectory READ outputDirectory WRITE setOutputDirectory);
+
+public:
+    enum Option {
+        NoOption                        = 0x00000000,
+        BoxedPrimitive                  = 0x00000001,
+        ExcludeConst                    = 0x00000002,
+        ExcludeReference                = 0x00000004,
+        UseNativeIds                    = 0x00000008,
+
+        EnumAsInts                      = 0x00000010,
+        SkipName                        = 0x00000020,
+        NoCasts                         = 0x00000040,
+        SkipReturnType                  = 0x00000080,
+        OriginalName                    = 0x00000100,
+        ShowStatic                      = 0x00000200,
+        UnderscoreSpaces                = 0x00000400,
+        ForceEnumCast                   = 0x00000800,
+        ArrayAsPointer                  = 0x00001000,
+        VirtualCall                     = 0x00002000,
+        SkipTemplateParameters          = 0x00004000,
+        SkipAttributes                  = 0x00008000,
+        OriginalTypeDescription         = 0x00010000,
+        SkipRemovedArguments            = 0x00020000,
+        IncludeDefaultExpression        = 0x00040000,
+        NoReturnStatement               = 0x00080000,
+        NoBlockedSlot                   = 0x00100000,
+        NormalizeAndFixTypeSignature    = 0x00200000,
+        SuperCall                       = 0x00400000,
+        GlobalRefJObject                = 0x00800000,
+        ExternC                         = 0x01000000,
+        VirtualDispatch                 = 0x02000000,
+        ForcePointer                    = 0x10000000,
+
+        ForceValueType                  = ExcludeReference | ExcludeConst
+    };
+
+    Generator();
+
+    void setClasses(const AbstractMetaClassList &classes) { m_classes = classes; }
+    AbstractMetaClassList classes() const { return m_classes; }
+
+    QString outputDirectory() const { return m_out_dir; }
+    void setOutputDirectory(const QString &outDir) { m_out_dir = outDir; }
+    virtual void generate();
+    void printClasses();
+
+    int numGenerated() { return m_num_generated; }
+    int numGeneratedAndWritten() { return m_num_generated_written; }
+
+    virtual bool shouldGenerate(const AbstractMetaClass *) const { return true; }
+    virtual QString subDirectoryForClass(const AbstractMetaClass *java_class) const;
+    virtual QString fileNameForClass(const AbstractMetaClass *java_class) const;
+    virtual void write(QTextStream &s, const AbstractMetaClass *java_class);
+
+    bool hasDefaultConstructor(const AbstractMetaType *type);
+
+protected:
+    void verifyDirectoryFor(const QFile &file);
+
+    AbstractMetaClassList m_classes;
+    int m_num_generated;
+    int m_num_generated_written;
+    QString m_out_dir;
+};
+
+class Indentor {
+public:
+    Indentor():
+        indent(0)
+        {}
+    int indent;
+};
+
+class Indentation {
+public:
+    Indentation(Indentor &indentor):
+        indentor(indentor)
+        {
+            indentor.indent++;
+        }
+    ~Indentation()
+        {
+            indentor.indent--;
+        }
+
+private:
+    Indentor &indentor;
+};
+
+inline QTextStream &operator <<(QTextStream &s, const Indentor &indentor)
+{
+    for (int i=0; i<indentor.indent; ++i)
+        s << "    ";
+    return s;
+}
+
+inline QString signalExternName(const AbstractMetaClass *cls, const AbstractMetaFunction* signal)
+{
+    return "qtd_" + cls->name() + "_" + signal->name();
+}
+
+bool notWrappedYet(const AbstractMetaFunction *java_function);
+bool isLinearContainer(const ContainerTypeEntry *type);
+AbstractMetaFunctionList signalFunctions(const AbstractMetaClass *cls);
+
+#endif // GENERATOR_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/generator.pri	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,77 @@
+isEmpty(GENERATORPATH):GENERATORPATH = $$PWD
+INCLUDEPATH += $$GENERATORPATH
+
+TEMPLATE = app
+TARGET +=
+DEPENDPATH += $$GENERATORPATH tests parser
+mac:CONFIG -= app_bundle
+INCLUDEPATH += $$GENERATORPATH/.
+INCLUDEPATH += $$GENERATORPATH/../common
+
+unix:CONFIG += debug_and_release
+
+CONFIG += console
+RESOURCES += generator.qrc
+
+include($$GENERATORPATH/parser/rxx.pri)
+
+include($$GENERATORPATH/parser/rpp/rpp.pri)
+
+win32-msvc2005:{
+        QMAKE_CXXFLAGS += -wd4996
+        QMAKE_CFLAGS += -wd4996
+}
+
+# Input
+HEADERS += \
+        $$GENERATORPATH/generator.h \
+        $$GENERATORPATH/main.h \
+        $$GENERATORPATH/reporthandler.h \
+        $$GENERATORPATH/typeparser.h \
+        $$GENERATORPATH/typesystem.h \
+        $$GENERATORPATH/asttoxml.h \
+        $$GENERATORPATH/fileout.h \
+        $$GENERATORPATH/generatorset.h \
+        $$GENERATORPATH/metajava.h \
+        $$GENERATORPATH/customtypes.h \
+        $$GENERATORPATH/abstractmetabuilder.h \
+        $$GENERATORPATH/abstractmetalang.h \
+        $$GENERATORPATH/prigenerator.h \
+
+
+
+
+SOURCES += \
+        $$GENERATORPATH/generator.cpp \
+        $$GENERATORPATH/main.cpp \
+        $$GENERATORPATH/reporthandler.cpp \
+        $$GENERATORPATH/typeparser.cpp \
+        $$GENERATORPATH/typesystem.cpp \
+        $$GENERATORPATH/asttoxml.cpp \
+        $$GENERATORPATH/fileout.cpp \
+        $$GENERATORPATH/generatorset.cpp \
+        $$GENERATORPATH/metajava.cpp \
+        $$GENERATORPATH/customtypes.cpp \
+        $$GENERATORPATH/abstractmetabuilder.cpp \
+        $$GENERATORPATH/abstractmetalang.cpp \
+        $$GENERATORPATH/prigenerator.cpp \
+
+
+
+QT = core xml
+
+win32{
+        PRECOMPILED_HEADER = generator_pch.h
+        CONFIG += precompile_header
+}
+
+win32-msvc.net {
+        QMAKE_CXXFLAGS += /Zm500
+        QMAKE_CXXFLAGS -= -Zm200
+        QMAKE_CFLAGS -= -Zm200
+}
+
+mac {
+    contains(QT_CONFIG, x86):contains(QT_CONFIG, ppc):CONFIG += x86 ppc
+    CONFIG -= precompile_header
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/generator.pro	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,33 @@
+contains(QT_CONFIG, release) { 
+    CONFIG -= debug
+    CONFIG += release
+}
+
+# Input
+HEADERS += classlistgenerator.h \
+    cppgenerator.h \
+    cppheadergenerator.h \
+    cppimplgenerator.h \
+    docparser.h \
+    generatorsetd.h \
+    dgenerator.h \
+    jumptable.h \
+    metainfogenerator.h \
+    metajavabuilder.h \
+    qdocgenerator.h \
+    uiconverter.h \
+    containergenerator.h
+SOURCES += classlistgenerator.cpp \
+    cppgenerator.cpp \
+    cppheadergenerator.cpp \
+    cppimplgenerator.cpp \
+    docparser.cpp \
+    generatorsetd.cpp \
+    dgenerator.cpp \
+    jumptable.cpp \
+    metainfogenerator.cpp \
+    metajavabuilder.cpp \
+    qdocgenerator.cpp \
+    uiconverter.cpp \
+    containergenerator.cpp
+include(generator.pri)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/generator.qrc	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,24 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource prefix="/trolltech/generator/">
+<file alias="typesystem_core.txt">typesystem_core.xml</file>
+<file>typesystem_core-java.java</file>
+<file alias="typesystem_gui.txt">typesystem_gui.xml</file>
+<file>typesystem_gui-java.java</file>
+<file alias="typesystem_sql.txt">typesystem_sql.xml</file>
+<file>typesystem_sql-java.java</file>
+<file alias="typesystem_opengl.txt">typesystem_opengl.xml</file>
+<file>typesystem_opengl-java.java</file>
+<file alias="typesystem_svg.txt">typesystem_svg.xml</file>
+<file alias="typesystem_network.txt">typesystem_network.xml</file>
+<file>typesystem_network-java.java</file>
+<file alias="typesystem_xml.txt">typesystem_xml.xml</file>
+<file>typesystem_xml-java.java</file>
+<file alias="typesystem_phonon.txt">typesystem_phonon.xml</file>
+<file>typesystem_phonon-java.java</file>
+<file alias="typesystem_webkit.txt">typesystem_webkit.xml</file>
+<file>typesystem_webkit-java.java</file>
+<file alias="typesystem_xmlpatterns.txt">typesystem_xmlpatterns.xml</file>
+<file>typesystem_xmlpatterns-java.java</file>
+<file>parser/rpp/pp-qt-configuration</file>
+</qresource>
+</RCC>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/generator_pch.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#include "typesystem.h"
+#include "metajava.h"
+#include "generator.h"
+#include "cppheadergenerator.h"
+#include "cppimplgenerator.h"
+#include "dgenerator.h"
+#include "metainfogenerator.h"
+#include "reporthandler.h"
+#include "metajavabuilder.h"
+#include "classlistgenerator.h"
+#include "qdocgenerator.h"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/generatorset.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#include "generatorset.h"
+
+GeneratorSet::GeneratorSet() :
+    outDir("."),
+    printStdout(false)
+{}
+
+bool GeneratorSet::readParameters(const QMap<QString, QString> args) {
+    if (args.contains("output-directory")) {
+        outDir = args.value("output-directory");
+    }
+
+    printStdout = args.contains("print-stdout");
+
+    return !(args.contains("help") || args.contains("h") || args.contains("?"));
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/generatorset.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#ifndef GENERATOR_SET_H
+#define GENERATOR_SET_H
+
+#include <QObject>
+#include <QString>
+#include <QStringList>
+#include <QMap>
+
+class GeneratorSet : public QObject
+{
+    Q_OBJECT
+
+ public:
+    GeneratorSet();
+
+    virtual QString usage() = 0;
+    virtual bool readParameters(const QMap<QString, QString> args) = 0;
+    virtual void buildModel(const QString pp_file) = 0;
+    virtual void dumpObjectTree() = 0;
+    virtual QString generate() = 0;
+
+    static GeneratorSet *getInstance();
+    QString outDir;
+    bool printStdout;
+};
+
+#endif // GENERATOR_SET_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/generatorsetd.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,340 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+*
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#include "generatorsetd.h"
+#include "reporthandler.h"
+
+#include "dgenerator.h"
+#include "cppheadergenerator.h"
+#include "cppimplgenerator.h"
+#include "metainfogenerator.h"
+#include "classlistgenerator.h"
+#include "containergenerator.h"
+#include "qdocgenerator.h"
+#include "uiconverter.h"
+#include "jumptable.h"
+
+#include <QFileInfo>
+
+GeneratorSet *GeneratorSet::getInstance() {
+    return new GeneratorSetD();
+}
+
+void dumpMetaDTree(const AbstractMetaClassList &classes);
+
+GeneratorSetD::GeneratorSetD() :
+    no_d(false),
+    no_cpp_h(false),
+    no_cpp_impl(false),
+    no_metainfo(false),
+    build_class_list(false),
+    build_qdoc_japi(false),
+    docs_enabled(false),
+    do_ui_convert(false),
+    native_jump_table(false),
+    doc_dir("../../main/doc/jdoc")
+{}
+
+QString GeneratorSetD::usage() {
+    QString usage =
+        "  --no-d                                 \n"
+        "  --no-metainfo                             \n"
+        "  --no-cpp-h                                \n"
+        "  --no-cpp-impl                             \n"
+        "  --convert-to-jui=[.ui-file name]          \n"
+        "  --custom-widgets=[file names]             \n";
+
+    return usage;
+}
+
+bool GeneratorSetD::readParameters(const QMap<QString, QString> args) {
+    no_d = args.contains("no-d");
+    no_cpp_h = args.contains("no-cpp-h");
+    no_cpp_impl = args.contains("no-cpp-impl");
+    no_metainfo = args.contains("no-metainfo");
+    build_class_list = args.contains("build-class-list");
+    native_jump_table = args.contains("native-jump-table");
+
+    if (args.contains("build-qdoc-japi")) {
+        no_d = true;
+        no_cpp_h = true;
+        no_cpp_impl = true;
+        no_metainfo = true;
+        build_qdoc_japi = true;
+    }
+
+    if (args.contains("jdoc-dir")) {
+        doc_dir =  args.value("jdoc-dir");
+    }
+
+    docs_enabled = args.contains("jdoc-enabled");
+
+    if (args.contains("custom-widgets"))
+        custom_widgets = args.value("custom-widgets");
+
+    if (args.contains("convert-to-jui")) {
+        ui_file_name = args.value("convert-to-jui");
+        do_ui_convert = true;
+
+        if (!QFileInfo(ui_file_name).exists()) {
+            printf(".ui file '%s' does not exist\n", qPrintable(ui_file_name));
+            return false;
+        }
+    }
+    return GeneratorSet::readParameters(args);
+}
+
+void GeneratorSetD::buildModel(const QString pp_file) {
+    // Building the code inforamation...
+    builder.setFileName(pp_file);
+    builder.build();
+}
+
+void GeneratorSetD::dumpObjectTree() {
+    dumpMetaDTree(builder.classes());
+}
+
+QString GeneratorSetD::generate() {
+
+    // Ui conversion...
+    if (do_ui_convert) {
+        UiConverter converter;
+        converter.setClasses(builder.classes());
+        converter.convertToJui(ui_file_name, custom_widgets);
+        return 0;
+    } else if (!custom_widgets.isEmpty()) {
+        fprintf(stderr, "NOTE: The --custom-widgets option only has an effect when used with --convert-to-jui");
+    }
+
+    // Code generation
+    QList<Generator *> generators;
+    PriGenerator *priGenerator = new PriGenerator;
+    ContainerGenerator *cointainerGenerator = new ContainerGenerator;
+    DGenerator *d_generator = 0;
+    CppHeaderGenerator *cpp_header_generator = 0;
+    CppImplGenerator *cpp_impl_generator = 0;
+    MetaInfoGenerator *metainfo = 0;
+    JumpTablePreprocessor *jumpTablePreprocessor = 0;
+    JumpTableGenerator *jumpTableGenerator = 0;
+
+    QStringList contexts;
+    if (build_qdoc_japi) {
+        generators << new QDocGenerator;
+        contexts << "QDocGenerator";
+    }
+
+    if (native_jump_table) {
+        jumpTablePreprocessor = new JumpTablePreprocessor();
+        generators << jumpTablePreprocessor;
+        contexts << "JumpTablePreprocessor";
+    }
+
+    if (!no_d) {
+        d_generator = new DGenerator;
+        d_generator->setDocumentationDirectory(doc_dir);
+        d_generator->setDocumentationEnabled(docs_enabled);
+        d_generator->setNativeJumpTable(native_jump_table);
+        generators << d_generator;
+
+        contexts << "JavaGenerator";
+    }
+
+    if (!no_cpp_h) {
+        cpp_header_generator = new CppHeaderGenerator(priGenerator);
+        generators << cpp_header_generator;
+        contexts << "CppHeaderGenerator";
+    }
+
+    if (!no_cpp_impl) {
+        cpp_impl_generator = new CppImplGenerator(priGenerator);
+        cpp_impl_generator->setNativeJumpTable(native_jump_table);
+        generators << cpp_impl_generator;
+        contexts << "CppImplGenerator";
+    }
+
+    if (native_jump_table) {
+        jumpTableGenerator = new JumpTableGenerator(jumpTablePreprocessor, priGenerator);
+        generators << jumpTableGenerator;
+        contexts << "JumpTableGenerator";
+    }
+
+    if (!no_metainfo) {
+        metainfo = new MetaInfoGenerator(priGenerator);
+        generators << metainfo;
+        contexts << "MetaInfoGenerator";
+    }
+
+    if (build_class_list) {
+        generators << new ClassListGenerator;
+        contexts << "ClassListGenerator";
+    }
+
+    generators << priGenerator;
+    contexts << "PriGenerator";
+
+    generators << cointainerGenerator;
+    contexts << "cointainerGenerator";
+
+    for (int i=0; i<generators.size(); ++i) {
+        Generator *generator = generators.at(i);
+        ReportHandler::setContext(contexts.at(i));
+
+        generator->setOutputDirectory(outDir);
+        generator->setClasses(builder.classes());
+        if (printStdout)
+            generator->printClasses();
+        else
+            generator->generate();
+    }
+
+    QString res;
+    res = QString("Classes in typesystem: %1\n"
+                  "Generated:\n"
+                  "  - d.........: %2 (%3)\n"
+                  "  - cpp-impl..: %4 (%5)\n"
+                  "  - cpp-h.....: %6 (%7)\n"
+                  "  - meta-info.: %8 (%9)\n"
+                  "  - pri.......: %10 (%11)\n"
+                  )
+        .arg(builder.classes().size())
+        .arg(d_generator ? d_generator->numGenerated() : 0)
+        .arg(d_generator ? d_generator->numGeneratedAndWritten() : 0)
+        .arg(cpp_impl_generator ? cpp_impl_generator->numGenerated() : 0)
+        .arg(cpp_impl_generator ? cpp_impl_generator->numGeneratedAndWritten() : 0)
+        .arg(cpp_header_generator ? cpp_header_generator->numGenerated() : 0)
+        .arg(cpp_header_generator ? cpp_header_generator->numGeneratedAndWritten() : 0)
+        .arg(metainfo ? metainfo->numGenerated() : 0)
+        .arg(metainfo ? metainfo->numGeneratedAndWritten() : 0)
+        .arg(priGenerator->numGenerated())
+        .arg(priGenerator->numGeneratedAndWritten());
+
+    return res;
+}
+
+void dumpMetaDAttributes(const AbstractMetaAttributes *attr)
+{
+    if (attr->isNative()) printf(" native");
+    if (attr->isAbstract()) printf(" abstract");
+    if (attr->isFinalInTargetLang()) printf(" final(d)");
+    if (attr->isFinalInCpp()) printf(" final(cpp)");
+    if (attr->isStatic()) printf(" static");
+    if (attr->isPrivate()) printf(" private");
+    if (attr->isProtected()) printf(" protected");
+    if (attr->isPublic()) printf(" public");
+    if (attr->isFriendly()) printf(" friendly");
+}
+
+void dumpMetaDType(const AbstractMetaType *type)
+{
+    if (!type) {
+        printf("[void]");
+    } else {
+        printf("[type: %s", qPrintable(type->typeEntry()->qualifiedCppName()));
+        if (type->isReference()) printf(" &");
+        int indirections = type->indirections();
+        if (indirections) printf(" %s", qPrintable(QString(indirections, '*')));
+
+        printf(", %s", qPrintable(type->typeEntry()->qualifiedTargetLangName()));
+
+        if (type->isPrimitive()) printf(" primitive");
+        if (type->isEnum()) printf(" enum");
+        if (type->isQObject()) printf(" q_obj");
+        if (type->isNativePointer()) printf(" n_ptr");
+        if (type->isTargetLangString()) printf(" d_string");
+        if (type->isConstant()) printf(" const");
+        printf("]");
+    }
+}
+
+void dumpMetaDArgument(const AbstractMetaArgument *arg)
+{
+    printf("        ");
+    dumpMetaDType(arg->type());
+    printf(" %s", qPrintable(arg->argumentName()));
+    if (!arg->defaultValueExpression().isEmpty())
+        printf(" = %s", qPrintable(arg->defaultValueExpression()));
+    printf("\n");
+}
+
+void dumpMetaDFunction(const AbstractMetaFunction *func)
+{
+    printf("    %s() - ", qPrintable(func->name()));
+    dumpMetaDType(func->type());
+    dumpMetaDAttributes(func);
+    if (func->isConstant()) printf(" const");
+    printf("\n      arguments:\n");
+    foreach (AbstractMetaArgument *arg, func->arguments())
+        dumpMetaDArgument(arg);
+}
+
+void dumpMetaDClass(const AbstractMetaClass *cls)
+{
+    printf("\nclass: %s, package: %s\n", qPrintable(cls->name()), qPrintable(cls->package()));
+    if (cls->hasVirtualFunctions())
+        printf("    shell based\n");
+    printf("  baseclass: %s %s\n", qPrintable(cls->baseClassName()), cls->isQObject() ? "'QObject-type'" : "'not a QObject-type'");
+    printf("  interfaces:");
+    foreach (AbstractMetaClass *iface, cls->interfaces())
+        printf(" %s", qPrintable(iface->name()));
+    printf("\n");
+    printf("  attributes:");
+    dumpMetaDAttributes(cls);
+
+    printf("\n  functions:\n");
+    foreach (const AbstractMetaFunction *func, cls->functions())
+        dumpMetaDFunction(func);
+
+    //     printf("\n  fields:\n");
+    //     foreach (const AbstractMetaField *field, cls->fields())
+    //         dumpMetaJavaField(field);
+
+    //     printf("\n  enums:\n");
+    //     foreach (const AbstractMetaEnum *e, cls->enums())
+    //         dumpMetaJavaEnum(e);
+}
+
+void dumpMetaDTree(const AbstractMetaClassList &classes)
+{
+    foreach (AbstractMetaClass *cls, classes) {
+        dumpMetaDClass(cls);
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/generatorsetd.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,83 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+*
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#ifndef GENERATOR_SET_D_H
+#define GENERATOR_SET_D_H
+
+#include "generatorset.h"
+#include "metajavabuilder.h"
+
+class GeneratorSetD : public GeneratorSet
+{
+    Q_OBJECT
+
+public:
+    GeneratorSetD();
+
+    QString usage();
+    bool readParameters(const QMap<QString, QString> args);
+
+    void buildModel(const QString pp_file);
+    void dumpObjectTree();
+
+    QString generate();
+
+private:
+
+    bool no_d;
+    bool no_cpp_h;
+    bool no_cpp_impl;
+    bool no_metainfo;
+    bool build_class_list;
+    bool build_qdoc_japi;
+    bool docs_enabled;
+    bool do_ui_convert;
+    bool native_jump_table;
+
+    QString doc_dir;
+    QString ui_file_name;
+    QString custom_widgets;
+
+    MetaJavaBuilder builder;
+
+};
+
+#endif // GENERATOR_SET_D_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/jumptable.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,369 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#include "jumptable.h"
+#include "cppimplgenerator.h"
+#include "reporthandler.h"
+#include "fileout.h"
+
+
+static QHash<QString, QString> shortNames;
+static QHash<char, QString> expandNamesJNI;
+static QHash<char, QString> expandNamesJava;
+
+bool JumpTableGenerator::active = false;
+
+static QString simplifyName(const QString &name, const QString &context, const QString &funcName)
+{
+    if (shortNames.size() == 0) {
+        shortNames.insert("jboolean", "Z");
+        shortNames.insert("jbyte", "B");
+        shortNames.insert("jchar", "C");
+        shortNames.insert("jshort", "S");
+        shortNames.insert("jint", "I");
+        shortNames.insert("jlong", "J");
+        shortNames.insert("jfloat", "F");
+        shortNames.insert("jdouble", "D");
+        shortNames.insert("jobject", "L");
+        shortNames.insert("void", "V");
+
+        // Because QBool is specialcased in the typesystem to do
+        // automatic conversions from between bool and jboolean, we
+        // need to handle bool specially here.
+        shortNames.insert("bool", "Z");
+    }
+
+    QString sn = ((const QHash<QString, QString> &) shortNames).value(name);
+    if (sn.isEmpty()) {
+        printf("Failed to translate to shortname: %s in %s :: %s\n",
+               qPrintable(name),
+               qPrintable(context),
+               qPrintable(funcName));
+    }
+
+    return shortNames.value(name);
+}
+
+static QString expandNameJNI(const QChar &c) {
+    if (expandNamesJNI.size() == 0) {
+        expandNamesJNI.insert('Z', "jboolean");
+        expandNamesJNI.insert('B', "jbyte");
+        expandNamesJNI.insert('C', "jchar");
+        expandNamesJNI.insert('S', "jshort");
+        expandNamesJNI.insert('I', "jint");
+        expandNamesJNI.insert('J', "jlong");
+        expandNamesJNI.insert('F', "jfloat");
+        expandNamesJNI.insert('D', "jdouble");
+        expandNamesJNI.insert('L', "jobject");
+        expandNamesJNI.insert('V', "void");
+    }
+
+    QString n = ((const QHash<char, QString> &) expandNamesJNI).value(c.toLatin1());
+    if (n.isEmpty())
+        printf("Failed to translate to expanded names: %c\n", c.toLatin1());
+
+    return n;
+}
+
+static QString expandNameJava(const QChar &c) {
+    if (expandNamesJava.size() == 0) {
+        expandNamesJava.insert('Z', "boolean");
+        expandNamesJava.insert('B', "byte");
+        expandNamesJava.insert('C', "char");
+        expandNamesJava.insert('S', "short");
+        expandNamesJava.insert('I', "int");
+        expandNamesJava.insert('J', "long");
+        expandNamesJava.insert('F', "float");
+        expandNamesJava.insert('D', "double");
+        expandNamesJava.insert('L', "Object");
+        expandNamesJava.insert('V', "void");
+    }
+
+    QString n = ((const QHash<char, QString> &) expandNamesJava).value(c.toLatin1());
+    if (n.isEmpty())
+        printf("Failed to translate to expanded names: %c\n", c.toLatin1());
+
+    return n;
+}
+
+
+void JumpTablePreprocessor::generate()
+{
+    ReportHandler::setContext("JumpTablePreprocessor");
+    foreach (AbstractMetaClass *cl, m_classes) {
+        process(cl);
+    }
+}
+
+void JumpTablePreprocessor::process(AbstractMetaClass *cls)
+{
+    // Skip generate=no classes, such as QFutureIterator
+    if (cls->typeEntry()->codeGeneration() != TypeEntry::GenerateAll) {
+//         printf("skipping class: %s, generation is : %x vs %x\n",
+//                qPrintable(cls->name()),
+//                cls->typeEntry()->codeGeneration(),
+//                TypeEntry::GenerateAll);
+        return;
+    }
+
+    QString package = cls->package();
+
+    if (!m_table.contains(package))
+        m_table[package] = SignatureTable();
+
+
+    SignatureTable &signatureList = m_table[package];
+
+    // Native callbacks (all java functions require native callbacks)
+    AbstractMetaFunctionList class_funcs = cls->functionsInTargetLang();
+    foreach (AbstractMetaFunction *function, class_funcs) {
+        if (!function->isEmptyFunction())
+            process(function, &signatureList);
+    }
+
+
+    class_funcs = cls->queryFunctions(AbstractMetaClass::NormalFunctions
+                                             | AbstractMetaClass::AbstractFunctions
+                                             | AbstractMetaClass::NotRemovedFromTargetLang);
+    foreach (AbstractMetaFunction *function, class_funcs) {
+        if (function->implementingClass() != cls) {
+            process(function, &signatureList);
+        }
+    }
+}
+
+
+QString JumpTablePreprocessor::signature(const AbstractMetaFunction *func)
+{
+    QString signature;
+    QString context = func->implementingClass()->name();
+    QString functionSignature = func->signature();
+
+    if (func->argumentRemoved(0))
+        signature = "V";
+    else
+        signature = simplifyName(CppImplGenerator::jniReturnName(func), context, functionSignature);
+
+    AbstractMetaArgumentList args = func->arguments();
+    foreach (const AbstractMetaArgument *a, args) {
+        if (!func->argumentRemoved(a->argumentIndex() + 1)) {
+            if (!a->type()->hasNativeId())
+                signature += simplifyName(CppImplGenerator::translateType(a->type(), EnumAsInts),
+                                          context, functionSignature);
+            else
+                signature += "J";
+        }
+    }
+
+    return signature;
+}
+
+
+void JumpTablePreprocessor::process(AbstractMetaFunction *func, SignatureTable *table)
+{
+    if (!func->needsCallThrough())
+        return;
+
+
+    if (func->jumpTableId() >= 0) {
+//         printf("%s::%s already has an ID=%d, for declaring=%s, owner=%s\n",
+//                qPrintable(func->implementingClass()->name()),
+//                qPrintable(func->signature()),
+//                func->jumpTableId(),
+//                qPrintable(func->declaringClass()->name()),
+//                qPrintable(func->ownerClass()->name()));
+        return;
+    }
+
+    QString sig = signature(func);
+
+    AbstractMetaFunctionList &list = (*table)[sig];
+    list.append(func);
+    func->setJumpTableId(list.size());
+}
+
+
+JumpTableGenerator::JumpTableGenerator(JumpTablePreprocessor *pp, PriGenerator *pri)
+    : m_preprocessor(pp),
+      m_prigenerator(pri)
+{
+    active = true;
+}
+
+
+void JumpTableGenerator::generate()
+{
+    for (PackageJumpTable::const_iterator it = m_preprocessor->table()->constBegin();
+         it != m_preprocessor->table()->constEnd(); ++it) {
+        QString package = it.key();
+        generatePackage(package, it.value());
+    }
+}
+
+
+void JumpTableGenerator::generatePackage(const QString &packageName, const SignatureTable &table)
+{
+    generateNativeTable(packageName, table);
+    generateJavaTable(packageName, table);
+}
+
+
+void JumpTableGenerator::generateJavaTable(const QString &packageName,
+                                           const SignatureTable &table)
+{
+    QString tableFile = QString("%1/%2/JTbl.java")
+                        .arg(outputDirectory())
+                        .arg(QString(packageName).replace(".", "/"));
+
+    printf("Generating jump table (.java): %s\n", qPrintable(tableFile));
+
+    FileOut file(tableFile);
+
+    QTextStream &s = file.stream;
+
+    s << "package " << packageName << ";" << endl << endl;
+    s << "class JTbl {" << endl;
+
+
+    for (SignatureTable::const_iterator sit = table.constBegin(); sit != table.constEnd(); ++sit) {
+        QString signature = sit.key();
+
+        QString ret = expandNameJava(signature.at(0));
+
+        s << "    static native " << ret << " " << signature << "(int id, long nid";
+
+        for (int i=1; i<signature.size(); ++i) {
+            s << ", " << expandNameJava(signature.at(i)) << " a" << i;
+        }
+
+        s << ", Object _this);" << endl;
+    }
+
+    s << "}" << endl;
+}
+
+
+void JumpTableGenerator::generateNativeTable(const QString &packageName,
+                                             const SignatureTable &table)
+{
+    QString tableFile = QString("%1/%2/nativejumptable.cpp")
+                        .arg(outputDirectory())
+                        .arg(CppGenerator::subDirectoryForPackage(packageName));
+
+    FileOut file(tableFile);
+
+    QString pkgSubDir = QString(packageName).replace(".", "_");
+    m_prigenerator->addSource(pkgSubDir + "/" + pkgSubDir + ".pri", "nativejumptable.cpp");
+
+    printf("Generating jump table (.cpp): %s\n", qPrintable(tableFile));
+
+    QTextStream &s = file.stream;
+
+    s << "#include <qtjambi_global.h>" << endl;
+
+    for (SignatureTable::const_iterator sit = table.constBegin(); sit != table.constEnd(); ++sit) {
+        QString signature = sit.key();
+
+        QString ret = expandNameJNI(signature.at(0));
+
+        s << endl << endl
+          << "extern \"C\" Q_DECL_EXPORT " << ret << " JNICALL QTJAMBI_FUNCTION_PREFIX(Java_"
+          << QString(packageName).replace("_", "_1").replace(".", "_") << "_JTbl_" << signature << ")" << endl
+          << "(JNIEnv *e, jclass, jint id, jlong nid";
+
+        for (int i=1; i<signature.size(); ++i) {
+            s << ", " << expandNameJNI(signature.at(i)) << " a" << i;
+        }
+
+        s << ", jobject __this)" << endl
+          << "{" << endl
+          << "Q_UNUSED(__this);" << endl
+          << "Q_UNUSED(nid);" << endl
+          << "switch (id) { " << endl;
+
+        AbstractMetaFunctionList functions = sit.value();
+        bool hasReturn = signature.at(0) != 'V';
+
+        foreach (AbstractMetaFunction *f, functions) {
+            const AbstractMetaClass *cls = f->ownerClass();
+            s << endl
+              << "// " << cls->name() << "::" << f->signature() << ", declaring=" << f->declaringClass()->name() << ", implementing=" << f->implementingClass()->name() << endl
+              << "case " << f->jumpTableId() << ":" << endl
+              << "extern ";
+            CppImplGenerator::writeFunctionName(s, f, cls, CppImplGenerator::ReturnType);
+            s << endl;
+            CppImplGenerator::writeFinalFunctionArguments(s, f);
+            s << ";" << endl;
+
+            if (hasReturn && !f->isConstructor())
+                s << "return ";
+
+            CppImplGenerator::writeFunctionName(s, f, cls, 0);
+
+            s << "(e";
+
+            if (f->isStatic())
+                s << ", 0";
+            else if (f->isConstructor())
+                s << ", __this";
+            else
+                s << ", __this, nid";
+
+            for (int i=1; i<signature.size(); ++i) {
+                s << ", a" << i;
+            }
+
+            s << ");" << endl
+              << "break;" << endl;
+        }
+
+        s << "} // switch..." << endl;
+
+        if (hasReturn)
+            s << "return 0;" << endl;
+
+        s << "} // " << signature << endl;
+    }
+}
+
+bool JumpTableGenerator::isJumpTableActive() {
+    return active;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/jumptable.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,93 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#ifndef JUMPTABLE_H
+#define JUMPTABLE_H
+
+#include "generator.h"
+#include "abstractmetalang.h"
+#include "prigenerator.h"
+
+
+typedef QHash<QString, AbstractMetaFunctionList> SignatureTable;
+typedef QHash<QString, SignatureTable> PackageJumpTable;
+
+
+class JumpTablePreprocessor : public Generator
+{
+    Q_OBJECT
+public:
+    void generate();
+
+    static QString signature(const AbstractMetaFunction *func);
+
+    inline const PackageJumpTable *table() const { return &m_table; }
+
+    bool usesJumpTable(AbstractMetaFunction *func);
+
+private:
+    void process(AbstractMetaClass *cls);
+    void process(AbstractMetaFunction *cls, SignatureTable *sigList);
+    PackageJumpTable m_table;
+};
+
+
+class JumpTableGenerator : public Generator
+{
+    Q_OBJECT
+public:
+    JumpTableGenerator(JumpTablePreprocessor *pp, PriGenerator *pri);
+
+    void generate();
+    void generatePackage(const QString &packageName, const SignatureTable &table);
+    void generateNativeTable(const QString &packageName, const SignatureTable &table);
+    void generateJavaTable(const QString &packageName, const SignatureTable &table);
+
+    static bool isJumpTableActive();
+
+private:
+    JumpTablePreprocessor *m_preprocessor;
+    PriGenerator *m_prigenerator;
+
+    static bool active;
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/main.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,229 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#include "main.h"
+#include "asttoxml.h"
+#include "reporthandler.h"
+#include "typesystem.h"
+#include "generatorset.h"
+#include "fileout.h"
+#include "binder.h"
+
+#include "abstractmetalang.h"
+
+#include <QDir>
+
+bool cpp_shared;
+bool dPhobos = false;
+int dVersion = 1;
+
+void ReportHandler_message_handler(const std::string &str)
+{
+    ReportHandler::warning(QString::fromStdString(str));
+}
+
+
+void displayHelp(GeneratorSet *generatorSet);
+
+#include <QDebug>
+int main(int argc, char *argv[])
+{
+    GeneratorSet *gs = GeneratorSet::getInstance();
+
+    QString default_file = "qtjambi_masterinclude.h";
+    QString default_system = "build_all.txt";
+
+    QString fileName;
+    QString typesystemFileName;
+    QString pp_file = ".preprocessed.tmp";
+    QStringList rebuild_classes;
+
+    QMap<QString, QString> args;
+
+    int argNum = 0;
+    for (int i=1; i<argc; ++i) {
+        QString arg(argv[i]);
+        arg = arg.trimmed();
+        if( arg.startsWith("--") ) {
+            int split = arg.indexOf("=");
+            if( split > 0 )
+                args[arg.mid(2).left(split-2)] = arg.mid(split + 1).trimmed();
+            else
+                args[arg.mid(2)] = QString();
+        } else if( arg.startsWith("-")) {
+            args[arg.mid(1)] = QString();
+        } else {
+            argNum++;
+            args[QString("arg-%1").arg(argNum)] = arg;
+        }
+    }
+
+    if (args.contains("no-suppress-warnings")) {
+        TypeDatabase *db = TypeDatabase::instance();
+        db->setSuppressWarnings(false);
+    }
+
+    if (args.contains("include-eclipse-warnings")) {
+        TypeDatabase *db = TypeDatabase::instance();
+        db->setIncludeEclipseWarnings(true);
+    }
+
+    if (args.contains("debug-level")) {
+        QString level = args.value("debug-level");
+        if (level == "sparse")
+            ReportHandler::setDebugLevel(ReportHandler::SparseDebug);
+        else if (level == "medium")
+            ReportHandler::setDebugLevel(ReportHandler::MediumDebug);
+        else if (level == "full")
+            ReportHandler::setDebugLevel(ReportHandler::FullDebug);
+    }
+
+    if (args.contains("dummy")) {
+        FileOut::dummy = true;
+    }
+
+    if (args.contains("diff")) {
+        FileOut::diff = true;
+    }
+
+    if (args.contains("rebuild-only")) {
+        QStringList classes = args.value("rebuild-only").split(",", QString::SkipEmptyParts);
+        TypeDatabase::instance()->setRebuildClasses(classes);
+    }
+
+    if (args.contains("d-target"))
+    {
+        QString dTarget = args.value("d-target");
+        if (dTarget == "d1-tango")
+            dVersion = 1;
+        /*
+        else if (dtarget == "d2-tango")
+            qFatal("Tango D2 target is not supported");
+        */
+        else if (dTarget == "d2-phobos")
+        {
+            dVersion = 2;
+            dPhobos = true;
+        }
+        else
+        {
+            fprintf(stderr, "D target '%s' is not recognized", qPrintable(dTarget));
+            return 1;
+        }
+    }
+
+    fileName = args.value("arg-1");
+
+    typesystemFileName = args.value("arg-2");
+    if (args.contains("arg-3"))
+        displayHelp(gs);
+
+    if (fileName.isEmpty())
+        fileName = default_file;
+
+    if (typesystemFileName.isEmpty())
+        typesystemFileName = default_system;
+
+    if (fileName.isEmpty() || typesystemFileName.isEmpty() )
+        displayHelp(gs);
+
+    if (!gs->readParameters(args))
+        displayHelp(gs);
+
+    cpp_shared = args.contains("cpp_shared");
+
+    printf("Running the QtD Generator. Please wait while source files are being generated...\n");
+
+    if (!TypeDatabase::instance()->parseFile(typesystemFileName))
+        qFatal("Cannot parse file: '%s'", qPrintable(typesystemFileName));
+
+
+    if (!Preprocess::preprocess(fileName, pp_file, args.value("include-paths"))) {
+        fprintf(stderr, "Preprocessor failed on file: '%s'\n", qPrintable(fileName));
+        return 1;
+    }
+
+    if (args.contains("ast-to-xml")) {
+    astToXML(pp_file);
+    return 0;
+    }
+
+    ArgumentReplace::init(); // replacer for arguments which are D keywords such as "version"
+
+    Binder::installMessageHandler(ReportHandler_message_handler);
+    gs->buildModel(pp_file);
+    if (args.contains("dump-object-tree")) {
+        gs->dumpObjectTree();
+        return 0;
+    }
+    printf("%s\n", qPrintable(gs->generate()));
+
+    printf("Done, %d warnings (%d known issues)\n", ReportHandler::warningCount(),
+           ReportHandler::suppressedCount());
+}
+
+
+void displayHelp(GeneratorSet* generatorSet) {
+#if defined(Q_OS_WIN32)
+    char path_splitter = ';';
+#else
+    char path_splitter = ':';
+#endif
+    printf("Usage:\n  generator [options] header-file typesystem-file\n\n");
+    printf("Available options:\n\n");
+    printf("General:\n");
+    printf(
+           "  --cpp-shared                              \n"
+           "  --debug-level=[sparse|medium|full]        \n"
+           "  --d-target=[d1-tango|d2-phobos]                 \n"
+           "  --dump-object-tree                        \n"
+           "  --help, -h or -?                          \n"
+           "  --no-suppress-warnings                    \n"
+           "  --include-eclipse-warnings                \n"
+           "  --output-directory=[dir]                  \n"
+           "  --include-paths=<path>[%c<path>%c...]     \n"
+           "  --print-stdout                            \n"
+           ,
+           path_splitter, path_splitter);
+
+    printf("%s", qPrintable( generatorSet->usage()));
+    exit(0);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/main.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,135 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#ifndef MAIN_H
+#define MAIN_H
+
+#include "pp.h"
+
+#include <QFile>
+#include <QDir>
+
+struct Preprocess
+{
+    static bool preprocess(const QString &sourceFile, const QString &targetFile, const QString &commandLineIncludes = QString())
+    {
+        rpp::pp_environment env;
+        rpp::pp preprocess(env);
+
+        rpp::pp_null_output_iterator null_out;
+
+        const char *ppconfig = ":/trolltech/generator/parser/rpp/pp-qt-configuration";
+
+        QFile file(ppconfig);
+        if (!file.open(QFile::ReadOnly)) {
+            fprintf(stderr, "Preprocessor configuration file not found '%s'\n", ppconfig);
+            return false;
+        }
+
+        QByteArray ba = file.readAll();
+        file.close();
+        preprocess.operator() (ba.constData(), ba.constData() + ba.size(), null_out);
+
+        QStringList includes;
+        includes << QString(".");
+
+#if defined(Q_OS_WIN32)
+        const char *path_splitter = ";";
+#else
+        const char *path_splitter = ":";
+#endif
+        // Environment INCLUDE
+        QString includePath = getenv("INCLUDE");
+        if (!includePath.isEmpty())
+            includes += includePath.split(path_splitter);
+
+        // Includes from the command line
+        if (!commandLineIncludes.isEmpty())
+            includes += commandLineIncludes.split(path_splitter);
+
+        // Include Qt
+        QString qtdir_inc = getenv ("QTDIR_INC");
+        QString qtdir = getenv ("QTDIR");
+        if (qtdir.isEmpty() && qtdir_inc.isEmpty()) {
+            qWarning("QTDIR and(or) QTDIR_INC environment variables not set. This may cause problems with finding the necessary include files.");
+        } else {
+            if (qtdir_inc.isEmpty())
+                qtdir_inc = qtdir + "/include";
+            includes << (qtdir_inc + "/QtXml");
+            includes << (qtdir_inc + "/QtNetwork");
+            includes << (qtdir_inc + "/QtCore");
+            includes << (qtdir_inc + "/QtGui");
+            includes << (qtdir_inc + "/QtOpenGL");
+            includes << qtdir_inc;
+        }
+
+
+        foreach (QString include, includes)
+            preprocess.push_include_path(QDir::convertSeparators(include).toStdString());
+
+        QString currentDir = QDir::current().absolutePath();
+        QFileInfo sourceInfo(sourceFile);
+        QDir::setCurrent(sourceInfo.absolutePath());
+
+        std::string result;
+        result.reserve (20 * 1024); // 20K
+
+        result += "# 1 \"builtins\"\n";
+        result += "# 1 \"";
+        result += sourceFile.toStdString();
+        result += "\"\n";
+
+        preprocess.file (sourceInfo.fileName().toStdString(),
+                         rpp::pp_output_iterator<std::string> (result));
+
+        QDir::setCurrent(currentDir);
+
+        QFile f(targetFile);
+        if (!f.open(QIODevice::WriteOnly | QIODevice::Text)) {
+            fprintf(stderr, "Failed to write preprocessed file: %s\n", qPrintable(targetFile));
+        }
+        f.write(result.c_str(), result.length());
+
+        return true;
+    }
+};
+
+#endif // MAIN_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/merge.xsl	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,86 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                version="1.0">
+  <xsl:output method="xml" indent="yes"/>
+  <xsl:param name="lang" />
+  <xsl:param name="source" />
+
+  <xsl:template match="processing-instruction()" />
+
+  <xsl:template match="/typesystem">
+    <xsl:copy>
+      <xsl:for-each select="@*">
+        <xsl:copy>
+          <xsl:value-of select="." />
+        </xsl:copy>
+      </xsl:for-each>
+
+      <xsl:for-each select="document($source)/typesystem/@*">
+        <xsl:copy>
+          <xsl:value-of select="." />
+        </xsl:copy>
+      </xsl:for-each>
+
+      <xsl:variable name="other" select="document($source)/typesystem/*[not(self::object-type | self::value-type | self::interface-type | self::namespace-type)]" />
+      <xsl:if test="$other">
+          <xsl:choose>
+          <xsl:when test="$lang != ''">
+            <xsl:element name="language">
+              <xsl:attribute name="name" ><xsl:value-of select="$lang" /></xsl:attribute>
+              <xsl:copy-of select="$other" />
+            </xsl:element>
+          </xsl:when>
+          <xsl:otherwise>
+             <xsl:copy-of select="$other" />
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:if>
+
+      <xsl:apply-templates select="node()" />
+
+    </xsl:copy>
+  </xsl:template>
+
+
+
+  <xsl:template match="/typesystem/*[self::object-type | self::value-type | self::interface-type | self::namespace-type]">
+    <xsl:variable name="name" select="name()" />
+    <xsl:variable name="other" select="document($source)/typesystem/*[name() = $name][@name = current()/@name]" />
+    <xsl:copy>
+      <xsl:for-each select="@*">
+        <xsl:copy>
+          <xsl:value-of select="." />
+        </xsl:copy>
+      </xsl:for-each>
+      <xsl:for-each select="$other/@*">
+        <xsl:copy>
+          <xsl:value-of select="." />
+        </xsl:copy>
+      </xsl:for-each>
+
+      <xsl:apply-templates select="node()" />
+      <xsl:if test="$other">
+        <xsl:choose>
+          <xsl:when test="$lang != ''">
+          <xsl:element name="language">
+            <xsl:attribute name="name" ><xsl:value-of select="$lang" /></xsl:attribute>
+            <xsl:copy-of select="$other/node()" />
+          </xsl:element>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:copy-of select="$other/node()" />
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:if>
+    </xsl:copy>
+  </xsl:template>
+
+  <!-- Plain identity transform. -->
+  <xsl:template match="@*|node()">
+    <xsl:copy>
+      <xsl:apply-templates select="@*"/>
+      <xsl:apply-templates select="node()"/>
+    </xsl:copy>
+  </xsl:template>
+
+</xsl:stylesheet>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/metainfogenerator.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,808 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#include "metainfogenerator.h"
+#include "reporthandler.h"
+#include "cppimplgenerator.h"
+#include "fileout.h"
+
+#include <QDir>
+#include <QMetaType>
+
+MetaInfoGenerator::MetaInfoGenerator(PriGenerator *pri):
+    DGenerator(),
+    priGenerator(pri)
+
+{
+    setFilenameStub("metainfo");
+}
+
+QString MetaInfoGenerator::subDirectoryForPackage(const QString &package, OutputDirectoryType type) const
+{
+    switch (type) {
+    case CppDirectory:
+        return "cpp/" + QString(package).replace(".", "_") + "/";
+    case JavaDirectory:
+        return QString(package).replace(".", "/");
+    default:
+        return QString(); // kill nonsense warnings
+    }
+}
+
+QString MetaInfoGenerator::subDirectoryForClass(const AbstractMetaClass *cls, OutputDirectoryType type) const
+{
+    Q_ASSERT(cls);
+    return subDirectoryForPackage(cls->package(), type);
+}
+
+void MetaInfoGenerator::generate()
+{
+    buildSkipList();
+    writeCppFile();
+    writeHeaderFile();
+    writeLibraryInitializers();
+}
+
+bool MetaInfoGenerator::shouldGenerate(const TypeEntry *entry) const
+{
+    return entry != 0 && !entry->isNamespace() && !entry->isEnum() && (entry->codeGeneration() & TypeEntry::GenerateCpp);
+}
+
+bool MetaInfoGenerator::shouldGenerate(const AbstractMetaClass *cls) const
+{
+    return (!cls->isInterface() && cls->typeEntry()->isValue() && !cls->isNamespace()
+            && !cls->isAbstract() && (cls->typeEntry()->codeGeneration() & TypeEntry::GenerateCpp));
+}
+
+QString MetaInfoGenerator::fileNameForClass(const AbstractMetaClass *) const
+{
+    return filenameStub() + ".cpp";
+}
+
+void MetaInfoGenerator::write(QTextStream &, const AbstractMetaClass *)
+{
+    // not used
+}
+
+bool MetaInfoGenerator::generated(const AbstractMetaClass *cls) const
+{
+    return generatedMetaInfo(cls->package());
+}
+
+bool MetaInfoGenerator::generatedMetaInfo(const QString &package) const
+{
+    return (m_skip_list.value(package, 0x0) & GeneratedMetaInfo);
+}
+
+bool MetaInfoGenerator::generatedJavaClasses(const QString &package) const
+{
+    return (m_skip_list.value(package, 0x0) & GeneratedJavaClasses);
+}
+
+static void metainfo_write_name_list(QTextStream &s, const char *var_name, const QList<QString> &strs,
+                                     int offset, int skip)
+{
+    s << "static const char *" << var_name << "[] = {" << endl;
+    for (int i=offset; i<strs.size(); i += skip) {
+        s << "    \"" << strs.at(i).toLatin1() << "\"";
+        if (i < strs.size() - 1)
+            s << ",";
+        s << endl;
+    }
+    s << "};" << endl << endl;
+}
+
+void MetaInfoGenerator::writeEnums(QTextStream &s, const QString &package)
+{
+    TypeEntryHash entries = TypeDatabase::instance()->allEntries();
+    TypeEntryHash::iterator it;
+
+    QList<QString> strs;
+    for (it=entries.begin(); it!=entries.end(); ++it) {
+        QList<TypeEntry *> entries = it.value();
+        foreach (TypeEntry *entry, entries) {
+            if ((entry->isFlags() || entry->isEnum()) && entry->javaPackage() == package) {
+                EnumTypeEntry *eentry = entry->isEnum() ? static_cast<EnumTypeEntry *>(entry) : static_cast<FlagsTypeEntry *>(entry)->originator();
+
+                // The Qt flags names should map to the enum names, this is
+                // required for the designer plugin to find the enum type of
+                // a flags type since this functionality is not available in
+                // Qt. This may be a little bit inconsistent, but it saves
+                // us making yet another hash table for lookups. If it causes
+                // problems, make a new one for this particular purpose.
+                strs.append((eentry->javaPackage().isEmpty() ? QString() : eentry->javaPackage().replace('.', '/')  + "/")
+                            + eentry->javaQualifier() + "$" + eentry->targetLangName());
+                strs.append(entry->isFlags() ? static_cast<FlagsTypeEntry *>(entry)->originalName() : entry->qualifiedCppName());
+            }
+        }
+    }
+
+    Q_ASSERT(strs.size() % 2 == 0);
+
+    s << "static int enum_count = " << (strs.size() / 2) << ";" << endl;
+    if (strs.size() > 0) {
+        metainfo_write_name_list(s, "enumJavaNames", strs, 0, 2);
+        metainfo_write_name_list(s, "enumCppNames", strs, 1, 2);
+    } else {
+        s << "static const char **enumCppNames = 0;" << endl
+          << "static const char **enumJavaNames = 0;" << endl;
+    }
+}
+
+void MetaInfoGenerator::writeSignalsAndSlots(QTextStream &s, const QString &package)
+{
+    AbstractMetaClassList classes = this->classes();
+
+    QList<QString> strs;
+    foreach (AbstractMetaClass *cls, classes) {
+        if (cls->package() == package) {
+            AbstractMetaFunctionList functions = cls->functions();
+            foreach (AbstractMetaFunction *f, functions) {
+                if (f->implementingClass() == cls && (f->isSignal() || f->isSlot())) {
+
+                    AbstractMetaArgumentList arguments = f->arguments();
+                    int numOverloads = arguments.size();
+                    for (int i=arguments.size()-1; i>=0; --i) {
+                        if (arguments.at(i)->defaultValueExpression().isEmpty()) {
+                            numOverloads = arguments.size() - i - 1;
+                            break;
+                        }
+                    }
+
+                    for (int i=0; i<=numOverloads; ++i) {
+                        Option option = Option(SkipAttributes | SkipReturnType | SkipName);
+                        QString qtName;
+                        {
+
+                            QTextStream qtNameStream(&qtName);
+                            CppGenerator::writeFunctionSignature(qtNameStream, f, 0, QString(),
+                                Option(option | OriginalName | NormalizeAndFixTypeSignature | OriginalTypeDescription),
+                                QString(), QStringList(), arguments.size() - i);
+                        }
+                        qtName = f->implementingClass()->qualifiedCppName() + "::" + qtName;
+                        qtName = QMetaObject::normalizedSignature(qtName.toLatin1().constData());
+
+                        QString javaFunctionName = functionSignature(f, 0, 0, option, arguments.size() - (f->isSignal() ? 0 : i));
+                        QString javaObjectName = f->isSignal()
+                                                ? f->name()
+                                                : javaFunctionName;
+
+                        javaFunctionName = f->implementingClass()->fullName() + "." + javaFunctionName;
+                        javaObjectName   = f->implementingClass()->fullName() + "." + javaObjectName;
+
+                        QString javaSignature = "(";
+                        for (int j=0; j < (arguments.size() - (f->isSignal() ? 0 : i)); ++j)  {
+                            AbstractMetaArgument *arg = arguments.at(j);
+                            javaSignature += jni_signature(arg->type(), SlashesAndStuff);
+                        }
+                        javaSignature += ")" + jni_signature(f->type(), SlashesAndStuff);
+
+                        strs.append(qtName);
+                        strs.append(javaFunctionName);
+                        strs.append(javaObjectName);
+                        strs.append(javaSignature);
+                    }
+                }
+            }
+        }
+    }
+
+    Q_ASSERT(strs.size() % 4 == 0);
+
+    s << "static int sns_count = " << (strs.size() / 4) << ";" << endl;
+    if (strs.size() > 0) {
+        metainfo_write_name_list(s, "qtNames", strs, 0, 4);
+        metainfo_write_name_list(s, "javaFunctionNames", strs, 1, 4);
+        metainfo_write_name_list(s, "javaObjectNames", strs, 2, 4);
+        metainfo_write_name_list(s, "javaSignatures", strs, 3, 4);
+    } else {
+        s << "static const char **qtNames = 0;" << endl
+          << "static const char **javaFunctionNames = 0;" << endl
+          << "static const char **javaObjectNames = 0;" << endl
+          << "static const char **javaSignatures = 0;" << endl;
+    }
+}
+
+void MetaInfoGenerator::writeRegisterSignalsAndSlots(QTextStream &s)
+{
+    s << "    for (int i=0;i<sns_count; ++i) {" << endl
+      << "        registerQtToJava(qtNames[i], javaFunctionNames[i]);" << endl
+      << "        if (getQtName(javaObjectNames[i]).length() < QByteArray(qtNames[i]).size())" << endl
+      << "            registerJavaToQt(javaObjectNames[i], qtNames[i]);" << endl
+      << "        registerJavaSignature(qtNames[i], javaSignatures[i]);" << endl
+      << "    }" << endl;
+}
+
+void MetaInfoGenerator::writeRegisterEnums(QTextStream &s)
+{
+    s << "    for (int i=0;i<enum_count; ++i) {" << endl
+      << "        registerQtToJava(enumCppNames[i], enumJavaNames[i]);" << endl
+      << "        registerJavaToQt(enumJavaNames[i], enumCppNames[i]);" << endl
+      << "    }" << endl;
+}
+
+void MetaInfoGenerator::buildSkipList()
+{
+    AbstractMetaClassList classList = classes();
+    foreach (AbstractMetaClass *cls, classList) {
+        if (!m_skip_list.contains(cls->package()))
+            m_skip_list[cls->package()] = 0x0;
+
+        if (cls->typeEntry()->codeGeneration() & TypeEntry::GenerateCpp)
+            m_skip_list[cls->package()] |= GeneratedMetaInfo;
+
+        if (cls->typeEntry()->codeGeneration() & TypeEntry::GenerateTargetLang)
+            m_skip_list[cls->package()] |= GeneratedJavaClasses;
+    }
+}
+
+QStringList MetaInfoGenerator::writePolymorphicHandler(QTextStream &s, const QString &package,
+                                                       const AbstractMetaClassList &classes)
+{
+    QStringList handlers;
+    foreach (AbstractMetaClass *cls, classes) {
+        const ComplexTypeEntry *centry = cls->typeEntry();
+        if (!centry->isPolymorphicBase())
+            continue;
+
+        AbstractMetaClassList classList = this->classes();
+        bool first = true;
+        foreach (AbstractMetaClass *clazz, classList) {
+            if (clazz->package() == package && clazz->inheritsFrom(cls)) {
+                if (!clazz->typeEntry()->polymorphicIdValue().isEmpty()) {
+                    // On first find, open the function
+                    if (first) {
+                        first = false;
+
+                        QString handler = jni_signature(cls->fullName(), Underscores);
+                        handlers.append(handler);
+
+                        s << "static bool polymorphichandler_" << handler
+                          << "(const void *ptr, char **class_name, char **package)" << endl
+                          << "{" << endl
+                          << "    Q_ASSERT(ptr != 0);" << endl
+                          << "    " << cls->qualifiedCppName() << " *object = ("
+                          << cls->qualifiedCppName() << " *)ptr;" << endl;
+                    }
+
+                    // For each, add case label
+                    s << "    if ("
+                      << clazz->typeEntry()->polymorphicIdValue().replace("%1", "object")
+                      << ") {" << endl
+                      << "        *class_name = \"" << clazz->name() << "\";" << endl
+                      << "        *package    = \"" << clazz->package().replace(".", "/") << "/\";" << endl
+                      << "        return true;" << endl
+                      << "    }" << endl;
+                } else {
+                    QString warning = QString("class '%1' inherits from polymorphic class '%2', but has no polymorphic id set")
+                        .arg(clazz->name())
+                        .arg(cls->name());
+
+                    ReportHandler::warning(warning);
+                }
+            }
+        }
+
+        // Close the function if it has been opened
+        if (!first) {
+            s << "    return false;" << endl
+              << "}" << endl;
+        }
+    }
+
+    return handlers;
+}
+
+#if defined(QTJAMBI_DEBUG_TOOLS)
+void MetaInfoGenerator::writeNameLiteral(QTextStream &s, const TypeEntry *entry, const QString &fileName)
+{
+    static QSet<QString> used;
+
+    if (!used.contains(fileName + ":" + entry->name())) {
+        s << "char __name_" << QString(entry->name()).replace(':', '_').replace(' ', '_') << "[] = \"" << entry->name() << "\";" << endl;
+        used.insert(fileName + ":" + entry->name());
+    }
+}
+#endif
+
+void MetaInfoGenerator::writeCppFile()
+{
+    TypeEntryHash entries = TypeDatabase::instance()->allEntries();
+    TypeEntryHash::iterator it;
+
+    AbstractMetaClassList classes_with_polymorphic_id;
+    AbstractMetaClassList classList = classes();
+    QHash<QString, FileOut *> fileHash;
+
+    // Seems continue is not supported by our foreach loop, so
+    foreach (AbstractMetaClass *cls, classList) {
+
+        FileOut *f = fileHash.value(cls->package(), 0);
+        if (f == 0 && generated(cls)) {
+            f = new FileOut(outputDirectory() + "/" + subDirectoryForClass(cls, CppDirectory) + "/" + cppFilename());
+
+            writeIncludeStatements(f->stream, classList, cls->package());
+            f->stream << endl;
+
+#if defined(QTJAMBI_DEBUG_TOOLS)
+            // Write the generic destructors and constructors
+            f->stream << "template <typename T, const char *NAME>" << endl
+                        << "void genericDestructor(void *t)" << endl
+                        << "{" << endl
+                        << "    delete (T *) t;" << endl
+                        << "    qtjambi_increase_destructorFunctionCalledCount(QString::fromLatin1(NAME));" << endl
+                        << "}" << endl << endl
+                        << "template <typename T>" << endl
+                        << "void *genericConstructor(const void *t)" << endl
+                        << "{" << endl
+                        << "    if (!t)" << endl
+                        << "        return new T;" << endl
+                        << "    return new T(*reinterpret_cast<const T *>(t));" << endl
+                        << "}" << endl;
+#endif
+
+
+            fileHash.insert(cls->package(), f);
+
+            QString pro_file_name = cls->package().replace(".", "_") + "/" + cls->package().replace(".", "_") + ".pri";
+            priGenerator->addSource(pro_file_name, cppFilename());
+        }
+
+        if (!(cls->attributes() & AbstractMetaAttributes::Fake)) {
+            if (f != 0) {
+                if (cls->typeEntry()->isObject()
+                    && !cls->typeEntry()->isQObject()
+                    && !cls->isInterface()) {
+                    writeDestructors(f->stream, cls);
+                }
+                writeCustomStructors(f->stream, cls->typeEntry());
+            }
+
+            if (cls->typeEntry()->isPolymorphicBase())
+                classes_with_polymorphic_id.append(cls);
+        }
+
+#if defined(QTJAMBI_DEBUG_TOOLS)
+        if (cls->typeEntry()->isValue() && shouldGenerate(cls->typeEntry()))
+            writeNameLiteral(f->stream, cls->typeEntry(), f->name());
+#endif
+    }
+
+    QHash<QString, QStringList> handlers_to_register;
+    foreach (QString package, fileHash.keys()) {
+        FileOut *f = fileHash.value(package, 0);
+        if (f != 0) {
+            writeSignalsAndSlots(f->stream, package);
+            writeEnums(f->stream, package);
+            handlers_to_register[package] = writePolymorphicHandler(f->stream, package, classes_with_polymorphic_id);
+        }
+    }
+
+    // Primitive types must be added to all packages, in case the other packages are
+    // not referenced from the generated code.
+    foreach (FileOut *f, fileHash.values()) {
+        for (it=entries.begin(); it!=entries.end(); ++it) {
+            QList<TypeEntry *> entries = it.value();
+            foreach (TypeEntry *entry, entries) {
+                if (shouldGenerate(entry) && entry->isPrimitive()) {
+                    writeCustomStructors(f->stream, entry);
+#if defined(QTJAMBI_DEBUG_TOOLS)
+                    writeNameLiteral(f->stream, entry, f->name());
+#endif
+                }
+            }
+        }
+
+        // Initialization function: Registers meta types
+        writeInitializationFunctionName(f->stream, fileHash.key(f, ""), true);
+        f->stream << endl << "{" << endl;
+        for (it=entries.begin(); it!=entries.end(); ++it) {
+            QList<TypeEntry *> entries = it.value();
+            foreach (TypeEntry *entry, entries) {
+                if (entry &&
+                    ( (shouldGenerate(entry) && entry->isPrimitive())
+                    || entry->isString()
+                    || entry->isChar())) {
+                        writeInitialization(f->stream, entry, 0);
+                    }
+            }
+        }
+        writeRegisterSignalsAndSlots(f->stream);
+        writeRegisterEnums(f->stream);
+    }
+
+    foreach (AbstractMetaClass *cls, classList) {
+        FileOut *f = fileHash.value(cls->package(), 0);
+
+        if (f != 0) {
+            writeInitialization(f->stream, cls->typeEntry(), cls, shouldGenerate(cls));
+        }
+    }
+
+    foreach (QString package, fileHash.keys()) {
+        FileOut *f = fileHash.value(package, 0);
+        if (f != 0) {
+            foreach (QString handler, handlers_to_register.value(package, QStringList())) {
+                f->stream << "    qtjambi_register_polymorphic_id(\"" << handler << "\","
+                         << "polymorphichandler_" << handler << ");" << endl;
+            }
+
+            f->stream << "}" << endl << endl;
+            if( f->done() )
+                ++m_num_generated_written;
+            ++m_num_generated;
+
+            delete f;
+        }
+    }
+}
+
+void MetaInfoGenerator::writeHeaderFile()
+{
+    AbstractMetaClassList classList = classes();
+    QHash<QString, bool> fileHash;
+
+    foreach (AbstractMetaClass *cls, classList) {
+        bool hasGenerated = fileHash.value(cls->package(), false);
+        if (!hasGenerated && generated(cls)) {
+            FileOut file(outputDirectory() + "/" + subDirectoryForClass(cls, CppDirectory) + "/" + headerFilename());
+            file.stream << "#ifndef " << filenameStub().toUpper() << "_H" << endl;
+            file.stream << "#define " << filenameStub().toUpper() << "_H" << endl << endl;
+            writeInitializationFunctionName(file.stream, cls->package(), true);
+            file.stream << ";" << endl << "#endif" << endl << endl;
+
+            fileHash.insert(cls->package(), true);
+
+            QString pro_file_name = cls->package().replace(".", "_") + "/" + cls->package().replace(".", "_") + ".pri";
+            priGenerator->addHeader(pro_file_name, headerFilename());
+
+            if( file.done() )
+                ++m_num_generated_written;
+            ++m_num_generated;
+        }
+    }
+}
+
+void MetaInfoGenerator::writeCodeBlock(QTextStream &s, const QString &code)
+{
+    QStringList lines = code.split('\n');
+    QString indent;
+    foreach (QString str, lines) {
+        s << "    " << indent << str.trimmed() << endl;
+        if (!str.trimmed().endsWith(";") && !str.trimmed().isEmpty())
+            indent = "    ";
+        else
+            indent = "";
+    }
+}
+
+const AbstractMetaClass* MetaInfoGenerator::lookupClassWithPublicDestructor(const AbstractMetaClass *cls)
+{
+    while (cls != 0) {
+        if (cls->hasPublicDestructor()) {
+            return cls;
+        } else {
+            cls = cls->baseClass();
+        }
+    }
+    return 0;
+}
+
+void MetaInfoGenerator::writeDestructors(QTextStream &s, const AbstractMetaClass *cls)
+{
+    // We can only delete classes with public destructors
+    const AbstractMetaClass *clsWithPublicDestructor = lookupClassWithPublicDestructor(cls);
+    if(clsWithPublicDestructor != 0) {
+        const ComplexTypeEntry *entry = cls->typeEntry();
+        if ((entry->codeGeneration() & TypeEntry::GenerateCode) != 0) {
+            s   << "void destructor_" << entry->javaPackage().replace(".", "_")  << "_"
+                << entry->lookupName().replace(".", "_").replace("$", "_") << "(void *ptr)" << endl
+                << "{" << endl
+                << "    delete reinterpret_cast<" << clsWithPublicDestructor->qualifiedCppName() << " *>(ptr);" << endl;
+
+#if defined(QTJAMBI_DEBUG_TOOLS)
+            s   << "    qtjambi_increase_destructorFunctionCalledCount(QString::fromLatin1(\"" << cls->name() << "\"));" << endl;
+#endif
+
+            s   << "}" << endl << endl;
+        }
+    }
+}
+
+void MetaInfoGenerator::writeCustomStructors(QTextStream &s, const TypeEntry *entry)
+{
+    if (!entry->preferredConversion())
+        return ;
+
+    CustomFunction customConstructor = entry->customConstructor();
+    CustomFunction customDestructor = entry->customDestructor();
+
+    if (!customConstructor.name.isEmpty() && !customDestructor.name.isEmpty()) {
+        s << "// Custom constructor and destructor for " << entry->qualifiedCppName() << endl
+          << "static void *" << customConstructor.name << "("
+          << "const " << entry->qualifiedCppName() << " *" << customConstructor.param_name
+          << ")" << endl
+          << "{" << endl;
+        writeCodeBlock(s, customConstructor.code());
+        s << "}" << endl << endl;
+
+        s << "static void " << customDestructor.name << "("
+          << "const " << entry->qualifiedCppName() << " *" << customDestructor.param_name
+          << ")" << endl
+          << "{" << endl;
+        writeCodeBlock(s, customDestructor.code());
+        s << "}" << endl << endl;
+    }
+}
+
+static void generateInitializer(QTextStream &s, const QString &package, CodeSnip::Position pos)
+{
+    QList<CodeSnip> snips =
+        ((TypeSystemTypeEntry *) TypeDatabase::instance()->findType(package))->snips;
+
+    foreach (const CodeSnip &snip, snips)
+        if (snip.position == pos)
+            s << snip.code();
+}
+
+void MetaInfoGenerator::writeLibraryInitializers()
+{
+    // from cppimplgenerator.cpp
+    extern QString jni_function_signature(QString package,
+                                          QString class_name,
+                                          const QString &function_name,
+                                          const QString &return_type,
+                                          const QString &mangled_arguments = QString(),
+                                          uint options = CppImplGenerator::StandardJNISignature);
+
+    // We need to generate a library initializer in Java for all packages
+    // that have generated classes in Java, and in C++ for all packages
+    // that have generated metainfo.
+
+    QList<QString> known_packages = m_skip_list.keys();
+    foreach (QString package, known_packages) {
+        if (generatedMetaInfo(package)) { // write cpp file
+
+            FileOut fileOut(outputDirectory() + "/" + subDirectoryForPackage(package, CppDirectory) + "/qtjambi_libraryinitializer.cpp");
+
+            QString signature = jni_function_signature(package, "QtJambi_LibraryInitializer",
+                                                   "__qt_initLibrary", "void");
+            QTextStream &s = fileOut.stream;
+            s << "#include \"metainfo.h\"" << endl
+              << "#include \"qtjambi_global.h\"" << endl << endl
+              << signature << "(JNIEnv *, jclass)" << endl
+              << "{" << endl
+              << "    ";
+            writeInitializationFunctionName(s, package, false);
+            s << ";" << endl
+              << "}" << endl << endl;
+
+            QString pro_file_name = QString(package).replace(".", "_");
+
+            priGenerator->addSource(pro_file_name + "/" + pro_file_name + ".pri", "qtjambi_libraryinitializer.cpp");
+
+            if( fileOut.done() )
+                ++m_num_generated_written;
+            ++m_num_generated;
+        }
+
+        if (generatedJavaClasses(package)) {
+
+            FileOut fileOut(outputDirectory() + "/" + subDirectoryForPackage(package, JavaDirectory) + "/QtJambi_LibraryInitializer.java");
+
+            QTextStream &s = fileOut.stream;
+            s << "package " << package << ";" << endl << endl
+              << "class QtJambi_LibraryInitializer" << endl
+              << "{" << endl
+              << "    static {" << endl;
+
+            generateInitializer(s, package, CodeSnip::Beginning);
+
+            s << "        qt.Utilities.loadJambiLibrary(\""
+              << QString(package).replace(".", "_") << "\");" << endl;
+
+            if (generatedMetaInfo(package))
+              s << "        __qt_initLibrary();" << endl;
+
+            generateInitializer(s, package, CodeSnip::End);
+
+            s << "    }" << endl;
+
+            if (generatedMetaInfo(package))
+              s << "    private native static void __qt_initLibrary();" << endl;
+
+            s << "    static void init() { };" << endl
+              << "}" << endl << endl;
+
+            if( fileOut.done() )
+                ++m_num_generated_written;
+            ++m_num_generated;
+        }
+    }
+}
+
+void MetaInfoGenerator::writeInclude(QTextStream &s, const Include &inc)
+{
+    if (inc.name.isEmpty())
+        return;
+
+    s << "#include ";
+    if (inc.type == Include::LocalPath)
+        s << "\"" << inc.name << "\"";
+    else
+        s << "<" << inc.name << ">";
+    s << endl;
+}
+
+void MetaInfoGenerator::writeIncludeStatements(QTextStream &s, const AbstractMetaClassList &classList,
+                                               const QString &package)
+{
+    writeInclude(s, Include(Include::LocalPath, headerFilename()));
+    writeInclude(s, Include(Include::IncludePath, "QMetaType"));
+    writeInclude(s, Include(Include::IncludePath, "QString"));
+    writeInclude(s, Include(Include::IncludePath, "QLatin1String"));
+    writeInclude(s, Include(Include::IncludePath, "QHash"));
+    writeInclude(s, Include(Include::IncludePath, "QReadWriteLock"));
+    writeInclude(s, Include(Include::IncludePath, "QReadLocker"));
+    writeInclude(s, Include(Include::IncludePath, "QWriteLocker"));
+    writeInclude(s, Include(Include::IncludePath, "qtjambi_cache.h"));
+    writeInclude(s, Include(Include::IncludePath, "qtjambi_core.h"));
+
+#if defined(QTJAMBI_DEBUG_TOOLS)
+    writeInclude(s, Include(Include::IncludePath, "qtjambidebugtools_p.h"));
+#endif
+
+    s << endl;
+
+    foreach (AbstractMetaClass *cls, classList) {
+        if (generated(cls) && !cls->isInterface() && cls->package() == package) {
+            const ComplexTypeEntry *ctype = cls->typeEntry();
+
+            Include inc = ctype->include();
+            writeInclude(s, inc);
+        }
+    }
+}
+
+void MetaInfoGenerator::writeInitializationFunctionName(QTextStream &s, const QString &package, bool fullSignature)
+{
+    if (fullSignature)
+        s << "void ";
+    s << "__metainfo_init_" << QString(package).replace(".", "_") << "()";
+}
+
+void MetaInfoGenerator::writeInitialization(QTextStream &s, const TypeEntry *entry, const AbstractMetaClass *cls,
+                                            bool registerMetaType)
+{
+    if (entry->codeGeneration() == TypeEntry::GenerateForSubclass)
+        return;
+
+    if (cls && cls->attributes() & AbstractMetaAttributes::Fake)
+        return;
+
+
+    QString constructorName = entry->customConstructor().name;
+    QString destructorName = entry->customDestructor().name;
+#if defined(QTJAMBI_DEBUG_TOOLS)
+
+    if (constructorName.isEmpty())
+        constructorName = "genericConstructor<" + entry->qualifiedCppName() + ">";
+
+    if (destructorName.isEmpty())
+        destructorName = "genericDestructor<" + entry->qualifiedCppName() + ", __name_" + entry->name() + ">";
+
+#endif
+
+
+    if (constructorName.isEmpty() != destructorName.isEmpty()) {
+        ReportHandler::warning(QString("specify either no custom functions, or both "
+                                       "constructor and destructor for type '%1'").arg(entry->name()));
+     }
+
+    QString javaPackage = entry->javaPackage();
+
+    QString javaName =  entry->lookupName();
+    if(!javaPackage.isEmpty()){
+        javaName.prepend(javaPackage.replace(".", "/") + "/");
+    }
+
+
+    if (entry->isComplex()) {
+        const ComplexTypeEntry *centry = static_cast<const ComplexTypeEntry *>(entry);
+        if (centry->typeFlags() & ComplexTypeEntry::DeleteInMainThread)
+            s << "    registerDeletionPolicy(\"" << javaName << "\", DeletionPolicyDeleteInMainThread);" << endl;
+    }
+
+    QString qtName = entry->qualifiedCppName();
+    if ((!entry->isInterface())
+        && (!entry->isPrimitive() || ((PrimitiveTypeEntry *) entry)->preferredTargetLangType()))
+        s << "    registerQtToJava(\"" << qtName << "\", \"" << javaName << "\");" << endl;
+
+    if (!entry->preferredConversion())
+        return ;
+
+    s << "    registerJavaToQt(\"" << javaName << "\", \"" << qtName << "\");" << endl;
+    if (entry->isComplex() && entry->isObject() && !((ComplexTypeEntry *)entry)->isQObject() && !entry->isInterface()) {
+        QString patchedName = QString(javaName).replace("/", "_").replace("$", "_");
+
+        if(lookupClassWithPublicDestructor(cls))
+            s << "    registerDestructor(\"" << javaName << "\", destructor_" << patchedName << ");" << endl;
+    }
+
+    if (!registerMetaType)
+        return ;
+
+    int metaType = QMetaType::type(entry->name().toLocal8Bit().constData());
+    if (metaType != QMetaType::Void)
+        return ;
+
+
+    if (!constructorName.isEmpty() && !destructorName.isEmpty()) {
+        s << "    QMetaType::registerType(\"" << entry->qualifiedCppName() << "\"," << endl
+          << "                            reinterpret_cast<QMetaType::Destructor>("
+          << destructorName
+          << ")," << endl
+          << "                            reinterpret_cast<QMetaType::Constructor>("
+          << constructorName
+          << "));" << endl;
+    } else {
+        // Look for default constructor, required for qRegisterMetaType
+        if (cls != 0) {
+            AbstractMetaFunctionList functions = cls->queryFunctions(AbstractMetaClass::WasPublic | AbstractMetaClass::Constructors);
+
+            bool hasDefaultConstructor = false;
+            foreach (AbstractMetaFunction *function, functions) {
+                // Default constructor has to be present
+                if (function->wasPublic() && function->actualMinimumArgumentCount() == 0)
+                    hasDefaultConstructor = true;
+            }
+
+            if (!hasDefaultConstructor) {
+                ReportHandler::warning(QString("Value type '%1' is missing a default constructor. "
+                                       "The resulting C++ code will not compile. If necessary, use <custom-constructor> and "
+                                       "<custom-destructor> tags to provide the constructors.").arg(cls->fullName()));
+            }
+
+        }
+        s << "    qRegisterMetaType<" << entry->qualifiedCppName() << ">(\"" << entry->qualifiedCppName() << "\");" << endl;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/metainfogenerator.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,117 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+*
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#ifndef METAINFOGENERATOR_H
+#define METAINFOGENERATOR_H
+
+#include "generator.h"
+#include "dgenerator.h"
+#include "cppgenerator.h"
+
+class MetaInfoGenerator : public DGenerator
+{
+public:
+    MetaInfoGenerator(PriGenerator *pri);
+
+    enum GenerationFlags {
+        GeneratedJavaClasses = 0x1,
+        GeneratedMetaInfo = 0x2
+    };
+
+    enum OutputDirectoryType {
+        CppDirectory,
+        JavaDirectory
+    };
+
+    MetaInfoGenerator();
+
+    virtual void generate();
+    virtual QString fileNameForClass(const AbstractMetaClass *java_class) const;
+    virtual void write(QTextStream &s, const AbstractMetaClass *java_class);
+
+    void setFilenameStub(const QString &stub) { m_filenameStub = stub; }
+    QString filenameStub() const { return m_filenameStub; }
+
+    QString headerFilename() const { return filenameStub() + ".h"; }
+    QString cppFilename() const { return filenameStub() + ".cpp"; }
+
+    virtual QString subDirectoryForClass(const AbstractMetaClass *, OutputDirectoryType type) const;
+    virtual QString subDirectoryForPackage(const QString &package, OutputDirectoryType type) const;
+    virtual bool shouldGenerate(const AbstractMetaClass *) const;
+
+    bool generated(const AbstractMetaClass *cls) const;
+    bool generatedJavaClasses(const QString &package) const;
+    bool generatedMetaInfo(const QString &package) const;
+
+private:
+    void writeCppFile();
+    void writeHeaderFile();
+    void writeLibraryInitializers();
+    void writeInclude(QTextStream &s, const Include &inc);
+    void writeIncludeStatements(QTextStream &s, const AbstractMetaClassList &classList, const QString &package);
+    void writeInitializationFunctionName(QTextStream &s, const QString &package, bool fullSignature);
+    void writeInitialization(QTextStream &s, const TypeEntry *entry, const AbstractMetaClass *cls, bool registerMetaType = true);
+    void writeCustomStructors(QTextStream &s, const TypeEntry *entry);
+    void writeDestructors(QTextStream &s, const AbstractMetaClass *cls);
+    void writeCodeBlock(QTextStream &s, const QString &code);
+    void writeSignalsAndSlots(QTextStream &s, const QString &package);
+    void writeEnums(QTextStream &s, const QString &package);
+    void writeRegisterSignalsAndSlots(QTextStream &s);
+    void writeRegisterEnums(QTextStream &s);
+    QStringList writePolymorphicHandler(QTextStream &s, const QString &package, const AbstractMetaClassList &clss);
+    bool shouldGenerate(const TypeEntry *entry) const;
+    void buildSkipList();
+
+#if defined(QTJAMBI_DEBUG_TOOLS)
+    void writeNameLiteral(QTextStream &, const TypeEntry *, const QString &fileName);
+#endif
+
+    QHash<QString, int> m_skip_list;
+    QString m_filenameStub;
+
+    QHash<OutputDirectoryType, QString> m_out_dir;
+
+    const AbstractMetaClass* lookupClassWithPublicDestructor(const AbstractMetaClass *cls);
+
+    PriGenerator *priGenerator;
+};
+
+#endif // METAINFOGENERATOR_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/metajava.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,42 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#include "metajava.h"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/metajava.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#ifndef METAJAVA_H
+#define METAJAVA_H
+
+#include "abstractmetalang.h"
+
+class MetaJavaClass;
+class MetaJavaField;
+class MetaJavaFunction;
+class MetaJavaType;
+class MetaJavaVariable;
+class MetaJavaArgument;
+class MetaJavaEnumValue;
+class MetaJavaEnum;
+
+
+
+class MetaJavaType : public AbstractMetaType
+{};
+
+class MetaJavaArgument : public AbstractMetaArgument
+{};
+
+class MetaJavaField : public AbstractMetaField
+{};
+
+class MetaJavaFunction : public AbstractMetaFunction
+{};
+
+class MetaJavaEnumValue : public AbstractMetaEnumValue
+{};
+
+class MetaJavaEnum : public AbstractMetaEnum
+{};
+
+class MetaJavaClass : public AbstractMetaClass
+{};
+
+#endif // METAJAVA_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/metajavabuilder.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#include "metajavabuilder.h"
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/metajavabuilder.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,89 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#ifndef METAJAVABUILDER_H
+#define METAJAVABUILDER_H
+
+#include "abstractmetabuilder.h"
+#include "metajava.h"
+
+class MetaJavaBuilder : public AbstractMetaBuilder
+{
+
+ protected:
+    virtual MetaJavaClass *createMetaClass()
+        {
+            return new MetaJavaClass();
+        };
+
+    virtual MetaJavaEnum *createMetaEnum()
+        {
+            return new MetaJavaEnum();
+        };
+
+    virtual MetaJavaEnumValue *createMetaEnumValue()
+        {
+            return new MetaJavaEnumValue();
+        };
+
+    virtual MetaJavaField *createMetaField()
+        {
+            return new MetaJavaField();
+        };
+
+    virtual MetaJavaFunction *createMetaFunction()
+        {
+            return new MetaJavaFunction();
+        };
+
+    virtual MetaJavaArgument *createMetaArgument()
+        {
+            return new MetaJavaArgument();
+        };
+
+    virtual MetaJavaType *createMetaType()
+        {
+            return new MetaJavaType();
+        };
+
+};
+
+#endif // METAJAVABUILDER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/ast.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,53 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+** Copyright (C) 2002-2005 Roberto Raggi <roberto@kdevelop.org>
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#include "ast.h"
+#include "lexer.h"
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
+
+QString AST::toString(TokenStream *stream) const
+{
+    const Token &tk = stream->token((int) start_token);
+    const Token &end_tk = stream->token ((int) end_token);
+    return QString::fromLatin1(tk.text + tk.position, end_tk.position - tk.position);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/ast.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,900 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+** Copyright (C) 2002-2005 Roberto Raggi <roberto@kdevelop.org>
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+
+#ifndef AST_H
+#define AST_H
+
+#include "smallobject.h"
+#include "list.h"
+
+class QString;
+
+#define DECLARE_AST_NODE(k) \
+    enum { __node_kind = Kind_##k };
+
+class TokenStream;
+
+struct AccessSpecifierAST;
+struct AsmDefinitionAST;
+struct BaseClauseAST;
+struct BaseSpecifierAST;
+struct BinaryExpressionAST;
+struct CastExpressionAST;
+struct ClassMemberAccessAST;
+struct ClassSpecifierAST;
+struct CompoundStatementAST;
+struct ConditionAST;
+struct ConditionalExpressionAST;
+struct CppCastExpressionAST;
+struct CtorInitializerAST;
+struct DeclarationAST;
+struct DeclarationStatementAST;
+struct DeclaratorAST;
+struct DeleteExpressionAST;
+struct DoStatementAST;
+struct ElaboratedTypeSpecifierAST;
+struct EnumSpecifierAST;
+struct EnumeratorAST;
+struct ExceptionSpecificationAST;
+struct ExpressionAST;
+struct ExpressionOrDeclarationStatementAST;
+struct ExpressionStatementAST;
+struct ForStatementAST;
+struct FunctionCallAST;
+struct FunctionDefinitionAST;
+struct IfStatementAST;
+struct IncrDecrExpressionAST;
+struct InitDeclaratorAST;
+struct InitializerAST;
+struct InitializerClauseAST;
+struct LabeledStatementAST;
+struct LinkageBodyAST;
+struct LinkageSpecificationAST;
+struct MemInitializerAST;
+struct NameAST;
+struct NamespaceAST;
+struct NamespaceAliasDefinitionAST;
+struct NewDeclaratorAST;
+struct NewExpressionAST;
+struct NewInitializerAST;
+struct NewTypeIdAST;
+struct OperatorAST;
+struct OperatorFunctionIdAST;
+struct ParameterDeclarationAST;
+struct ParameterDeclarationClauseAST;
+struct PostfixExpressionAST;
+struct PrimaryExpressionAST;
+struct PtrOperatorAST;
+struct PtrToMemberAST;
+struct ReturnStatementAST;
+struct SimpleDeclarationAST;
+struct SimpleTypeSpecifierAST;
+struct SizeofExpressionAST;
+struct StatementAST;
+struct StringLiteralAST;
+struct SubscriptExpressionAST;
+struct SwitchStatementAST;
+struct TemplateArgumentAST;
+struct TemplateDeclarationAST;
+struct TemplateParameterAST;
+struct ThrowExpressionAST;
+struct TranslationUnitAST;
+struct TryBlockStatementAST;
+struct TypeIdAST;
+struct TypeIdentificationAST;
+struct TypeParameterAST;
+struct TypeSpecifierAST;
+struct TypedefAST;
+struct UnaryExpressionAST;
+struct UnqualifiedNameAST;
+struct UsingAST;
+struct UsingDirectiveAST;
+struct WhileStatementAST;
+struct WinDeclSpecAST;
+struct QPropertyAST;
+struct QEnumsAST;
+
+struct AST
+{
+  enum NODE_KIND
+    {
+      Kind_UNKNOWN = 0,
+
+      Kind_AccessSpecifier,
+      Kind_AsmDefinition,
+      Kind_BaseClause,
+      Kind_BaseSpecifier,
+      Kind_BinaryExpression,
+      Kind_CastExpression,
+      Kind_ClassMemberAccess,
+      Kind_ClassSpecifier,
+      Kind_CompoundStatement,
+      Kind_Condition,
+      Kind_ConditionalExpression,
+      Kind_CppCastExpression,
+      Kind_CtorInitializer,
+      Kind_DeclarationStatement,
+      Kind_Declarator,
+      Kind_DeleteExpression,
+      Kind_DoStatement,
+      Kind_ElaboratedTypeSpecifier,
+      Kind_EnumSpecifier,
+      Kind_Enumerator,
+      Kind_ExceptionSpecification,
+      Kind_ExpressionOrDeclarationStatement,
+      Kind_ExpressionStatement,
+      Kind_ForStatement,
+      Kind_FunctionCall,
+      Kind_FunctionDefinition,
+      Kind_IfStatement,
+      Kind_IncrDecrExpression,
+      Kind_InitDeclarator,
+      Kind_Initializer,
+      Kind_InitializerClause,
+      Kind_LabeledStatement,
+      Kind_LinkageBody,
+      Kind_LinkageSpecification,
+      Kind_MemInitializer,
+      Kind_Name,
+      Kind_Namespace,
+      Kind_NamespaceAliasDefinition,
+      Kind_NewDeclarator,
+      Kind_NewExpression,
+      Kind_NewInitializer,
+      Kind_NewTypeId,
+      Kind_Operator,
+      Kind_OperatorFunctionId,
+      Kind_ParameterDeclaration,
+      Kind_ParameterDeclarationClause,
+      Kind_PostfixExpression,
+      Kind_PrimaryExpression,
+      Kind_PtrOperator,
+      Kind_PtrToMember,
+      Kind_ReturnStatement,
+      Kind_SimpleDeclaration,
+      Kind_SimpleTypeSpecifier,
+      Kind_SizeofExpression,
+      Kind_StringLiteral,
+      Kind_SubscriptExpression,
+      Kind_SwitchStatement,
+      Kind_TemplateArgument,
+      Kind_TemplateDeclaration,
+      Kind_TemplateParameter,
+      Kind_ThrowExpression,
+      Kind_TranslationUnit,
+      Kind_TryBlockStatement,
+      Kind_TypeId,
+      Kind_TypeIdentification,
+      Kind_TypeParameter,
+      Kind_Typedef,
+      Kind_UnaryExpression,
+      Kind_UnqualifiedName,
+      Kind_Using,
+      Kind_UsingDirective,
+      Kind_WhileStatement,
+      Kind_WinDeclSpec,
+      Kind_QPropertyAST,
+      Kind_ForwardDeclarationSpecifier,
+      Kind_QEnumsAST,
+
+      NODE_KIND_COUNT
+    };
+
+  QString toString(TokenStream *stream) const;
+
+  int kind;
+
+  std::size_t start_token;
+  std::size_t end_token;
+};
+
+struct TypeSpecifierAST: public AST
+{
+  const ListNode<std::size_t> *cv;
+};
+
+struct StatementAST: public AST
+{
+};
+
+struct ExpressionAST: public AST
+{
+};
+
+struct DeclarationAST: public AST
+{
+};
+
+struct AccessSpecifierAST: public DeclarationAST
+{
+  DECLARE_AST_NODE(AccessSpecifier)
+
+  const ListNode<std::size_t> *specs;
+};
+
+struct AsmDefinitionAST: public DeclarationAST
+{
+  DECLARE_AST_NODE(AsmDefinition)
+
+  const ListNode<std::size_t> *cv;
+};
+
+struct BaseClauseAST: public AST // ### kill me
+{
+  DECLARE_AST_NODE(BaseClause)
+
+  const ListNode<BaseSpecifierAST*> *base_specifiers;
+};
+
+struct BaseSpecifierAST: public AST
+{
+  DECLARE_AST_NODE(BaseSpecifier)
+
+  std::size_t virt;
+  std::size_t access_specifier;
+  NameAST *name;
+};
+
+struct BinaryExpressionAST: public ExpressionAST
+{
+  DECLARE_AST_NODE(BinaryExpression)
+
+  std::size_t op;
+  ExpressionAST *left_expression;
+  ExpressionAST *right_expression;
+};
+
+struct CastExpressionAST: public ExpressionAST
+{
+  DECLARE_AST_NODE(CastExpression)
+
+  TypeIdAST *type_id;
+  ExpressionAST *expression;
+};
+
+struct ClassMemberAccessAST: public ExpressionAST
+{
+  DECLARE_AST_NODE(ClassMemberAccess)
+
+  std::size_t op;
+  NameAST *name;
+};
+
+struct ClassSpecifierAST: public TypeSpecifierAST
+{
+  DECLARE_AST_NODE(ClassSpecifier)
+
+  WinDeclSpecAST *win_decl_specifiers;
+  std::size_t class_key;
+  NameAST *name;
+  BaseClauseAST *base_clause;
+  const ListNode<DeclarationAST*> *member_specs;
+};
+
+struct ForwardDeclarationSpecifierAST: public TypeSpecifierAST
+{
+    DECLARE_AST_NODE(ForwardDeclarationSpecifier)
+
+    std::size_t class_key;
+    NameAST *name;
+    BaseClauseAST *base_clause;
+};
+
+struct CompoundStatementAST: public StatementAST
+{
+  DECLARE_AST_NODE(CompoundStatement)
+
+  const ListNode<StatementAST*> *statements;
+};
+
+struct ConditionAST: public AST
+{
+  DECLARE_AST_NODE(Condition)
+
+  TypeSpecifierAST *type_specifier;
+  DeclaratorAST *declarator;
+  ExpressionAST *expression;
+};
+
+struct ConditionalExpressionAST: public ExpressionAST
+{
+  DECLARE_AST_NODE(ConditionalExpression)
+
+  ExpressionAST *condition;
+  ExpressionAST *left_expression;
+  ExpressionAST *right_expression;
+};
+
+struct CppCastExpressionAST: public ExpressionAST
+{
+  DECLARE_AST_NODE(CppCastExpression)
+
+  std::size_t op;
+  TypeIdAST *type_id;
+  ExpressionAST *expression;
+  const ListNode<ExpressionAST*> *sub_expressions;
+};
+
+struct CtorInitializerAST: public AST
+{
+  DECLARE_AST_NODE(CtorInitializer)
+
+  std::size_t colon;
+  const ListNode<MemInitializerAST*> *member_initializers;
+};
+
+struct DeclarationStatementAST: public StatementAST
+{
+  DECLARE_AST_NODE(DeclarationStatement)
+
+  DeclarationAST *declaration;
+};
+
+struct DeclaratorAST: public AST
+{
+  DECLARE_AST_NODE(Declarator)
+
+  const ListNode<PtrOperatorAST*> *ptr_ops;
+  DeclaratorAST *sub_declarator;
+  NameAST *id;
+  ExpressionAST *bit_expression;
+  const ListNode<ExpressionAST*> *array_dimensions;
+  ParameterDeclarationClauseAST *parameter_declaration_clause;
+  const ListNode<std::size_t> *fun_cv;
+  ExceptionSpecificationAST *exception_spec;
+};
+
+struct DeleteExpressionAST: public ExpressionAST
+{
+  DECLARE_AST_NODE(DeleteExpression)
+
+  std::size_t scope_token;
+  std::size_t delete_token;
+  std::size_t lbracket_token;
+  std::size_t rbracket_token;
+  ExpressionAST *expression;
+};
+
+struct DoStatementAST: public StatementAST
+{
+  DECLARE_AST_NODE(DoStatement)
+
+  StatementAST *statement;
+  ExpressionAST *expression;
+};
+
+struct ElaboratedTypeSpecifierAST: public TypeSpecifierAST
+{
+  DECLARE_AST_NODE(ElaboratedTypeSpecifier)
+
+  std::size_t type;
+  NameAST *name;
+};
+
+struct EnumSpecifierAST: public TypeSpecifierAST
+{
+  DECLARE_AST_NODE(EnumSpecifier)
+
+  NameAST *name;
+  const ListNode<EnumeratorAST*> *enumerators;
+};
+
+struct EnumeratorAST: public AST
+{
+  DECLARE_AST_NODE(Enumerator)
+
+  std::size_t id;
+  ExpressionAST *expression;
+};
+
+struct ExceptionSpecificationAST: public AST
+{
+  DECLARE_AST_NODE(ExceptionSpecification)
+
+  std::size_t ellipsis;
+  const ListNode<TypeIdAST*> *type_ids;
+};
+
+struct ExpressionOrDeclarationStatementAST: public StatementAST
+{
+  DECLARE_AST_NODE(ExpressionOrDeclarationStatement)
+
+  StatementAST *expression;
+  StatementAST *declaration;
+};
+
+struct ExpressionStatementAST: public StatementAST
+{
+  DECLARE_AST_NODE(ExpressionStatement)
+
+  ExpressionAST *expression;
+};
+
+struct FunctionCallAST: public ExpressionAST
+{
+  DECLARE_AST_NODE(FunctionCall)
+
+  ExpressionAST *arguments;
+};
+
+struct FunctionDefinitionAST: public DeclarationAST
+{
+  DECLARE_AST_NODE(FunctionDefinition)
+
+  const ListNode<std::size_t> *storage_specifiers;
+  const ListNode<std::size_t> *function_specifiers;
+  TypeSpecifierAST *type_specifier;
+  InitDeclaratorAST *init_declarator;
+  StatementAST *function_body;
+  WinDeclSpecAST *win_decl_specifiers;
+};
+
+struct ForStatementAST: public StatementAST
+{
+  DECLARE_AST_NODE(ForStatement)
+
+  StatementAST *init_statement;
+  ConditionAST *condition;
+  ExpressionAST *expression;
+  StatementAST *statement;
+};
+
+struct IfStatementAST: public StatementAST
+{
+  DECLARE_AST_NODE(IfStatement)
+
+  ConditionAST *condition;
+  StatementAST *statement;
+  StatementAST *else_statement;
+};
+
+struct IncrDecrExpressionAST: public ExpressionAST
+{
+  DECLARE_AST_NODE(IncrDecrExpression)
+
+  std::size_t op;
+};
+
+struct InitDeclaratorAST: public AST
+{
+  DECLARE_AST_NODE(InitDeclarator)
+
+  DeclaratorAST *declarator;
+  InitializerAST *initializer;
+};
+
+struct InitializerAST: public AST
+{
+  DECLARE_AST_NODE(Initializer)
+
+  InitializerClauseAST *initializer_clause;
+  ExpressionAST *expression;
+};
+
+struct InitializerClauseAST: public AST
+{
+  DECLARE_AST_NODE(InitializerClause)
+
+  ExpressionAST *expression;
+};
+
+struct LabeledStatementAST: public StatementAST
+{
+  DECLARE_AST_NODE(LabeledStatement)
+};
+
+struct LinkageBodyAST: public AST
+{
+  DECLARE_AST_NODE(LinkageBody)
+
+  const ListNode<DeclarationAST*> *declarations;
+};
+
+struct LinkageSpecificationAST: public DeclarationAST
+{
+  DECLARE_AST_NODE(LinkageSpecification)
+
+  std::size_t extern_type;
+  LinkageBodyAST *linkage_body;
+  DeclarationAST *declaration;
+};
+
+struct MemInitializerAST: public AST
+{
+  DECLARE_AST_NODE(MemInitializer)
+
+  NameAST *initializer_id;
+  ExpressionAST *expression;
+};
+
+struct NameAST: public AST
+{
+  DECLARE_AST_NODE(Name)
+
+  bool global;
+  const ListNode<UnqualifiedNameAST*> *qualified_names;
+  UnqualifiedNameAST *unqualified_name;
+};
+
+struct NamespaceAST: public DeclarationAST
+{
+  DECLARE_AST_NODE(Namespace)
+
+  std::size_t namespace_name;
+  LinkageBodyAST *linkage_body;
+};
+
+struct NamespaceAliasDefinitionAST: public DeclarationAST
+{
+  DECLARE_AST_NODE(NamespaceAliasDefinition)
+
+  std::size_t namespace_name;
+  NameAST *alias_name;
+};
+
+struct NewDeclaratorAST: public AST
+{
+  DECLARE_AST_NODE(NewDeclarator)
+
+  PtrOperatorAST *ptr_op;
+  NewDeclaratorAST *sub_declarator;
+  const ListNode<ExpressionAST*> *expressions;
+};
+
+struct NewExpressionAST: public ExpressionAST
+{
+  DECLARE_AST_NODE(NewExpression)
+
+  std::size_t scope_token;
+  std::size_t new_token;
+  ExpressionAST *expression;
+  TypeIdAST *type_id;
+  NewTypeIdAST *new_type_id;
+  NewInitializerAST *new_initializer;
+};
+
+struct NewInitializerAST: public AST
+{
+  DECLARE_AST_NODE(NewInitializer)
+
+  ExpressionAST *expression;
+};
+
+struct NewTypeIdAST: public AST
+{
+  DECLARE_AST_NODE(NewTypeId)
+
+  TypeSpecifierAST *type_specifier;
+  NewInitializerAST *new_initializer;
+  NewDeclaratorAST *new_declarator;
+};
+
+struct OperatorAST: public AST
+{
+  DECLARE_AST_NODE(Operator)
+
+  std::size_t op;
+  std::size_t open;
+  std::size_t close;
+};
+
+struct OperatorFunctionIdAST: public AST
+{
+  DECLARE_AST_NODE(OperatorFunctionId)
+
+  OperatorAST *op;
+  TypeSpecifierAST *type_specifier;
+  const ListNode<PtrOperatorAST*> *ptr_ops;
+};
+
+struct ParameterDeclarationAST: public AST
+{
+  DECLARE_AST_NODE(ParameterDeclaration)
+
+  TypeSpecifierAST *type_specifier;
+  DeclaratorAST *declarator;
+  ExpressionAST *expression;
+};
+
+struct ParameterDeclarationClauseAST: public AST
+{
+  DECLARE_AST_NODE(ParameterDeclarationClause)
+
+  const ListNode<ParameterDeclarationAST*> *parameter_declarations;
+  std::size_t ellipsis;
+};
+
+struct PostfixExpressionAST: public ExpressionAST
+{
+  DECLARE_AST_NODE(PostfixExpression)
+
+  TypeSpecifierAST *type_specifier;
+  ExpressionAST *expression;
+  const ListNode<ExpressionAST*> *sub_expressions;
+};
+
+struct PrimaryExpressionAST: public ExpressionAST
+{
+  DECLARE_AST_NODE(PrimaryExpression)
+
+  StringLiteralAST *literal;
+  std::size_t token;
+  StatementAST *expression_statement;
+  ExpressionAST *sub_expression;
+  NameAST *name;
+};
+
+struct PtrOperatorAST: public AST
+{
+  DECLARE_AST_NODE(PtrOperator)
+
+  const ListNode<std::size_t> *cv;
+  std::size_t op;
+  PtrToMemberAST *mem_ptr;
+};
+
+struct PtrToMemberAST: public AST
+{
+  DECLARE_AST_NODE(PtrToMember)
+};
+
+struct ReturnStatementAST: public StatementAST
+{
+  DECLARE_AST_NODE(ReturnStatement)
+
+  ExpressionAST *expression;
+};
+
+struct SimpleDeclarationAST: public DeclarationAST
+{
+  DECLARE_AST_NODE(SimpleDeclaration)
+
+  const ListNode<std::size_t> *storage_specifiers;
+  const ListNode<std::size_t> *function_specifiers;
+  TypeSpecifierAST *type_specifier;
+  const ListNode<InitDeclaratorAST*> *init_declarators;
+  WinDeclSpecAST *win_decl_specifiers;
+};
+
+struct SimpleTypeSpecifierAST: public TypeSpecifierAST
+{
+  DECLARE_AST_NODE(SimpleTypeSpecifier)
+
+  const ListNode<std::size_t> *integrals;
+  std::size_t type_of;
+  TypeIdAST *type_id;
+  ExpressionAST *expression;
+  NameAST *name;
+};
+
+struct SizeofExpressionAST: public ExpressionAST
+{
+  DECLARE_AST_NODE(SizeofExpression)
+
+  std::size_t sizeof_token;
+  TypeIdAST *type_id;
+  ExpressionAST *expression;
+};
+
+struct StringLiteralAST: public AST
+{
+  DECLARE_AST_NODE(StringLiteral)
+
+  const ListNode<std::size_t> *literals;
+};
+
+struct SubscriptExpressionAST: public ExpressionAST
+{
+  DECLARE_AST_NODE(SubscriptExpression)
+
+  ExpressionAST *subscript;
+};
+
+struct SwitchStatementAST: public StatementAST
+{
+  DECLARE_AST_NODE(SwitchStatement)
+
+  ConditionAST *condition;
+  StatementAST *statement;
+};
+
+struct TemplateArgumentAST: public AST
+{
+  DECLARE_AST_NODE(TemplateArgument)
+
+  TypeIdAST *type_id;
+  ExpressionAST *expression;
+};
+
+struct TemplateDeclarationAST: public DeclarationAST
+{
+  DECLARE_AST_NODE(TemplateDeclaration)
+
+  std::size_t exported;
+  const ListNode<TemplateParameterAST*> *template_parameters;
+  DeclarationAST* declaration;
+};
+
+struct TemplateParameterAST: public AST
+{
+  DECLARE_AST_NODE(TemplateParameter)
+
+  TypeParameterAST *type_parameter;
+  ParameterDeclarationAST *parameter_declaration;
+};
+
+struct ThrowExpressionAST: public ExpressionAST
+{
+  DECLARE_AST_NODE(ThrowExpression)
+
+  std::size_t throw_token;
+  ExpressionAST *expression;
+};
+
+struct TranslationUnitAST: public AST
+{
+  DECLARE_AST_NODE(TranslationUnit)
+
+  const ListNode<DeclarationAST*> *declarations;
+};
+
+struct TryBlockStatementAST: public StatementAST
+{
+  DECLARE_AST_NODE(TryBlockStatement)
+};
+
+struct TypeIdAST: public AST
+{
+  DECLARE_AST_NODE(TypeId)
+
+  TypeSpecifierAST *type_specifier;
+  DeclaratorAST *declarator;
+};
+
+struct TypeIdentificationAST: public ExpressionAST
+{
+  DECLARE_AST_NODE(TypeIdentification)
+
+  std::size_t typename_token;
+  NameAST *name;
+  ExpressionAST *expression;
+};
+
+struct TypeParameterAST: public AST
+{
+  DECLARE_AST_NODE(TypeParameter)
+
+  std::size_t type;
+  NameAST *name;
+  TypeIdAST *type_id;
+  const ListNode<TemplateParameterAST*> *template_parameters;
+  NameAST *template_name;
+};
+
+struct TypedefAST: public DeclarationAST
+{
+  DECLARE_AST_NODE(Typedef)
+
+  TypeSpecifierAST *type_specifier;
+  const ListNode<InitDeclaratorAST*> *init_declarators;
+};
+
+struct UnaryExpressionAST: public ExpressionAST
+{
+  DECLARE_AST_NODE(UnaryExpression)
+
+  std::size_t op;
+  ExpressionAST *expression;
+};
+
+struct UnqualifiedNameAST: public AST
+{
+  DECLARE_AST_NODE(UnqualifiedName)
+
+  std::size_t tilde;
+  std::size_t id;
+  OperatorFunctionIdAST *operator_id;
+  const ListNode<TemplateArgumentAST*> *template_arguments;
+};
+
+struct UsingAST: public DeclarationAST
+{
+  DECLARE_AST_NODE(Using)
+
+  std::size_t type_name;
+  NameAST *name;
+};
+
+struct UsingDirectiveAST: public DeclarationAST
+{
+  DECLARE_AST_NODE(UsingDirective)
+
+  NameAST *name;
+};
+
+struct WhileStatementAST: public StatementAST
+{
+  DECLARE_AST_NODE(WhileStatement)
+
+  ConditionAST *condition;
+  StatementAST *statement;
+};
+
+struct WinDeclSpecAST: public AST
+{
+  DECLARE_AST_NODE(WinDeclSpec)
+
+  std::size_t specifier;
+  std::size_t modifier;
+};
+
+struct QPropertyAST : public DeclarationAST
+{
+  DECLARE_AST_NODE(QPropertyAST)
+};
+
+struct QEnumsAST : public DeclarationAST
+{
+  DECLARE_AST_NODE(QEnumsAST)
+};
+
+template <class _Tp>
+_Tp *CreateNode(pool *memory_pool)
+{
+  _Tp *node = reinterpret_cast<_Tp*>(memory_pool->allocate(sizeof(_Tp)));
+  node->kind = _Tp::__node_kind;
+  return node;
+}
+
+template <class _Tp>
+_Tp ast_cast(AST *item)
+{
+  if (item && static_cast<_Tp>(0)->__node_kind == item->kind)
+    return static_cast<_Tp>(item);
+
+  return 0;
+}
+
+#endif // AST_H
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/binder.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,928 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+** Copyright (C) 2002-2005 Roberto Raggi <roberto@kdevelop.org>
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#include "binder.h"
+#include "lexer.h"
+#include "control.h"
+#include "symbol.h"
+#include "codemodel_finder.h"
+#include "class_compiler.h"
+#include "compiler_utils.h"
+#include "tokens.h"
+#include "dumptree.h"
+
+#include <iostream>
+
+#include <qdebug.h>
+
+void binder_default_message_handler(const std::string &str) {
+    std::cerr << str;
+}
+
+MessageHandler Binder::_M_message_handler = binder_default_message_handler;
+
+Binder::Binder(CodeModel *__model, LocationManager &__location, Control *__control)
+  : _M_model(__model),
+    _M_location(__location),
+    _M_token_stream(&_M_location.token_stream),
+    _M_control(__control),
+    _M_current_function_type(CodeModel::Normal),
+    type_cc(this),
+    name_cc(this),
+    decl_cc(this)
+{
+  _M_qualified_types["char"] = QString();
+  _M_qualified_types["double"] = QString();
+  _M_qualified_types["float"] = QString();
+  _M_qualified_types["int"] = QString();
+  _M_qualified_types["long"] = QString();
+  _M_qualified_types["short"] = QString();
+  _M_qualified_types["void"] = QString();
+}
+
+Binder::~Binder()
+{
+}
+
+FileModelItem Binder::run(AST *node)
+{
+  FileModelItem old = _M_current_file;
+  _M_current_access = CodeModel::Public;
+
+  _M_current_file = model()->create<FileModelItem>();
+  updateItemPosition (_M_current_file->toItem(), node);
+  visit(node);
+  FileModelItem result = _M_current_file;
+
+  _M_current_file = old; // restore
+
+  return result;
+}
+
+ScopeModelItem Binder::currentScope()
+{
+  if (_M_current_class)
+    return model_static_cast<ScopeModelItem>(_M_current_class);
+  else if (_M_current_namespace)
+    return model_static_cast<ScopeModelItem>(_M_current_namespace);
+
+  return model_static_cast<ScopeModelItem>(_M_current_file);
+}
+
+TemplateParameterList Binder::changeTemplateParameters(TemplateParameterList templateParameters)
+{
+  TemplateParameterList old = _M_current_template_parameters;
+  _M_current_template_parameters = templateParameters;
+  return old;
+}
+
+CodeModel::FunctionType Binder::changeCurrentFunctionType(CodeModel::FunctionType functionType)
+{
+  CodeModel::FunctionType old = _M_current_function_type;
+  _M_current_function_type = functionType;
+  return old;
+}
+
+CodeModel::AccessPolicy Binder::changeCurrentAccess(CodeModel::AccessPolicy accessPolicy)
+{
+  CodeModel::AccessPolicy old = _M_current_access;
+  _M_current_access = accessPolicy;
+  return old;
+}
+
+NamespaceModelItem Binder::changeCurrentNamespace(NamespaceModelItem item)
+{
+  NamespaceModelItem old = _M_current_namespace;
+  _M_current_namespace = item;
+  return old;
+}
+
+ClassModelItem Binder::changeCurrentClass(ClassModelItem item)
+{
+  ClassModelItem old = _M_current_class;
+  _M_current_class = item;
+  return old;
+}
+
+FunctionDefinitionModelItem Binder::changeCurrentFunction(FunctionDefinitionModelItem item)
+{
+  FunctionDefinitionModelItem old = _M_current_function;
+  _M_current_function = item;
+  return old;
+}
+
+int Binder::decode_token(std::size_t index) const
+{
+  return _M_token_stream->kind(index);
+}
+
+CodeModel::AccessPolicy Binder::decode_access_policy(std::size_t index) const
+{
+  switch (decode_token(index))
+    {
+      case Token_class:
+        return CodeModel::Private;
+
+      case Token_struct:
+      case Token_union:
+        return CodeModel::Public;
+
+      default:
+        return CodeModel::Public;
+    }
+}
+
+CodeModel::ClassType Binder::decode_class_type(std::size_t index) const
+{
+  switch (decode_token(index))
+    {
+      case Token_class:
+        return CodeModel::Class;
+      case Token_struct:
+        return CodeModel::Struct;
+      case Token_union:
+        return CodeModel::Union;
+      default:
+        _M_message_handler("** WARNING unrecognized class type");
+    }
+    return CodeModel::Class;
+}
+
+const NameSymbol *Binder::decode_symbol(std::size_t index) const
+{
+  return _M_token_stream->symbol(index);
+}
+
+void Binder::visitAccessSpecifier(AccessSpecifierAST *node)
+{
+  const ListNode<std::size_t> *it =  node->specs;
+  if (it == 0)
+    return;
+
+  it = it->toFront();
+  const ListNode<std::size_t> *end = it;
+
+  do
+    {
+      switch (decode_token(it->element))
+        {
+          default:
+            break;
+
+          case Token_public:
+            changeCurrentAccess(CodeModel::Public);
+            changeCurrentFunctionType(CodeModel::Normal);
+            break;
+          case Token_protected:
+            changeCurrentAccess(CodeModel::Protected);
+            changeCurrentFunctionType(CodeModel::Normal);
+            break;
+          case Token_private:
+            changeCurrentAccess(CodeModel::Private);
+            changeCurrentFunctionType(CodeModel::Normal);
+            break;
+          case Token_signals:
+            changeCurrentAccess(CodeModel::Protected);
+            changeCurrentFunctionType(CodeModel::Signal);
+            break;
+          case Token_slots:
+            changeCurrentFunctionType(CodeModel::Slot);
+            break;
+        }
+      it = it->next;
+    }
+  while (it != end);
+}
+
+void Binder::visitSimpleDeclaration(SimpleDeclarationAST *node)
+{
+  visit(node->type_specifier);
+
+  if (const ListNode<InitDeclaratorAST*> *it = node->init_declarators)
+    {
+      it = it->toFront();
+      const ListNode<InitDeclaratorAST*> *end = it;
+      do
+        {
+          InitDeclaratorAST *init_declarator = it->element;
+          declare_symbol(node, init_declarator);
+          it = it->next;
+        }
+      while (it != end);
+    }
+}
+
+void Binder::declare_symbol(SimpleDeclarationAST *node, InitDeclaratorAST *init_declarator)
+{
+  DeclaratorAST *declarator = init_declarator->declarator;
+
+  while (declarator && declarator->sub_declarator)
+    declarator = declarator->sub_declarator;
+
+  NameAST *id = declarator->id;
+  if (! declarator->id)
+    {
+      _M_message_handler("** WARNING expected a declarator id");
+      return;
+    }
+
+  CodeModelFinder finder(model(), this);
+  ScopeModelItem symbolScope = finder.resolveScope(id, currentScope());
+  if (! symbolScope)
+    {
+      name_cc.run(id);
+      _M_message_handler(std::string("** WARNING scope not found for symbol:") + qPrintable(name_cc.name()));
+      return;
+    }
+
+  decl_cc.run(declarator);
+
+  if (decl_cc.isFunction())
+    {
+      name_cc.run(id->unqualified_name);
+
+      FunctionModelItem fun = model()->create<FunctionModelItem>();
+      updateItemPosition (fun->toItem(), node);
+      fun->setAccessPolicy(_M_current_access);
+      fun->setFunctionType(_M_current_function_type);
+      fun->setName(name_cc.name());
+      fun->setAbstract(init_declarator->initializer != 0);
+      fun->setConstant(declarator->fun_cv != 0);
+      fun->setTemplateParameters(_M_current_template_parameters);
+      applyStorageSpecifiers(node->storage_specifiers, model_static_cast<MemberModelItem>(fun));
+      applyFunctionSpecifiers(node->function_specifiers, fun);
+
+      // build the type
+      TypeInfo typeInfo = CompilerUtils::typeDescription(node->type_specifier,
+                                                         declarator,
+                                                         this);
+
+      fun->setType(qualifyType(typeInfo, symbolScope->qualifiedName()));
+
+
+      fun->setVariadics (decl_cc.isVariadics ());
+
+      // ... and the signature
+      foreach (DeclaratorCompiler::Parameter p, decl_cc.parameters())
+        {
+          ArgumentModelItem arg = model()->create<ArgumentModelItem>();
+          arg->setType(qualifyType(p.type, _M_context));
+          arg->setName(p.name);
+          arg->setDefaultValue(p.defaultValue);
+          if (p.defaultValue)
+              arg->setDefaultValueExpression(p.defaultValueExpression);
+          fun->addArgument(arg);
+        }
+
+      fun->setScope(symbolScope->qualifiedName());
+      symbolScope->addFunction(fun);
+    }
+  else
+    {
+      VariableModelItem var = model()->create<VariableModelItem>();
+      updateItemPosition (var->toItem(), node);
+      var->setTemplateParameters(_M_current_template_parameters);
+      var->setAccessPolicy(_M_current_access);
+      name_cc.run(id->unqualified_name);
+      var->setName(name_cc.name());
+      TypeInfo typeInfo = CompilerUtils::typeDescription(node->type_specifier,
+                                                         declarator,
+                                                         this);
+      if (declarator != init_declarator->declarator
+            && init_declarator->declarator->parameter_declaration_clause != 0)
+        {
+          typeInfo.setFunctionPointer (true);
+          decl_cc.run (init_declarator->declarator);
+          foreach (DeclaratorCompiler::Parameter p, decl_cc.parameters())
+            typeInfo.addArgument(p.type);
+        }
+
+      var->setType(qualifyType(typeInfo, _M_context));
+      applyStorageSpecifiers(node->storage_specifiers, model_static_cast<MemberModelItem>(var));
+
+      var->setScope(symbolScope->qualifiedName());
+      symbolScope->addVariable(var);
+    }
+}
+
+void Binder::visitFunctionDefinition(FunctionDefinitionAST *node)
+{
+  Q_ASSERT(node->init_declarator != 0);
+
+  ScopeModelItem scope = currentScope();
+
+  InitDeclaratorAST *init_declarator = node->init_declarator;
+  DeclaratorAST *declarator = init_declarator->declarator;
+
+  // in the case of "void (func)()" or "void ((func))()" we need to
+  // skip to the inner most.  This is in line with how the declarator
+  // node is generated in 'parser.cpp'
+  while (declarator && declarator->sub_declarator)
+      declarator = declarator->sub_declarator;
+  Q_ASSERT(declarator->id);
+
+  CodeModelFinder finder(model(), this);
+
+  ScopeModelItem functionScope = finder.resolveScope(declarator->id, scope);
+  if (! functionScope)
+    {
+      name_cc.run(declarator->id);
+      _M_message_handler(std::string("** WARNING scope not found for function definition:")
+                         + qPrintable(name_cc.name())
+                         + std::string(" - definition *ignored*"));
+      return;
+    }
+
+  decl_cc.run(declarator);
+
+  Q_ASSERT(! decl_cc.id().isEmpty());
+
+  FunctionDefinitionModelItem
+    old = changeCurrentFunction(_M_model->create<FunctionDefinitionModelItem>());
+  _M_current_function->setScope(functionScope->qualifiedName());
+  updateItemPosition (_M_current_function->toItem(), node);
+
+  Q_ASSERT(declarator->id->unqualified_name != 0);
+  name_cc.run(declarator->id->unqualified_name);
+  QString unqualified_name = name_cc.name();
+
+  _M_current_function->setName(unqualified_name);
+  TypeInfo tmp_type = CompilerUtils::typeDescription(node->type_specifier,
+                                                     declarator, this);
+
+  _M_current_function->setType(qualifyType(tmp_type, _M_context));
+  _M_current_function->setAccessPolicy(_M_current_access);
+  _M_current_function->setFunctionType(_M_current_function_type);
+  _M_current_function->setConstant(declarator->fun_cv != 0);
+  _M_current_function->setTemplateParameters(_M_current_template_parameters);
+
+  applyStorageSpecifiers(node->storage_specifiers,
+                          model_static_cast<MemberModelItem>(_M_current_function));
+  applyFunctionSpecifiers(node->function_specifiers,
+                          model_static_cast<FunctionModelItem>(_M_current_function));
+
+  _M_current_function->setVariadics (decl_cc.isVariadics ());
+
+  foreach (DeclaratorCompiler::Parameter p, decl_cc.parameters())
+    {
+      ArgumentModelItem arg = model()->create<ArgumentModelItem>();
+      arg->setType(qualifyType(p.type, functionScope->qualifiedName()));
+      arg->setName(p.name);
+      arg->setDefaultValue(p.defaultValue);
+      if (p.defaultValue)
+        arg->setDefaultValueExpression(p.defaultValueExpression);
+      _M_current_function->addArgument(arg);
+    }
+
+  functionScope->addFunctionDefinition(_M_current_function);
+
+  FunctionModelItem prototype = model_static_cast<FunctionModelItem>(_M_current_function);
+  FunctionModelItem declared = functionScope->declaredFunction(prototype);
+
+  // try to find a function declaration for this definition..
+  if (! declared)
+    {
+      functionScope->addFunction(prototype);
+    }
+  else
+    {
+      applyFunctionSpecifiers(node->function_specifiers, declared);
+
+      // fix the function type and the access policy
+      _M_current_function->setAccessPolicy(declared->accessPolicy());
+      _M_current_function->setFunctionType(declared->functionType());
+    }
+
+  changeCurrentFunction(old);
+}
+
+void Binder::visitTemplateDeclaration(TemplateDeclarationAST *node)
+{
+    const ListNode<TemplateParameterAST*> *it = node->template_parameters;
+    if (it == 0)
+        return;
+
+    TemplateParameterList savedTemplateParameters = changeTemplateParameters(TemplateParameterList());
+
+    it = it->toFront();
+    const ListNode<TemplateParameterAST*> *end = it;
+
+    TemplateParameterList templateParameters;
+    do {
+        TemplateParameterAST *parameter = it->element;
+        TypeParameterAST *type_parameter = parameter->type_parameter;
+
+        NameAST *name;
+        if (!type_parameter) {
+            // A hacky hack to work around missing support for parameter declarations in
+            // templates. We just need the to get the name of the variable, since we
+            // aren't actually compiling these anyway. We are still not supporting much
+            // more, but we are refusing to fail for a few more declarations
+            if (parameter->parameter_declaration == 0 ||
+                parameter->parameter_declaration->declarator == 0 ||
+                parameter->parameter_declaration->declarator->id == 0) {
+
+                    /*std::cerr << "** WARNING template declaration not supported ``";
+                    Token const &tk = _M_token_stream->token ((int) node->start_token);
+                    Token const &end_tk = _M_token_stream->token ((int) node->declaration->start_token);
+
+                    std::cerr << std::string (&tk.text[tk.position], (end_tk.position) - tk.position) << "''"
+                        << std::endl << std::endl;*/
+
+                    changeTemplateParameters(savedTemplateParameters);
+                    return;
+
+            }
+
+            name = parameter->parameter_declaration->declarator->id;
+        } else {
+            int tk = decode_token(type_parameter->type);
+            if (tk != Token_typename && tk != Token_class)
+            {
+                /*std::cerr << "** WARNING template declaration not supported ``";
+                Token const &tk = _M_token_stream->token ((int) node->start_token);
+                Token const &end_tk = _M_token_stream->token ((int) node->declaration->start_token);
+
+                std::cerr << std::string (&tk.text[tk.position], (end_tk.position) - tk.position) << "''"
+                << std::endl << std::endl;*/
+
+                changeTemplateParameters(savedTemplateParameters);
+                return;
+            }
+            assert(tk == Token_typename || tk == Token_class);
+
+            name = type_parameter->name;
+        }
+
+        TemplateParameterModelItem p = model()->create<TemplateParameterModelItem>();
+        name_cc.run(name);
+        p->setName(name_cc.name());
+
+        _M_current_template_parameters.append(p);
+        it = it->next;
+    } while (it != end);
+
+    visit(node->declaration);
+
+    changeTemplateParameters(savedTemplateParameters);
+}
+
+void Binder::visitTypedef(TypedefAST *node)
+{
+  const ListNode<InitDeclaratorAST*> *it = node->init_declarators;
+  if (it == 0)
+    return;
+
+  it = it->toFront();
+  const ListNode<InitDeclaratorAST*> *end = it;
+
+  do
+    {
+      InitDeclaratorAST *init_declarator = it->element;
+      it = it->next;
+
+      Q_ASSERT(init_declarator->declarator != 0);
+
+      // the name
+      decl_cc.run (init_declarator->declarator);
+      QString alias_name = decl_cc.id ();
+
+      if (alias_name.isEmpty ())
+        {
+          _M_message_handler("** WARNING anonymous typedef not supported! ``");
+          Token const &tk = _M_token_stream->token ((int) node->start_token);
+          Token const &end_tk = _M_token_stream->token ((int) node->end_token);
+
+          _M_message_handler(std::string(&tk.text[tk.position], end_tk.position - tk.position));
+          continue;
+        }
+
+      // build the type
+      TypeInfo typeInfo = CompilerUtils::typeDescription (node->type_specifier,
+                                                          init_declarator->declarator,
+                                                          this);
+      DeclaratorAST *decl = init_declarator->declarator;
+      while (decl && decl->sub_declarator)
+        decl = decl->sub_declarator;
+
+      if (decl != init_declarator->declarator
+            && init_declarator->declarator->parameter_declaration_clause != 0)
+        {
+          typeInfo.setFunctionPointer (true);
+          decl_cc.run (init_declarator->declarator);
+          foreach (DeclaratorCompiler::Parameter p, decl_cc.parameters())
+            typeInfo.addArgument(p.type);
+        }
+
+      ScopeModelItem scope = currentScope();
+      DeclaratorAST *declarator = init_declarator->declarator;
+      CodeModelFinder finder(model(), this);
+      ScopeModelItem typedefScope = finder.resolveScope(declarator->id, scope);
+
+      TypeAliasModelItem typeAlias = model ()->create<TypeAliasModelItem> ();
+      updateItemPosition (typeAlias->toItem (), node);
+      typeAlias->setName (alias_name);
+      typeAlias->setType (qualifyType (typeInfo, currentScope ()->qualifiedName ()));
+      typeAlias->setScope (typedefScope->qualifiedName());
+      _M_qualified_types[typeAlias->qualifiedName().join(".")] = QString();
+      currentScope ()->addTypeAlias (typeAlias);
+    }
+  while (it != end);
+}
+
+void Binder::visitNamespace(NamespaceAST *node)
+{
+  bool anonymous = (node->namespace_name == 0);
+
+  ScopeModelItem scope = currentScope();
+
+  NamespaceModelItem old;
+  if (! anonymous)
+    {
+      QString name = decode_symbol(node->namespace_name)->as_string();
+
+      QStringList qualified_name = scope->qualifiedName();
+      qualified_name += name;
+      NamespaceModelItem ns =
+        model_safe_cast<NamespaceModelItem>(_M_model->findItem(qualified_name,
+                                                                  _M_current_file->toItem()));
+      if (!ns)
+        {
+          ns = _M_model->create<NamespaceModelItem>();
+          updateItemPosition (ns->toItem(), node);
+          ns->setName(name);
+          ns->setScope(scope->qualifiedName());
+        }
+      old = changeCurrentNamespace(ns);
+
+      _M_context.append(name);
+    }
+
+  DefaultVisitor::visitNamespace(node);
+
+  if (! anonymous)
+    {
+      Q_ASSERT(scope->kind() == _CodeModelItem::Kind_Namespace
+               || scope->kind() == _CodeModelItem::Kind_File);
+
+      _M_context.removeLast();
+
+      if (NamespaceModelItem ns = model_static_cast<NamespaceModelItem>(scope))
+        {
+          ns->addNamespace(_M_current_namespace);
+        }
+
+      changeCurrentNamespace(old);
+    }
+}
+
+void Binder::visitForwardDeclarationSpecifier(ForwardDeclarationSpecifierAST *node)
+{
+    name_cc.run(node->name);
+    if (name_cc.name().isEmpty())
+        return;
+
+    ScopeModelItem scope = currentScope();
+    _M_qualified_types[(scope->qualifiedName() + name_cc.qualifiedName()).join(".") ] = QString();
+}
+
+void Binder::visitClassSpecifier(ClassSpecifierAST *node)
+{
+  ClassCompiler class_cc(this);
+  class_cc.run(node);
+
+  if (class_cc.name().isEmpty())
+    {
+      // anonymous not supported
+      return;
+    }
+
+  Q_ASSERT(node->name != 0 && node->name->unqualified_name != 0);
+
+  ScopeModelItem scope = currentScope();
+
+  ClassModelItem old = changeCurrentClass(_M_model->create<ClassModelItem>());
+  updateItemPosition (_M_current_class->toItem(), node);
+  _M_current_class->setName(class_cc.name());
+
+  QStringList baseClasses = class_cc.baseClasses(); TypeInfo info;
+  for (int i=0; i<baseClasses.size(); ++i)
+    {
+        info.setQualifiedName(baseClasses.at(i).split("::"));
+        baseClasses[i] = qualifyType(info, scope->qualifiedName()).qualifiedName().join("::");
+    }
+
+  _M_current_class->setBaseClasses(baseClasses);
+  _M_current_class->setClassType(decode_class_type(node->class_key));
+  _M_current_class->setTemplateParameters(_M_current_template_parameters);
+
+  if (! _M_current_template_parameters.isEmpty())
+    {
+      QString name = _M_current_class->name();
+      name += "<";
+      for (int i = 0; i<_M_current_template_parameters.size(); ++i)
+        {
+          if (i != 0)
+            name += ",";
+
+          name += _M_current_template_parameters.at(i)->name();
+        }
+
+      name += ">";
+      _M_current_class->setName(name);
+    }
+
+  CodeModel::AccessPolicy oldAccessPolicy = changeCurrentAccess(decode_access_policy(node->class_key));
+  CodeModel::FunctionType oldFunctionType = changeCurrentFunctionType(CodeModel::Normal);
+
+  _M_current_class->setScope(scope->qualifiedName());
+  _M_qualified_types[_M_current_class->qualifiedName().join(".")] = QString();
+
+  scope->addClass(_M_current_class);
+
+  name_cc.run(node->name->unqualified_name);
+  _M_context.append(name_cc.name());
+  visitNodes(this, node->member_specs);
+  _M_context.removeLast();
+
+  changeCurrentClass(old);
+  changeCurrentAccess(oldAccessPolicy);
+  changeCurrentFunctionType(oldFunctionType);
+}
+
+void Binder::visitLinkageSpecification(LinkageSpecificationAST *node)
+{
+  DefaultVisitor::visitLinkageSpecification(node);
+}
+
+void Binder::visitUsing(UsingAST *node)
+{
+  DefaultVisitor::visitUsing(node);
+}
+
+void Binder::visitEnumSpecifier(EnumSpecifierAST *node)
+{
+  CodeModelFinder finder(model(), this);
+  ScopeModelItem scope = currentScope();
+  ScopeModelItem enumScope = finder.resolveScope(node->name, scope);
+
+  name_cc.run(node->name);
+  QString name = name_cc.name();
+
+  if (name.isEmpty())
+    {
+      // anonymous enum
+      QString key = _M_context.join("::");
+      int current = ++_M_anonymous_enums[key];
+      name += QLatin1String("enum_");
+      name += QString::number(current);
+    }
+
+  _M_current_enum = model()->create<EnumModelItem>();
+  _M_current_enum->setAccessPolicy(_M_current_access);
+  updateItemPosition (_M_current_enum->toItem(), node);
+  _M_current_enum->setName(name);
+  _M_current_enum->setScope(enumScope->qualifiedName());
+
+  _M_qualified_types[_M_current_enum->qualifiedName().join(".")] = QString();
+
+  enumScope->addEnum(_M_current_enum);
+
+  DefaultVisitor::visitEnumSpecifier(node);
+
+  _M_current_enum = 0;
+}
+
+static QString strip_preprocessor_lines(const QString &name)
+{
+    QStringList lst = name.split("\n");
+    QString s;
+    for (int i=0; i<lst.size(); ++i) {
+        if (!lst.at(i).startsWith('#'))
+            s += lst.at(i);
+    }
+    return s.trimmed();
+}
+
+void Binder::visitEnumerator(EnumeratorAST *node)
+{
+  Q_ASSERT(_M_current_enum != 0);
+  EnumeratorModelItem e = model()->create<EnumeratorModelItem>();
+  updateItemPosition (e->toItem(), node);
+  e->setName(decode_symbol(node->id)->as_string());
+
+  if (ExpressionAST *expr = node->expression)
+    {
+      const Token &start_token = _M_token_stream->token((int) expr->start_token);
+      const Token &end_token = _M_token_stream->token((int) expr->end_token);
+
+      e->setValue(strip_preprocessor_lines(QString::fromUtf8(&start_token.text[start_token.position],
+                                    (int) (end_token.position - start_token.position)).trimmed()).remove(' '));
+    }
+
+  _M_current_enum->addEnumerator(e);
+}
+
+void Binder::visitUsingDirective(UsingDirectiveAST *node)
+{
+  DefaultVisitor::visitUsingDirective(node);
+}
+
+void Binder::visitQEnums(QEnumsAST *node)
+{
+  const Token &start = _M_token_stream->token((int) node->start_token);
+  const Token &end = _M_token_stream->token((int) node->end_token);
+  QStringList enum_list = QString::fromLatin1(start.text + start.position,
+                                              end.position - start.position).split(' ');
+
+  ScopeModelItem scope = currentScope();
+  for (int i=0; i<enum_list.size(); ++i)
+    scope->addEnumsDeclaration(enum_list.at(i));
+}
+
+void Binder::visitQProperty(QPropertyAST *node)
+{
+    const Token &start = _M_token_stream->token((int) node->start_token);
+    const Token &end = _M_token_stream->token((int) node->end_token);
+    QString property = QString::fromLatin1(start.text + start.position,
+                                           end.position - start.position);
+    _M_current_class->addPropertyDeclaration(property);
+}
+
+void Binder::applyStorageSpecifiers(const ListNode<std::size_t> *it, MemberModelItem item)
+{
+  if (it == 0)
+    return;
+
+  it = it->toFront();
+  const ListNode<std::size_t> *end = it;
+
+  do
+    {
+      switch (decode_token(it->element))
+        {
+          default:
+            break;
+
+          case Token_friend:
+            item->setFriend(true);
+            break;
+          case Token_auto:
+            item->setAuto(true);
+            break;
+          case Token_register:
+            item->setRegister(true);
+            break;
+          case Token_static:
+            item->setStatic(true);
+            break;
+          case Token_extern:
+            item->setExtern(true);
+            break;
+          case Token_mutable:
+            item->setMutable(true);
+            break;
+        }
+      it = it->next;
+    }
+  while (it != end);
+}
+
+void Binder::applyFunctionSpecifiers(const ListNode<std::size_t> *it, FunctionModelItem item)
+{
+  if (it == 0)
+    return;
+
+  it = it->toFront();
+  const ListNode<std::size_t> *end = it;
+
+  do
+    {
+      switch (decode_token(it->element))
+        {
+          default:
+            break;
+
+          case Token_inline:
+            item->setInline(true);
+            break;
+
+          case Token_virtual:
+            item->setVirtual(true);
+            break;
+
+          case Token_explicit:
+            item->setExplicit(true);
+            break;
+
+          case Token_Q_INVOKABLE:
+            item->setInvokable(true);
+            break;
+        }
+      it = it->next;
+    }
+  while (it != end);
+}
+
+TypeInfo Binder::qualifyType(const TypeInfo &type, const QStringList &context) const
+{
+  // ### Potentially improve to use string list in the name table to
+  if (context.size() == 0)
+    {
+      // ### We can assume that this means global namespace for now...
+      return type;
+    }
+  else if (_M_qualified_types.contains(type.qualifiedName().join(".")))
+    {
+      return type;
+    }
+  else
+    {
+      QStringList expanded = context;
+      expanded << type.qualifiedName();
+      if (_M_qualified_types.contains(expanded.join(".")))
+        {
+          TypeInfo modified_type = type;
+          modified_type.setQualifiedName(expanded);
+          return modified_type;
+        }
+      else
+        {
+          CodeModelItem scope = model ()->findItem (context, _M_current_file->toItem ());
+
+          if (ClassModelItem klass = model_dynamic_cast<ClassModelItem> (scope))
+            {
+              foreach (QString base, klass->baseClasses ())
+                {
+                  QStringList ctx = context;
+                  ctx.removeLast();
+                  ctx.append (base);
+
+                  TypeInfo qualified = qualifyType (type, ctx);
+                  if (qualified != type)
+                    return qualified;
+                }
+            }
+
+          QStringList copy = context;
+          copy.removeLast();
+          return qualifyType(type, copy);
+        }
+    }
+}
+
+void Binder::updateItemPosition(CodeModelItem item, AST *node)
+{
+  QString filename;
+  int line, column;
+
+  assert (node != 0);
+  _M_location.positionAt (_M_token_stream->position(node->start_token), &line, &column, &filename);
+  item->setFileName (filename);
+}
+
+void Binder::installMessageHandler(MessageHandler handler)
+{
+    _M_message_handler = handler;
+}
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/binder.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,143 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+** Copyright (C) 2002-2005 Roberto Raggi <roberto@kdevelop.org>
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+
+#ifndef BINDER_H
+#define BINDER_H
+
+#include "default_visitor.h"
+#include "codemodel.h"
+#include "type_compiler.h"
+#include "name_compiler.h"
+#include "declarator_compiler.h"
+
+class TokenStream;
+class LocationManager;
+class Control;
+struct NameSymbol;
+
+typedef void (*MessageHandler)(const std::string &s);
+
+class Binder: protected DefaultVisitor
+{
+public:
+  Binder(CodeModel *__model, LocationManager &__location, Control *__control = 0);
+  virtual ~Binder();
+
+  inline TokenStream *tokenStream() const { return _M_token_stream; }
+  inline CodeModel *model() const { return _M_model; }
+  ScopeModelItem currentScope();
+
+  FileModelItem run(AST *node);
+
+// utils
+  TypeInfo qualifyType(const TypeInfo &type, const QStringList &context) const;
+
+  static void installMessageHandler(MessageHandler handler);
+
+protected:
+  virtual void visitAccessSpecifier(AccessSpecifierAST *);
+  virtual void visitClassSpecifier(ClassSpecifierAST *);
+  virtual void visitEnumSpecifier(EnumSpecifierAST *);
+  virtual void visitEnumerator(EnumeratorAST *);
+  virtual void visitFunctionDefinition(FunctionDefinitionAST *);
+  virtual void visitLinkageSpecification(LinkageSpecificationAST *);
+  virtual void visitNamespace(NamespaceAST *);
+  virtual void visitSimpleDeclaration(SimpleDeclarationAST *);
+  virtual void visitTemplateDeclaration(TemplateDeclarationAST *);
+  virtual void visitTypedef(TypedefAST *);
+  virtual void visitUsing(UsingAST *);
+  virtual void visitUsingDirective(UsingDirectiveAST *);
+  virtual void visitQProperty(QPropertyAST *);
+  virtual void visitForwardDeclarationSpecifier(ForwardDeclarationSpecifierAST *);
+  virtual void visitQEnums(QEnumsAST *);
+
+private:
+
+  int decode_token(std::size_t index) const;
+  const NameSymbol *decode_symbol(std::size_t index) const;
+  CodeModel::AccessPolicy decode_access_policy(std::size_t index) const;
+  CodeModel::ClassType decode_class_type(std::size_t index) const;
+
+  CodeModel::FunctionType changeCurrentFunctionType(CodeModel::FunctionType functionType);
+  CodeModel::AccessPolicy changeCurrentAccess(CodeModel::AccessPolicy accessPolicy);
+  NamespaceModelItem changeCurrentNamespace(NamespaceModelItem item);
+  ClassModelItem changeCurrentClass(ClassModelItem item);
+  FunctionDefinitionModelItem changeCurrentFunction(FunctionDefinitionModelItem item);
+  TemplateParameterList changeTemplateParameters(TemplateParameterList templateParameters);
+
+  void declare_symbol(SimpleDeclarationAST *node, InitDeclaratorAST *init_declarator);
+
+  void applyStorageSpecifiers(const ListNode<std::size_t> *storage_specifiers, MemberModelItem item);
+  void applyFunctionSpecifiers(const ListNode<std::size_t> *it, FunctionModelItem item);
+
+  void updateItemPosition(CodeModelItem item, AST *node);
+
+private:
+  CodeModel *_M_model;
+  LocationManager &_M_location;
+  TokenStream *_M_token_stream;
+  Control *_M_control;
+
+  CodeModel::FunctionType _M_current_function_type;
+  CodeModel::AccessPolicy _M_current_access;
+  FileModelItem _M_current_file;
+  NamespaceModelItem _M_current_namespace;
+  ClassModelItem _M_current_class;
+  FunctionDefinitionModelItem _M_current_function;
+  EnumModelItem _M_current_enum;
+  QStringList _M_context;
+  TemplateParameterList _M_current_template_parameters; // ### check me
+  QHash<QString, QString> _M_qualified_types;
+  QHash<QString, int> _M_anonymous_enums;
+
+    static MessageHandler _M_message_handler;
+
+protected:
+  TypeCompiler type_cc;
+  NameCompiler name_cc;
+  DeclaratorCompiler decl_cc;
+};
+
+#endif // BINDER_H
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/class_compiler.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,84 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+** Copyright (C) 2002-2005 Roberto Raggi <roberto@kdevelop.org>
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+
+#include "class_compiler.h"
+#include "lexer.h"
+#include "binder.h"
+
+ClassCompiler::ClassCompiler(Binder *binder)
+  : _M_binder (binder),
+     _M_token_stream(binder->tokenStream ()),
+     name_cc(_M_binder),
+     type_cc(_M_binder)
+{
+}
+
+ClassCompiler::~ClassCompiler()
+{
+}
+
+void ClassCompiler::run(ClassSpecifierAST *node)
+{
+  name_cc.run(node->name);
+  _M_name = name_cc.name();
+  _M_base_classes.clear();
+
+  visit(node);
+}
+
+void ClassCompiler::visitClassSpecifier(ClassSpecifierAST *node)
+{
+  visit(node->base_clause);
+}
+
+void ClassCompiler::visitBaseSpecifier(BaseSpecifierAST *node)
+{
+  name_cc.run(node->name);
+  QString name = name_cc.name();
+
+  if (! name.isEmpty())
+    _M_base_classes.append(name);
+}
+
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/class_compiler.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,83 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+** Copyright (C) 2002-2005 Roberto Raggi <roberto@kdevelop.org>
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+
+#ifndef CLASS_COMPILER_H
+#define CLASS_COMPILER_H
+
+#include <QtCore/qglobal.h>
+#include <QtCore/QStringList>
+
+#include "default_visitor.h"
+#include "name_compiler.h"
+#include "type_compiler.h"
+
+class TokenStream;
+class Binder;
+
+class ClassCompiler: protected DefaultVisitor
+{
+public:
+  ClassCompiler(Binder *binder);
+  virtual ~ClassCompiler();
+
+  inline QString name() const { return _M_name; }
+  inline QStringList baseClasses() const { return _M_base_classes; }
+
+  void run(ClassSpecifierAST *node);
+
+protected:
+  virtual void visitClassSpecifier(ClassSpecifierAST *node);
+  virtual void visitBaseSpecifier(BaseSpecifierAST *node);
+
+private:
+  Binder *_M_binder;
+  TokenStream *_M_token_stream;
+  QString _M_name;
+  QStringList _M_base_classes;
+  NameCompiler name_cc;
+  TypeCompiler type_cc;
+};
+
+#endif // CLASS_COMPILER_H
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/codemodel.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,969 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+** Copyright (C) 2002-2005 Roberto Raggi <roberto@kdevelop.org>
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+
+#include "codemodel.h"
+
+// ---------------------------------------------------------------------------
+CodeModel::CodeModel()
+  : _M_creation_id(0)
+{
+  _M_globalNamespace = create<NamespaceModelItem>();
+}
+
+CodeModel::~CodeModel()
+{
+}
+
+void CodeModel::wipeout()
+{
+  _M_globalNamespace = create<NamespaceModelItem>();
+  _M_files.clear();
+}
+
+FileList CodeModel::files() const
+{
+  return _M_files.values();
+}
+
+NamespaceModelItem CodeModel::globalNamespace() const
+{
+  return _M_globalNamespace;
+}
+
+void CodeModel::addFile(FileModelItem item)
+{
+  _M_creation_id = 0; // reset the creation id
+  _M_files.insert(item->name(), item);
+}
+
+void CodeModel::removeFile(FileModelItem item)
+{
+  QHash<QString, FileModelItem>::Iterator it = _M_files.find(item->name());
+
+  if (it != _M_files.end() && it.value() == item)
+    _M_files.erase(it);
+}
+
+FileModelItem CodeModel::findFile(const QString &name) const
+{
+  return _M_files.value(name);
+}
+
+QHash<QString, FileModelItem> CodeModel::fileMap() const
+{
+  return _M_files;
+}
+
+CodeModelItem CodeModel::findItem(const QStringList &qualifiedName, CodeModelItem scope) const
+{
+  for (int i=0; i<qualifiedName.size(); ++i) {
+    // ### Extend to look for members etc too.
+    const QString &name = qualifiedName.at(i);
+
+    if (NamespaceModelItem ns = model_dynamic_cast<NamespaceModelItem>(scope))
+      {
+        if (NamespaceModelItem tmp_ns = ns->findNamespace(name)) {
+          scope = tmp_ns;
+          continue;
+        }
+      }
+
+    if (ScopeModelItem ss = model_dynamic_cast<ScopeModelItem>(scope))
+      {
+        if (ClassModelItem cs = ss->findClass(name))
+          {
+            scope = cs;
+          }
+        else if (EnumModelItem es = ss->findEnum(name))
+          {
+            if (i == qualifiedName.size () - 1)
+              return es->toItem();
+          }
+        else if (TypeAliasModelItem tp = ss->findTypeAlias(name))
+          {
+            if (i == qualifiedName.size () - 1)
+              return tp->toItem ();
+          }
+        else
+          {
+              // If we don't find the name in the scope chain we
+              // need to return an empty item to indicate failure...
+              return CodeModelItem();
+          }
+      }
+  }
+
+  return scope;
+}
+
+
+// ---------------------------------------------------------------------------
+TypeInfo TypeInfo::combine (const TypeInfo &__lhs, const TypeInfo &__rhs)
+{
+  TypeInfo __result = __lhs;
+
+  __result.setConstant (__result.isConstant () || __rhs.isConstant ());
+  __result.setVolatile (__result.isVolatile () || __rhs.isVolatile ());
+  __result.setReference (__result.isReference () || __rhs.isReference ());
+  __result.setIndirections (__result.indirections () + __rhs.indirections ());
+  __result.setArrayElements (__result.arrayElements () + __rhs.arrayElements ());
+
+  return __result;
+}
+
+TypeInfo TypeInfo::resolveType (TypeInfo const &__type, CodeModelItem __scope)
+{
+    CodeModel *__model = __scope->model ();
+    Q_ASSERT (__model != 0);
+
+    CodeModelItem __item = __model->findItem (__type.qualifiedName (), __scope);
+
+    // Copy the type and replace with the proper qualified name. This
+    // only makes sence to do if we're actually getting a resolved
+    // type with a namespace. We only get this if the returned type
+    // has more than 2 entries in the qualified name... This test
+    // could be improved by returning if the type was found or not.
+    TypeInfo otherType(__type);
+    if (__item && __item->qualifiedName().size() > 1) {
+        otherType.setQualifiedName(__item->qualifiedName());
+    }
+
+    if (TypeAliasModelItem __alias = model_dynamic_cast<TypeAliasModelItem> (__item))
+        return resolveType (TypeInfo::combine (__alias->type (), otherType), __scope);
+
+    return otherType;
+}
+
+QString TypeInfo::toString() const
+{
+  QString tmp;
+
+  tmp += m_qualifiedName.join("::");
+  if (isConstant())
+    tmp += QLatin1String(" const");
+
+  if (isVolatile())
+    tmp += QLatin1String(" volatile");
+
+  if (indirections())
+    tmp += QString(indirections(), QLatin1Char('*'));
+
+  if (isReference())
+    tmp += QLatin1Char('&');
+
+  if (isFunctionPointer())
+    {
+      tmp += QLatin1String(" (*)(");
+      for (int i=0; i<m_arguments.count(); ++i)
+        {
+          if (i != 0)
+            tmp += QLatin1String(", ");
+
+          tmp += m_arguments.at(i).toString();
+        }
+      tmp += QLatin1String(")");
+    }
+
+  foreach (QString elt, arrayElements ())
+    {
+      tmp += QLatin1String ("[");
+      tmp += elt;
+      tmp += QLatin1String ("]");
+    }
+
+  return tmp;
+}
+
+bool TypeInfo::operator==(const TypeInfo &other)
+{
+  if (arrayElements().count() != other.arguments().count())
+    return false;
+
+#if defined (RXX_CHECK_ARRAY_ELEMENTS) // ### it'll break
+  for (int i=0; i<arrayElements().count(); ++i)
+    {
+      QString elt1 = arrayElements ().at (i).trimmed ();
+      QString elt2 = other.arrayElements ().at (i).trimmed ();
+
+      if (elt1 != elt2)
+        return false;
+    }
+#endif
+
+  return flags == other.flags
+    && m_qualifiedName == other.m_qualifiedName
+    && (!m_functionPointer || m_arguments == other.m_arguments);
+}
+
+// ---------------------------------------------------------------------------
+_CodeModelItem::_CodeModelItem(CodeModel *model, int kind)
+  : _M_model(model),
+    _M_kind(kind),
+    _M_startLine(0),
+    _M_startColumn(0),
+    _M_endLine(0),
+    _M_endColumn(0),
+    _M_creation_id(0)
+{
+}
+
+_CodeModelItem::~_CodeModelItem()
+{
+}
+
+CodeModelItem _CodeModelItem::toItem() const
+{
+  return CodeModelItem(const_cast<_CodeModelItem*>(this));
+}
+
+int _CodeModelItem::kind() const
+{
+  return _M_kind;
+}
+
+void _CodeModelItem::setKind(int kind)
+{
+  _M_kind = kind;
+}
+
+QStringList _CodeModelItem::qualifiedName() const
+{
+  QStringList q = scope();
+
+  if (!name().isEmpty())
+    q += name();
+
+  return q;
+}
+
+QString _CodeModelItem::name() const
+{
+  return _M_name;
+}
+
+void _CodeModelItem::setName(const QString &name)
+{
+  _M_name = name;
+}
+
+QStringList _CodeModelItem::scope() const
+{
+  return _M_scope;
+}
+
+void _CodeModelItem::setScope(const QStringList &scope)
+{
+  _M_scope = scope;
+}
+
+QString _CodeModelItem::fileName() const
+{
+  return _M_fileName;
+}
+
+void _CodeModelItem::setFileName(const QString &fileName)
+{
+  _M_fileName = fileName;
+}
+
+FileModelItem _CodeModelItem::file() const
+{
+  return model()->findFile(fileName());
+}
+
+void _CodeModelItem::getStartPosition(int *line, int *column)
+{
+  *line = _M_startLine;
+  *column = _M_startColumn;
+}
+
+void _CodeModelItem::setStartPosition(int line, int column)
+{
+  _M_startLine = line;
+  _M_startColumn = column;
+}
+
+void _CodeModelItem::getEndPosition(int *line, int *column)
+{
+  *line = _M_endLine;
+  *column = _M_endColumn;
+}
+
+void _CodeModelItem::setEndPosition(int line, int column)
+{
+  _M_endLine = line;
+  _M_endColumn = column;
+}
+
+// ---------------------------------------------------------------------------
+QStringList _ClassModelItem::baseClasses() const
+{
+  return _M_baseClasses;
+}
+
+void _ClassModelItem::setBaseClasses(const QStringList &baseClasses)
+{
+  _M_baseClasses = baseClasses;
+}
+
+TemplateParameterList _ClassModelItem::templateParameters() const
+{
+  return _M_templateParameters;
+}
+
+void _ClassModelItem::setTemplateParameters(const TemplateParameterList &templateParameters)
+{
+  _M_templateParameters = templateParameters;
+}
+
+void _ClassModelItem::addBaseClass(const QString &baseClass)
+{
+  _M_baseClasses.append(baseClass);
+}
+
+void _ClassModelItem::removeBaseClass(const QString &baseClass)
+{
+  _M_baseClasses.removeAt(_M_baseClasses.indexOf(baseClass));
+}
+
+bool _ClassModelItem::extendsClass(const QString &name) const
+{
+  return _M_baseClasses.contains(name);
+}
+
+void _ClassModelItem::setClassType(CodeModel::ClassType type)
+{
+  _M_classType = type;
+}
+
+CodeModel::ClassType _ClassModelItem::classType() const
+{
+  return _M_classType;
+}
+
+void _ClassModelItem::addPropertyDeclaration(const QString &propertyDeclaration)
+{
+    _M_propertyDeclarations << propertyDeclaration;
+}
+
+
+// ---------------------------------------------------------------------------
+FunctionModelItem _ScopeModelItem::declaredFunction(FunctionModelItem item)
+{
+  FunctionList function_list = findFunctions(item->name());
+
+  foreach (FunctionModelItem fun, function_list)
+    {
+      if (fun->isSimilar(item))
+        return fun;
+    }
+
+  return FunctionModelItem();
+}
+
+ClassList _ScopeModelItem::classes() const
+{
+  return _M_classes.values();
+}
+
+TypeAliasList _ScopeModelItem::typeAliases() const
+{
+  return _M_typeAliases.values();
+}
+
+VariableList _ScopeModelItem::variables() const
+{
+  return _M_variables.values();
+}
+
+FunctionList _ScopeModelItem::functions() const
+{
+  return _M_functions.values();
+}
+
+void _ScopeModelItem::addEnumsDeclaration(const QString &enumsDeclaration)
+{
+    _M_enumsDeclarations << enumsDeclaration;
+}
+
+FunctionDefinitionList _ScopeModelItem::functionDefinitions() const
+{
+  return _M_functionDefinitions.values();
+}
+
+EnumList _ScopeModelItem::enums() const
+{
+  return _M_enums.values();
+}
+
+void _ScopeModelItem::addClass(ClassModelItem item)
+{
+ QString name = item->name();
+ int idx = name.indexOf("<");
+ if (idx > 0)
+     _M_classes.insert(name.left(idx), item);
+  _M_classes.insert(name, item);
+}
+
+void _ScopeModelItem::addFunction(FunctionModelItem item)
+{
+  _M_functions.insert(item->name(), item);
+}
+
+void _ScopeModelItem::addFunctionDefinition(FunctionDefinitionModelItem item)
+{
+  _M_functionDefinitions.insert(item->name(), item);
+}
+
+void _ScopeModelItem::addVariable(VariableModelItem item)
+{
+  _M_variables.insert(item->name(), item);
+}
+
+void _ScopeModelItem::addTypeAlias(TypeAliasModelItem item)
+{
+  _M_typeAliases.insert(item->name(), item);
+}
+
+void _ScopeModelItem::addEnum(EnumModelItem item)
+{
+  _M_enums.insert(item->name(), item);
+}
+
+void _ScopeModelItem::removeClass(ClassModelItem item)
+{
+  QHash<QString, ClassModelItem>::Iterator it = _M_classes.find(item->name());
+
+  if (it != _M_classes.end() && it.value() == item)
+    _M_classes.erase(it);
+}
+
+void _ScopeModelItem::removeFunction(FunctionModelItem item)
+{
+  QMultiHash<QString, FunctionModelItem>::Iterator it = _M_functions.find(item->name());
+
+  while (it != _M_functions.end() && it.key() == item->name()
+         && it.value() != item)
+    {
+      ++it;
+    }
+
+  if (it != _M_functions.end() && it.value() == item)
+    {
+      _M_functions.erase(it);
+    }
+}
+
+void _ScopeModelItem::removeFunctionDefinition(FunctionDefinitionModelItem item)
+{
+  QMultiHash<QString, FunctionDefinitionModelItem>::Iterator it = _M_functionDefinitions.find(item->name());
+
+  while (it != _M_functionDefinitions.end() && it.key() == item->name()
+         && it.value() != item)
+    {
+      ++it;
+    }
+
+  if (it != _M_functionDefinitions.end() && it.value() == item)
+    {
+      _M_functionDefinitions.erase(it);
+    }
+}
+
+void _ScopeModelItem::removeVariable(VariableModelItem item)
+{
+  QHash<QString, VariableModelItem>::Iterator it = _M_variables.find(item->name());
+
+  if (it != _M_variables.end() && it.value() == item)
+    _M_variables.erase(it);
+}
+
+void _ScopeModelItem::removeTypeAlias(TypeAliasModelItem item)
+{
+  QHash<QString, TypeAliasModelItem>::Iterator it = _M_typeAliases.find(item->name());
+
+  if (it != _M_typeAliases.end() && it.value() == item)
+    _M_typeAliases.erase(it);
+}
+
+void _ScopeModelItem::removeEnum(EnumModelItem item)
+{
+  QHash<QString, EnumModelItem>::Iterator it = _M_enums.find(item->name());
+
+  if (it != _M_enums.end() && it.value() == item)
+    _M_enums.erase(it);
+}
+
+ClassModelItem _ScopeModelItem::findClass(const QString &name) const
+{
+  return _M_classes.value(name);
+}
+
+VariableModelItem _ScopeModelItem::findVariable(const QString &name) const
+{
+  return _M_variables.value(name);
+}
+
+TypeAliasModelItem _ScopeModelItem::findTypeAlias(const QString &name) const
+{
+  return _M_typeAliases.value(name);
+}
+
+EnumModelItem _ScopeModelItem::findEnum(const QString &name) const
+{
+  return _M_enums.value(name);
+}
+
+FunctionList _ScopeModelItem::findFunctions(const QString &name) const
+{
+  return _M_functions.values(name);
+}
+
+FunctionDefinitionList _ScopeModelItem::findFunctionDefinitions(const QString &name) const
+{
+  return _M_functionDefinitions.values(name);
+}
+
+// ---------------------------------------------------------------------------
+NamespaceList _NamespaceModelItem::namespaces() const
+{
+  return _M_namespaces.values();
+}
+void _NamespaceModelItem::addNamespace(NamespaceModelItem item)
+{
+  _M_namespaces.insert(item->name(), item);
+}
+void _NamespaceModelItem::removeNamespace(NamespaceModelItem item)
+{
+  QHash<QString, NamespaceModelItem>::Iterator it = _M_namespaces.find(item->name());
+
+  if (it != _M_namespaces.end() && it.value() == item)
+    _M_namespaces.erase(it);
+}
+
+NamespaceModelItem _NamespaceModelItem::findNamespace(const QString &name) const
+{
+  return _M_namespaces.value(name);
+}
+
+// ---------------------------------------------------------------------------
+TypeInfo _ArgumentModelItem::type() const
+{
+  return _M_type;
+}
+
+void _ArgumentModelItem::setType(const TypeInfo &type)
+{
+  _M_type = type;
+}
+
+bool _ArgumentModelItem::defaultValue() const
+{
+  return _M_defaultValue;
+}
+
+void _ArgumentModelItem::setDefaultValue(bool defaultValue)
+{
+  _M_defaultValue = defaultValue;
+}
+
+// ---------------------------------------------------------------------------
+bool _FunctionModelItem::isSimilar(FunctionModelItem other) const
+{
+  if (name() != other->name())
+    return false;
+
+  if (isConstant() != other->isConstant())
+    return false;
+
+  if (isVariadics() != other->isVariadics())
+    return false;
+
+  if (arguments().count() != other->arguments().count())
+    return false;
+
+  // ### check the template parameters
+
+  for (int i=0; i<arguments().count(); ++i)
+    {
+      ArgumentModelItem arg1 = arguments().at(i);
+      ArgumentModelItem arg2 = other->arguments().at(i);
+
+      if (arg1->type() != arg2->type())
+        return false;
+    }
+
+  return true;
+}
+
+ArgumentList _FunctionModelItem::arguments() const
+{
+  return _M_arguments;
+}
+
+void _FunctionModelItem::addArgument(ArgumentModelItem item)
+{
+  _M_arguments.append(item);
+}
+
+void _FunctionModelItem::removeArgument(ArgumentModelItem item)
+{
+  _M_arguments.removeAt(_M_arguments.indexOf(item));
+}
+
+CodeModel::FunctionType _FunctionModelItem::functionType() const
+{
+  return _M_functionType;
+}
+
+void _FunctionModelItem::setFunctionType(CodeModel::FunctionType functionType)
+{
+  _M_functionType = functionType;
+}
+
+bool _FunctionModelItem::isVariadics() const
+{
+  return _M_isVariadics;
+}
+
+void _FunctionModelItem::setVariadics(bool isVariadics)
+{
+  _M_isVariadics = isVariadics;
+}
+
+bool _FunctionModelItem::isVirtual() const
+{
+  return _M_isVirtual;
+}
+
+void _FunctionModelItem::setVirtual(bool isVirtual)
+{
+  _M_isVirtual = isVirtual;
+}
+
+bool _FunctionModelItem::isInline() const
+{
+  return _M_isInline;
+}
+
+void _FunctionModelItem::setInline(bool isInline)
+{
+  _M_isInline = isInline;
+}
+
+bool _FunctionModelItem::isExplicit() const
+{
+  return _M_isExplicit;
+}
+
+void _FunctionModelItem::setExplicit(bool isExplicit)
+{
+  _M_isExplicit = isExplicit;
+}
+
+bool _FunctionModelItem::isAbstract() const
+{
+  return _M_isAbstract;
+}
+
+void _FunctionModelItem::setAbstract(bool isAbstract)
+{
+  _M_isAbstract = isAbstract;
+}
+
+// Qt
+bool _FunctionModelItem::isInvokable() const
+{
+    return _M_isInvokable;
+}
+
+void _FunctionModelItem::setInvokable(bool isInvokable)
+{
+    _M_isInvokable = isInvokable;
+}
+
+// ---------------------------------------------------------------------------
+TypeInfo _TypeAliasModelItem::type() const
+{
+  return _M_type;
+}
+
+void _TypeAliasModelItem::setType(const TypeInfo &type)
+{
+  _M_type = type;
+}
+
+// ---------------------------------------------------------------------------
+CodeModel::AccessPolicy _EnumModelItem::accessPolicy() const
+{
+  return _M_accessPolicy;
+}
+
+void _EnumModelItem::setAccessPolicy(CodeModel::AccessPolicy accessPolicy)
+{
+  _M_accessPolicy = accessPolicy;
+}
+
+EnumeratorList _EnumModelItem::enumerators() const
+{
+  return _M_enumerators;
+}
+
+void _EnumModelItem::addEnumerator(EnumeratorModelItem item)
+{
+  _M_enumerators.append(item);
+}
+
+void _EnumModelItem::removeEnumerator(EnumeratorModelItem item)
+{
+  _M_enumerators.removeAt(_M_enumerators.indexOf(item));
+}
+
+// ---------------------------------------------------------------------------
+QString _EnumeratorModelItem::value() const
+{
+  return _M_value;
+}
+
+void _EnumeratorModelItem::setValue(const QString &value)
+{
+  _M_value = value;
+}
+
+// ---------------------------------------------------------------------------
+TypeInfo _TemplateParameterModelItem::type() const
+{
+  return _M_type;
+}
+
+void _TemplateParameterModelItem::setType(const TypeInfo &type)
+{
+  _M_type = type;
+}
+
+bool _TemplateParameterModelItem::defaultValue() const
+{
+  return _M_defaultValue;
+}
+
+void _TemplateParameterModelItem::setDefaultValue(bool defaultValue)
+{
+  _M_defaultValue = defaultValue;
+}
+
+// ---------------------------------------------------------------------------
+ScopeModelItem _ScopeModelItem::create(CodeModel *model)
+{
+  ScopeModelItem item(new _ScopeModelItem(model));
+  return item;
+}
+
+ClassModelItem _ClassModelItem::create(CodeModel *model)
+{
+  ClassModelItem item(new _ClassModelItem(model));
+  return item;
+}
+
+NamespaceModelItem _NamespaceModelItem::create(CodeModel *model)
+{
+  NamespaceModelItem item(new _NamespaceModelItem(model));
+  return item;
+}
+
+FileModelItem _FileModelItem::create(CodeModel *model)
+{
+  FileModelItem item(new _FileModelItem(model));
+  return item;
+}
+
+ArgumentModelItem _ArgumentModelItem::create(CodeModel *model)
+{
+  ArgumentModelItem item(new _ArgumentModelItem(model));
+  return item;
+}
+
+FunctionModelItem _FunctionModelItem::create(CodeModel *model)
+{
+  FunctionModelItem item(new _FunctionModelItem(model));
+  return item;
+}
+
+FunctionDefinitionModelItem _FunctionDefinitionModelItem::create(CodeModel *model)
+{
+  FunctionDefinitionModelItem item(new _FunctionDefinitionModelItem(model));
+  return item;
+}
+
+VariableModelItem _VariableModelItem::create(CodeModel *model)
+{
+  VariableModelItem item(new _VariableModelItem(model));
+  return item;
+}
+
+TypeAliasModelItem _TypeAliasModelItem::create(CodeModel *model)
+{
+  TypeAliasModelItem item(new _TypeAliasModelItem(model));
+  return item;
+}
+
+EnumModelItem _EnumModelItem::create(CodeModel *model)
+{
+  EnumModelItem item(new _EnumModelItem(model));
+  return item;
+}
+
+EnumeratorModelItem _EnumeratorModelItem::create(CodeModel *model)
+{
+  EnumeratorModelItem item(new _EnumeratorModelItem(model));
+  return item;
+}
+
+TemplateParameterModelItem _TemplateParameterModelItem::create(CodeModel *model)
+{
+  TemplateParameterModelItem item(new _TemplateParameterModelItem(model));
+  return item;
+}
+
+// ---------------------------------------------------------------------------
+TypeInfo _MemberModelItem::type() const
+{
+  return _M_type;
+}
+
+void _MemberModelItem::setType(const TypeInfo &type)
+{
+  _M_type = type;
+}
+
+CodeModel::AccessPolicy _MemberModelItem::accessPolicy() const
+{
+  return _M_accessPolicy;
+}
+
+void _MemberModelItem::setAccessPolicy(CodeModel::AccessPolicy accessPolicy)
+{
+  _M_accessPolicy = accessPolicy;
+}
+
+bool _MemberModelItem::isStatic() const
+{
+  return _M_isStatic;
+}
+
+void _MemberModelItem::setStatic(bool isStatic)
+{
+  _M_isStatic = isStatic;
+}
+
+bool _MemberModelItem::isConstant() const
+{
+  return _M_isConstant;
+}
+
+void _MemberModelItem::setConstant(bool isConstant)
+{
+  _M_isConstant = isConstant;
+}
+
+bool _MemberModelItem::isVolatile() const
+{
+  return _M_isVolatile;
+}
+
+void _MemberModelItem::setVolatile(bool isVolatile)
+{
+  _M_isVolatile = isVolatile;
+}
+
+bool _MemberModelItem::isAuto() const
+{
+  return _M_isAuto;
+}
+
+void _MemberModelItem::setAuto(bool isAuto)
+{
+  _M_isAuto = isAuto;
+}
+
+bool _MemberModelItem::isFriend() const
+{
+  return _M_isFriend;
+}
+
+void _MemberModelItem::setFriend(bool isFriend)
+{
+  _M_isFriend = isFriend;
+}
+
+bool _MemberModelItem::isRegister() const
+{
+  return _M_isRegister;
+}
+
+void _MemberModelItem::setRegister(bool isRegister)
+{
+  _M_isRegister = isRegister;
+}
+
+bool _MemberModelItem::isExtern() const
+{
+  return _M_isExtern;
+}
+
+void _MemberModelItem::setExtern(bool isExtern)
+{
+  _M_isExtern = isExtern;
+}
+
+bool _MemberModelItem::isMutable() const
+{
+  return _M_isMutable;
+}
+
+void _MemberModelItem::setMutable(bool isMutable)
+{
+  _M_isMutable = isMutable;
+}
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/codemodel.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,766 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+** Copyright (C) 2002-2005 Roberto Raggi <roberto@kdevelop.org>
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+
+#ifndef CODEMODEL_H
+#define CODEMODEL_H
+
+#include "codemodel_fwd.h"
+#include <codemodel_pointer.h>
+
+#include <QtCore/QHash>
+#include <QtCore/QList>
+#include <QtCore/QString>
+#include <QtCore/QStringList>
+#include <QtCore/QVector>
+
+#define DECLARE_MODEL_NODE(k) \
+    enum { __node_kind = Kind_##k }; \
+    typedef CodeModelPointer<k##ModelItem> Pointer;
+
+template <class _Target, class _Source>
+_Target model_static_cast(_Source item)
+{
+  typedef typename _Target::Type * _Target_pointer;
+
+  _Target ptr (static_cast<_Target_pointer>(item.data()));
+  return ptr;
+}
+
+class CodeModel
+{
+public:
+  enum AccessPolicy
+  {
+    Public,
+    Protected,
+    Private
+  };
+
+  enum FunctionType
+  {
+    Normal,
+    Signal,
+    Slot
+  };
+
+  enum ClassType
+  {
+    Class,
+    Struct,
+    Union
+  };
+
+public:
+  CodeModel();
+  virtual ~CodeModel();
+
+  template <class _Target> _Target create()
+  {
+    typedef typename _Target::Type _Target_type;
+
+    _Target result = _Target_type::create(this);
+    result->setCreationId(_M_creation_id++);
+    return result;
+  }
+
+  FileList files() const;
+  NamespaceModelItem globalNamespace() const;
+
+  void addFile(FileModelItem item);
+  void removeFile(FileModelItem item);
+  FileModelItem findFile(const QString &name) const;
+  QHash<QString, FileModelItem> fileMap() const;
+
+  CodeModelItem findItem(const QStringList &qualifiedName, CodeModelItem scope) const;
+
+  void wipeout();
+
+private:
+  QHash<QString, FileModelItem> _M_files;
+  NamespaceModelItem _M_globalNamespace;
+  std::size_t _M_creation_id;
+
+private:
+  CodeModel(const CodeModel &other);
+  void operator = (const CodeModel &other);
+};
+
+class TypeInfo
+{
+public:
+  TypeInfo(const TypeInfo &other)
+    : flags(other.flags),
+      m_qualifiedName(other.m_qualifiedName),
+      m_arrayElements(other.m_arrayElements),
+      m_arguments(other.m_arguments)
+  {
+  }
+
+  TypeInfo():
+    flags (0) {}
+
+  QStringList qualifiedName() const { return m_qualifiedName; }
+  void setQualifiedName(const QStringList &qualified_name) { m_qualifiedName = qualified_name; }
+
+  bool isConstant() const { return m_constant; }
+  void setConstant(bool is) { m_constant = is; }
+
+  bool isVolatile() const { return m_volatile; }
+  void setVolatile(bool is) { m_volatile = is; }
+
+  bool isReference() const { return m_reference; }
+  void setReference(bool is) { m_reference = is; }
+
+  int indirections() const { return m_indirections; }
+  void setIndirections(int indirections) { m_indirections = indirections; }
+
+  bool isFunctionPointer() const { return m_functionPointer; }
+  void setFunctionPointer(bool is) { m_functionPointer = is; }
+
+  QStringList arrayElements() const { return m_arrayElements; }
+  void setArrayElements(const QStringList &arrayElements) { m_arrayElements = arrayElements; }
+
+  QList<TypeInfo> arguments() const { return m_arguments; }
+  void setArguments(const QList<TypeInfo> &arguments);
+  void addArgument(const TypeInfo &arg) { m_arguments.append(arg); }
+
+  bool operator==(const TypeInfo &other);
+  bool operator!=(const TypeInfo &other) { return !(*this==other); }
+
+  // ### arrays and templates??
+
+  QString toString() const;
+
+  static TypeInfo combine (const TypeInfo &__lhs, const TypeInfo &__rhs);
+  static TypeInfo resolveType (TypeInfo const &__type, CodeModelItem __scope);
+
+private:
+  union
+  {
+    uint flags;
+
+    struct
+    {
+      uint m_constant: 1;
+      uint m_volatile: 1;
+      uint m_reference: 1;
+      uint m_functionPointer: 1;
+      uint m_indirections: 6;
+      uint m_padding: 22;
+    };
+  };
+
+  QStringList m_qualifiedName;
+  QStringList m_arrayElements;
+  QList<TypeInfo> m_arguments;
+};
+
+class _CodeModelItem: public QSharedData
+{
+public:
+  enum Kind
+  {
+    /* These are bit-flags resembling inheritance */
+    Kind_Scope = 0x1,
+    Kind_Namespace = 0x2 | Kind_Scope,
+    Kind_Member = 0x4,
+    Kind_Function = 0x8 | Kind_Member,
+    KindMask = 0xf,
+
+    /* These are for classes that are not inherited from */
+    FirstKind = 0x8,
+    Kind_Argument = 1 << FirstKind,
+    Kind_Class = 2 << FirstKind | Kind_Scope,
+    Kind_Enum = 3 << FirstKind,
+    Kind_Enumerator = 4 << FirstKind,
+    Kind_File = 5 << FirstKind | Kind_Namespace,
+    Kind_FunctionDefinition = 6 << FirstKind | Kind_Function,
+    Kind_TemplateParameter = 7 << FirstKind,
+    Kind_TypeAlias = 8 << FirstKind,
+    Kind_Variable = 9 << FirstKind | Kind_Member
+  };
+
+public:
+  virtual ~_CodeModelItem();
+
+  int kind() const;
+
+  QStringList qualifiedName() const;
+
+  QString name() const;
+  void setName(const QString &name);
+
+  QStringList scope() const;
+  void setScope(const QStringList &scope);
+
+  QString fileName() const;
+  void setFileName(const QString &fileName);
+
+  FileModelItem file() const;
+
+  void getStartPosition(int *line, int *column);
+  void setStartPosition(int line, int column);
+
+  void getEndPosition(int *line, int *column);
+  void setEndPosition(int line, int column);
+
+  inline std::size_t creationId() const { return _M_creation_id; }
+  inline void setCreationId(std::size_t creation_id) { _M_creation_id = creation_id; }
+
+  inline CodeModel *model() const { return _M_model; }
+
+  CodeModelItem toItem() const;
+
+protected:
+  _CodeModelItem(CodeModel *model, int kind);
+  void setKind(int kind);
+
+private:
+  CodeModel *_M_model;
+  int _M_kind;
+  int _M_startLine;
+  int _M_startColumn;
+  int _M_endLine;
+  int _M_endColumn;
+  std::size_t _M_creation_id;
+  QString _M_name;
+  QString _M_fileName;
+  QStringList _M_scope;
+
+private:
+  _CodeModelItem(const _CodeModelItem &other);
+  void operator = (const _CodeModelItem &other);
+};
+
+class _ScopeModelItem: public _CodeModelItem
+{
+public:
+  DECLARE_MODEL_NODE(Scope)
+
+  static ScopeModelItem create(CodeModel *model);
+
+public:
+  ClassList classes() const;
+  EnumList enums() const;
+  FunctionDefinitionList functionDefinitions() const;
+  FunctionList functions() const;
+  TypeAliasList typeAliases() const;
+  VariableList variables() const;
+
+  void addClass(ClassModelItem item);
+  void addEnum(EnumModelItem item);
+  void addFunction(FunctionModelItem item);
+  void addFunctionDefinition(FunctionDefinitionModelItem item);
+  void addTypeAlias(TypeAliasModelItem item);
+  void addVariable(VariableModelItem item);
+
+  void removeClass(ClassModelItem item);
+  void removeEnum(EnumModelItem item);
+  void removeFunction(FunctionModelItem item);
+  void removeFunctionDefinition(FunctionDefinitionModelItem item);
+  void removeTypeAlias(TypeAliasModelItem item);
+  void removeVariable(VariableModelItem item);
+
+  ClassModelItem findClass(const QString &name) const;
+  EnumModelItem findEnum(const QString &name) const;
+  FunctionDefinitionList findFunctionDefinitions(const QString &name) const;
+  FunctionList findFunctions(const QString &name) const;
+  TypeAliasModelItem findTypeAlias(const QString &name) const;
+  VariableModelItem findVariable(const QString &name) const;
+
+  void addEnumsDeclaration(const QString &enumsDeclaration);
+  QStringList enumsDeclarations() const { return _M_enumsDeclarations; }
+
+  inline QHash<QString, ClassModelItem> classMap() const { return _M_classes; }
+  inline QHash<QString, EnumModelItem> enumMap() const { return _M_enums; }
+  inline QHash<QString, TypeAliasModelItem> typeAliasMap() const { return _M_typeAliases; }
+  inline QHash<QString, VariableModelItem> variableMap() const { return _M_variables; }
+  inline QMultiHash<QString, FunctionDefinitionModelItem> functionDefinitionMap() const { return _M_functionDefinitions; }
+  inline QMultiHash<QString, FunctionModelItem> functionMap() const { return _M_functions; }
+
+  FunctionModelItem declaredFunction(FunctionModelItem item);
+
+protected:
+  _ScopeModelItem(CodeModel *model, int kind = __node_kind)
+    : _CodeModelItem(model, kind) {}
+
+private:
+  QHash<QString, ClassModelItem> _M_classes;
+  QHash<QString, EnumModelItem> _M_enums;
+  QHash<QString, TypeAliasModelItem> _M_typeAliases;
+  QHash<QString, VariableModelItem> _M_variables;
+  QMultiHash<QString, FunctionDefinitionModelItem> _M_functionDefinitions;
+  QMultiHash<QString, FunctionModelItem> _M_functions;
+
+private:
+  _ScopeModelItem(const _ScopeModelItem &other);
+  void operator = (const _ScopeModelItem &other);
+
+  QStringList _M_enumsDeclarations;
+};
+
+class _ClassModelItem: public _ScopeModelItem
+{
+public:
+  DECLARE_MODEL_NODE(Class)
+
+  static ClassModelItem create(CodeModel *model);
+
+public:
+  QStringList baseClasses() const;
+
+  void setBaseClasses(const QStringList &baseClasses);
+  void addBaseClass(const QString &baseClass);
+  void removeBaseClass(const QString &baseClass);
+
+  TemplateParameterList templateParameters() const;
+  void setTemplateParameters(const TemplateParameterList &templateParameters);
+
+  bool extendsClass(const QString &name) const;
+
+  void setClassType(CodeModel::ClassType type);
+  CodeModel::ClassType classType() const;
+
+  void addPropertyDeclaration(const QString &propertyDeclaration);
+  QStringList propertyDeclarations() const { return _M_propertyDeclarations; }
+
+protected:
+  _ClassModelItem(CodeModel *model, int kind = __node_kind)
+    : _ScopeModelItem(model, kind), _M_classType(CodeModel::Class) {}
+
+private:
+  QStringList _M_baseClasses;
+  TemplateParameterList _M_templateParameters;
+  CodeModel::ClassType _M_classType;
+
+  QStringList _M_propertyDeclarations;
+
+private:
+  _ClassModelItem(const _ClassModelItem &other);
+  void operator = (const _ClassModelItem &other);
+};
+
+class _NamespaceModelItem: public _ScopeModelItem
+{
+public:
+  DECLARE_MODEL_NODE(Namespace)
+
+  static NamespaceModelItem create(CodeModel *model);
+
+public:
+  NamespaceList namespaces() const;
+
+  void addNamespace(NamespaceModelItem item);
+  void removeNamespace(NamespaceModelItem item);
+
+  NamespaceModelItem findNamespace(const QString &name) const;
+
+  inline QHash<QString, NamespaceModelItem> namespaceMap() const { return _M_namespaces; };
+
+protected:
+  _NamespaceModelItem(CodeModel *model, int kind = __node_kind)
+    : _ScopeModelItem(model, kind) {}
+
+private:
+  QHash<QString, NamespaceModelItem> _M_namespaces;
+
+private:
+  _NamespaceModelItem(const _NamespaceModelItem &other);
+  void operator = (const _NamespaceModelItem &other);
+};
+
+class _FileModelItem: public _NamespaceModelItem
+{
+public:
+  DECLARE_MODEL_NODE(File)
+
+  static FileModelItem create(CodeModel *model);
+
+protected:
+  _FileModelItem(CodeModel *model, int kind = __node_kind)
+    : _NamespaceModelItem(model, kind) {}
+
+private:
+  _FileModelItem(const _FileModelItem &other);
+  void operator = (const _FileModelItem &other);
+};
+
+class _ArgumentModelItem: public _CodeModelItem
+{
+public:
+  DECLARE_MODEL_NODE(Argument)
+
+  static ArgumentModelItem create(CodeModel *model);
+
+public:
+  TypeInfo type() const;
+  void setType(const TypeInfo &type);
+
+  bool defaultValue() const;
+  void setDefaultValue(bool defaultValue);
+
+  QString defaultValueExpression() const { return _M_defaultValueExpression; }
+  void setDefaultValueExpression(const QString &expr) { _M_defaultValueExpression = expr; }
+
+protected:
+  _ArgumentModelItem(CodeModel *model, int kind = __node_kind)
+    : _CodeModelItem(model, kind), _M_defaultValue(false) {}
+
+private:
+  TypeInfo _M_type;
+  QString _M_defaultValueExpression;
+  bool _M_defaultValue;
+
+private:
+  _ArgumentModelItem(const _ArgumentModelItem &other);
+  void operator = (const _ArgumentModelItem &other);
+};
+
+class _MemberModelItem: public _CodeModelItem
+{
+public:
+  DECLARE_MODEL_NODE(Member)
+
+  bool isConstant() const;
+  void setConstant(bool isConstant);
+
+  bool isVolatile() const;
+  void setVolatile(bool isVolatile);
+
+  bool isStatic() const;
+  void setStatic(bool isStatic);
+
+  bool isAuto() const;
+  void setAuto(bool isAuto);
+
+  bool isFriend() const;
+  void setFriend(bool isFriend);
+
+  bool isRegister() const;
+  void setRegister(bool isRegister);
+
+  bool isExtern() const;
+  void setExtern(bool isExtern);
+
+  bool isMutable() const;
+  void setMutable(bool isMutable);
+
+  CodeModel::AccessPolicy accessPolicy() const;
+  void setAccessPolicy(CodeModel::AccessPolicy accessPolicy);
+
+  TemplateParameterList templateParameters() const
+  { return _M_templateParameters; }
+
+  void setTemplateParameters(const TemplateParameterList &templateParameters)
+  { _M_templateParameters = templateParameters; }
+
+  TypeInfo type() const;
+  void setType(const TypeInfo &type);
+
+protected:
+  _MemberModelItem(CodeModel *model, int kind)
+    : _CodeModelItem(model, kind),
+      _M_accessPolicy(CodeModel::Public),
+      _M_flags(0)
+  {}
+
+private:
+  TemplateParameterList _M_templateParameters;
+  TypeInfo _M_type;
+  CodeModel::AccessPolicy _M_accessPolicy;
+  union
+  {
+    struct
+    {
+      uint _M_isConstant: 1;
+      uint _M_isVolatile: 1;
+      uint _M_isStatic: 1;
+      uint _M_isAuto: 1;
+      uint _M_isFriend: 1;
+      uint _M_isRegister: 1;
+      uint _M_isExtern: 1;
+      uint _M_isMutable: 1;
+    };
+    uint _M_flags;
+  };
+
+};
+
+class _FunctionModelItem: public _MemberModelItem
+{
+public:
+  DECLARE_MODEL_NODE(Function)
+
+  static FunctionModelItem create(CodeModel *model);
+
+public:
+  ArgumentList arguments() const;
+
+  void addArgument(ArgumentModelItem item);
+  void removeArgument(ArgumentModelItem item);
+
+  CodeModel::FunctionType functionType() const;
+  void setFunctionType(CodeModel::FunctionType functionType);
+
+  bool isVirtual() const;
+  void setVirtual(bool isVirtual);
+
+  bool isInline() const;
+  void setInline(bool isInline);
+
+  bool isExplicit() const;
+  void setExplicit(bool isExplicit);
+
+  bool isInvokable() const; // Qt
+  void setInvokable(bool isInvokable); // Qt
+
+  bool isAbstract() const;
+  void setAbstract(bool isAbstract);
+
+  bool isVariadics() const;
+  void setVariadics(bool isVariadics);
+
+  bool isSimilar(FunctionModelItem other) const;
+
+protected:
+  _FunctionModelItem(CodeModel *model, int kind = __node_kind)
+    : _MemberModelItem(model, kind),
+      _M_functionType(CodeModel::Normal),
+      _M_flags(0)
+  {}
+
+private:
+  ArgumentList _M_arguments;
+  CodeModel::FunctionType _M_functionType;
+  union
+  {
+    struct
+    {
+      uint _M_isVirtual: 1;
+      uint _M_isInline: 1;
+      uint _M_isAbstract: 1;
+      uint _M_isExplicit: 1;
+      uint _M_isVariadics: 1;
+      uint _M_isInvokable : 1; // Qt
+    };
+    uint _M_flags;
+  };
+
+private:
+  _FunctionModelItem(const _FunctionModelItem &other);
+  void operator = (const _FunctionModelItem &other);
+};
+
+class _FunctionDefinitionModelItem: public _FunctionModelItem
+{
+public:
+  DECLARE_MODEL_NODE(FunctionDefinition)
+
+  static FunctionDefinitionModelItem create(CodeModel *model);
+
+protected:
+  _FunctionDefinitionModelItem(CodeModel *model, int kind = __node_kind)
+    : _FunctionModelItem(model, kind) {}
+
+private:
+  _FunctionDefinitionModelItem(const _FunctionDefinitionModelItem &other);
+  void operator = (const _FunctionDefinitionModelItem &other);
+};
+
+class _VariableModelItem: public _MemberModelItem
+{
+public:
+  DECLARE_MODEL_NODE(Variable)
+
+  static VariableModelItem create(CodeModel *model);
+
+protected:
+  _VariableModelItem(CodeModel *model, int kind = __node_kind)
+    : _MemberModelItem(model, kind)
+  {}
+
+private:
+  _VariableModelItem(const _VariableModelItem &other);
+  void operator = (const _VariableModelItem &other);
+};
+
+class _TypeAliasModelItem: public _CodeModelItem
+{
+public:
+  DECLARE_MODEL_NODE(TypeAlias)
+
+  static TypeAliasModelItem create(CodeModel *model);
+
+public:
+  TypeInfo type() const;
+  void setType(const TypeInfo &type);
+
+protected:
+  _TypeAliasModelItem(CodeModel *model, int kind = __node_kind)
+    : _CodeModelItem(model, kind) {}
+
+private:
+  TypeInfo _M_type;
+
+private:
+  _TypeAliasModelItem(const _TypeAliasModelItem &other);
+  void operator = (const _TypeAliasModelItem &other);
+};
+
+class _EnumModelItem: public _CodeModelItem
+{
+public:
+  DECLARE_MODEL_NODE(Enum)
+
+  static EnumModelItem create(CodeModel *model);
+
+public:
+  CodeModel::AccessPolicy accessPolicy() const;
+  void setAccessPolicy(CodeModel::AccessPolicy accessPolicy);
+
+  EnumeratorList enumerators() const;
+  void addEnumerator(EnumeratorModelItem item);
+  void removeEnumerator(EnumeratorModelItem item);
+
+protected:
+  _EnumModelItem(CodeModel *model, int kind = __node_kind)
+    : _CodeModelItem(model, kind),
+      _M_accessPolicy(CodeModel::Public)
+  {}
+
+private:
+  CodeModel::AccessPolicy _M_accessPolicy;
+  EnumeratorList _M_enumerators;
+
+private:
+  _EnumModelItem(const _EnumModelItem &other);
+  void operator = (const _EnumModelItem &other);
+};
+
+class _EnumeratorModelItem: public _CodeModelItem
+{
+public:
+  DECLARE_MODEL_NODE(Enumerator)
+
+  static EnumeratorModelItem create(CodeModel *model);
+
+public:
+  QString value() const;
+  void setValue(const QString &value);
+
+protected:
+  _EnumeratorModelItem(CodeModel *model, int kind = __node_kind)
+    : _CodeModelItem(model, kind) {}
+
+private:
+  QString _M_value;
+
+private:
+  _EnumeratorModelItem(const _EnumeratorModelItem &other);
+  void operator = (const _EnumeratorModelItem &other);
+};
+
+class _TemplateParameterModelItem: public _CodeModelItem
+{
+public:
+  DECLARE_MODEL_NODE(TemplateParameter)
+
+  static TemplateParameterModelItem create(CodeModel *model);
+
+public:
+  TypeInfo type() const;
+  void setType(const TypeInfo &type);
+
+  bool defaultValue() const;
+  void setDefaultValue(bool defaultValue);
+
+protected:
+  _TemplateParameterModelItem(CodeModel *model, int kind = __node_kind)
+    : _CodeModelItem(model, kind), _M_defaultValue(false) {}
+
+private:
+  TypeInfo _M_type;
+  bool _M_defaultValue;
+
+private:
+  _TemplateParameterModelItem(const _TemplateParameterModelItem &other);
+  void operator = (const _TemplateParameterModelItem &other);
+};
+
+template <class _Target, class _Source>
+_Target model_safe_cast(_Source item)
+{
+  typedef typename _Target::Type * _Target_pointer;
+  typedef typename _Source::Type * _Source_pointer;
+
+  _Source_pointer source = item.data();
+  if (source && source->kind() == _Target_pointer(0)->__node_kind)
+    {
+      _Target ptr(static_cast<_Target_pointer>(source));
+      return ptr;
+    }
+
+  return _Target();
+}
+
+template <typename _Target, typename _Source>
+_Target model_dynamic_cast(_Source item)
+{
+  typedef typename _Target::Type * _Target_pointer;
+  typedef typename _Source::Type * _Source_pointer;
+
+  _Source_pointer source = item.data();
+  if (source && (source->kind() == _Target_pointer(0)->__node_kind
+         || (int(_Target_pointer(0)->__node_kind) <= int(_CodeModelItem::KindMask)
+             && ((source->kind() & _Target_pointer(0)->__node_kind)
+                  == _Target_pointer(0)->__node_kind))))
+    {
+      _Target ptr(static_cast<_Target_pointer>(source));
+      return ptr;
+    }
+
+  return _Target();
+}
+#endif // CODEMODEL_H
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/codemodel_finder.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,123 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+** Copyright (C) 2002-2005 Roberto Raggi <roberto@kdevelop.org>
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+
+#include "codemodel_finder.h"
+#include "codemodel.h"
+#include "binder.h"
+
+CodeModelFinder::CodeModelFinder(CodeModel *model, Binder *binder)
+  : _M_model(model),
+    _M_binder (binder),
+    _M_token_stream(binder->tokenStream ()),
+    name_cc(_M_binder),
+    _M_resolve_policy(ResolveItem)
+{
+}
+
+CodeModelFinder::~CodeModelFinder()
+{
+}
+
+ScopeModelItem CodeModelFinder::resolveScope(NameAST *name, ScopeModelItem scope)
+{
+  Q_ASSERT(scope != 0);
+
+  ResolvePolicy saved_resolve_policy = _M_resolve_policy;
+  _M_resolve_policy = ResolveScope;
+
+  ScopeModelItem old = changeCurrentScope(scope);
+
+  visit(name);
+  ScopeModelItem result = _M_current_scope;
+
+  changeCurrentScope(old); // restore
+
+  _M_resolve_policy = saved_resolve_policy;
+
+  return result;
+}
+
+ScopeModelItem CodeModelFinder::changeCurrentScope(ScopeModelItem scope)
+{
+  ScopeModelItem old = _M_current_scope;
+  _M_current_scope = scope;
+  return old;
+}
+
+void CodeModelFinder::visitName(NameAST *node)
+{
+  visitNodes(this, node->qualified_names);
+
+  if (_M_resolve_policy == ResolveItem)
+    visit(node->unqualified_name);
+}
+
+void CodeModelFinder::visitUnqualifiedName(UnqualifiedNameAST *node)
+{
+  if (!_M_current_scope)
+    {
+      // nothing to do
+      return;
+    }
+
+  name_cc.run(node);
+  QString id = name_cc.name();
+
+  if (ClassModelItem klass = _M_current_scope->findClass(id))
+    {
+      _M_current_scope = klass;
+    }
+  else if (NamespaceModelItem parentNamespace = model_safe_cast<NamespaceModelItem>(_M_current_scope))
+    {
+      NamespaceModelItem ns = parentNamespace->findNamespace(id);
+      _M_current_scope = model_static_cast<ScopeModelItem>(ns);
+    }
+  else if (FileModelItem file = model_safe_cast<FileModelItem>(_M_current_scope))
+    {
+      NamespaceModelItem ns = file->findNamespace(id);
+      _M_current_scope = model_static_cast<ScopeModelItem>(ns);
+    }
+  }
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/codemodel_finder.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,88 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+** Copyright (C) 2002-2005 Roberto Raggi <roberto@kdevelop.org>
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+
+#ifndef CODEMODEL_FINDER_H
+#define CODEMODEL_FINDER_H
+
+#include "default_visitor.h"
+#include "codemodel_fwd.h"
+#include "name_compiler.h"
+
+class TokenStream;
+class Binder;
+
+class CodeModelFinder: protected DefaultVisitor
+{
+  enum ResolvePolicy
+  {
+    ResolveScope,
+    ResolveItem
+  };
+
+public:
+  CodeModelFinder(CodeModel *model, Binder *binder);
+  virtual ~CodeModelFinder();
+
+  ScopeModelItem resolveScope(NameAST *name, ScopeModelItem scope);
+
+  inline CodeModel *model() const { return _M_model; }
+
+protected:
+  virtual void visitName(NameAST *node);
+  virtual void visitUnqualifiedName(UnqualifiedNameAST *node);
+
+  ScopeModelItem changeCurrentScope(ScopeModelItem scope);
+
+private:
+  CodeModel *_M_model;
+  Binder *_M_binder;
+  TokenStream *_M_token_stream;
+  NameCompiler name_cc;
+
+  ScopeModelItem _M_current_scope;
+  ResolvePolicy _M_resolve_policy;
+};
+
+#endif // CODEMODEL_FINDER_H
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/codemodel_fwd.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,98 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+** Copyright (C) 2002-2005 Roberto Raggi <roberto@kdevelop.org>
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+
+#ifndef CODEMODEL_FWD_H
+#define CODEMODEL_FWD_H
+
+#include <codemodel_pointer.h>
+#include <QtCore/QList>
+
+// forward declarations
+class CodeModel;
+class _ArgumentModelItem;
+class _ClassModelItem;
+class _CodeModelItem;
+class _EnumModelItem;
+class _EnumeratorModelItem;
+class _FileModelItem;
+class _FunctionDefinitionModelItem;
+class _FunctionModelItem;
+class _NamespaceModelItem;
+class _ScopeModelItem;
+class _TemplateParameterModelItem;
+class _TypeAliasModelItem;
+class _VariableModelItem;
+class _MemberModelItem;
+class TypeInfo;
+
+typedef CodeModelPointer<_ArgumentModelItem> ArgumentModelItem;
+typedef CodeModelPointer<_ClassModelItem> ClassModelItem;
+typedef CodeModelPointer<_CodeModelItem> CodeModelItem;
+typedef CodeModelPointer<_EnumModelItem> EnumModelItem;
+typedef CodeModelPointer<_EnumeratorModelItem> EnumeratorModelItem;
+typedef CodeModelPointer<_FileModelItem> FileModelItem;
+typedef CodeModelPointer<_FunctionDefinitionModelItem> FunctionDefinitionModelItem;
+typedef CodeModelPointer<_FunctionModelItem> FunctionModelItem;
+typedef CodeModelPointer<_NamespaceModelItem> NamespaceModelItem;
+typedef CodeModelPointer<_ScopeModelItem> ScopeModelItem;
+typedef CodeModelPointer<_TemplateParameterModelItem> TemplateParameterModelItem;
+typedef CodeModelPointer<_TypeAliasModelItem> TypeAliasModelItem;
+typedef CodeModelPointer<_VariableModelItem> VariableModelItem;
+typedef CodeModelPointer<_MemberModelItem> MemberModelItem;
+
+typedef QList<ArgumentModelItem> ArgumentList;
+typedef QList<ClassModelItem> ClassList;
+typedef QList<CodeModelItem> ItemList;
+typedef QList<EnumModelItem> EnumList;
+typedef QList<EnumeratorModelItem> EnumeratorList;
+typedef QList<FileModelItem> FileList;
+typedef QList<FunctionDefinitionModelItem> FunctionDefinitionList;
+typedef QList<FunctionModelItem> FunctionList;
+typedef QList<NamespaceModelItem> NamespaceList;
+typedef QList<ScopeModelItem> ScopeList;
+typedef QList<TemplateParameterModelItem> TemplateParameterList;
+typedef QList<TypeAliasModelItem> TypeAliasList;
+typedef QList<VariableModelItem> VariableList;
+typedef QList<MemberModelItem> MemberList;
+
+#endif // CODEMODEL_FWD_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/codemodel_pointer.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,132 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+** Copyright (C) 2006 Roberto Raggi <roberto@kdevelop.org>
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#ifndef CODEMODEL_POINTER_H
+#define CODEMODEL_POINTER_H
+
+#include <QtCore/QSharedData>
+
+// Since the atomic API changed in 4.4 we need to hack a little here
+// to make it work with both 4.3 and 4.4 until that is not required
+
+#if QT_VERSION >= 0x040400
+
+#   include <QtCore/qatomic.h>
+template <class T> class CodeModelPointer: public QAtomicPointer<T>
+
+#else
+
+template <class T> class CodeModelPointer
+
+#endif // QT_VERSION >= 0x040400
+
+{
+public:
+    typedef T Type;
+
+#if QT_VERSION < 0x040400
+    inline T &operator*() { return *d; }
+    inline const T &operator*() const { return *d; }
+    inline T *operator->() { return d; }
+    inline const T *operator->() const { return d; }
+    inline operator T *() { return d; }
+    inline operator const T *() const { return d; }
+    inline T *data() { return d; }
+    inline const T *data() const { return d; }
+    inline const T *constData() const { return d; }
+
+    inline bool operator==(const CodeModelPointer<T> &other) const { return d == other.d; }
+    inline bool operator!=(const CodeModelPointer<T> &other) const { return d != other.d; }
+    inline bool operator==(const T *ptr) const { return d == ptr; }
+    inline bool operator!=(const T *ptr) const { return d != ptr; }
+
+    inline CodeModelPointer() { d = 0; }
+    inline ~CodeModelPointer() { if (d && !d->ref.deref()) delete d; }
+
+    explicit CodeModelPointer(T *data);
+    inline CodeModelPointer(const CodeModelPointer<T> &o) : d(o.d) { if (d) d->ref.ref(); }
+    inline CodeModelPointer<T> & operator=(const CodeModelPointer<T> &o) {
+        if (o.d != d) {
+            T *x = o.d;
+            if (x) x->ref.ref();
+            x = qAtomicSetPtr(&d, x);
+            if (x && !x->ref.deref())
+                delete x;
+        }
+        return *this;
+    }
+    inline CodeModelPointer &operator=(T *o) {
+        if (o != d) {
+            T *x = o;
+            if (x) x->ref.ref();
+            x = qAtomicSetPtr(&d, x);
+            if (x && !x->ref.deref())
+                delete x;
+        }
+        return *this;
+    }
+
+    inline bool operator!() const { return !d; }
+
+private:
+    T *d;
+#else // QT_VERSION < 0x040400
+    inline CodeModelPointer(T *value = 0) : QAtomicPointer<T>(value) {}
+
+    inline CodeModelPointer &operator=(T *o) {
+        QAtomicPointer<T>::operator=(o);
+        return *this;
+    }
+
+    inline T *data() { return (T *) *this; }
+    inline const T *data() const { return (const T *) *this; }
+    inline const T *constData() const { return (const T *) *this; }
+#endif
+};
+
+#if QT_VERSION < 0x040400
+template <class T>
+Q_INLINE_TEMPLATE CodeModelPointer<T>::CodeModelPointer(T *adata) : d(adata)
+{ if (d) d->ref.ref(); }
+#endif
+
+#endif // CODEMODEL_POINTER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/compiler_utils.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,70 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+** Copyright (C) 2002-2005 Roberto Raggi <roberto@kdevelop.org>
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+
+#include "compiler_utils.h"
+#include "type_compiler.h"
+#include "name_compiler.h"
+#include "declarator_compiler.h"
+#include "ast.h"
+#include "binder.h"
+
+TypeInfo CompilerUtils::typeDescription(TypeSpecifierAST *type_specifier, DeclaratorAST *declarator, Binder *binder)
+{
+  TypeCompiler type_cc (binder);
+  DeclaratorCompiler decl_cc (binder);
+
+  type_cc.run (type_specifier);
+  decl_cc.run (declarator);
+
+  TypeInfo typeInfo;
+  typeInfo.setQualifiedName (type_cc.qualifiedName ());
+  typeInfo.setConstant (type_cc.isConstant ());
+  typeInfo.setVolatile (type_cc.isVolatile ());
+  typeInfo.setReference (decl_cc.isReference ());
+  typeInfo.setIndirections (decl_cc.indirection ());
+  typeInfo.setArrayElements (decl_cc.arrayElements ());
+
+  return typeInfo;
+}
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/compiler_utils.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+** Copyright (C) 2002-2005 Roberto Raggi <roberto@kdevelop.org>
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+
+#ifndef COMPILER_UTILS_H
+#define COMPILER_UTILS_H
+
+#include <utility>
+
+#include "codemodel.h"
+
+class QString;
+class QStringList;
+struct TypeSpecifierAST;
+struct DeclaratorAST;
+class TokenStream;
+class Binder;
+
+namespace CompilerUtils
+{
+
+TypeInfo typeDescription(TypeSpecifierAST *type_specifier, DeclaratorAST *declarator, Binder *binder);
+
+} // namespace CompilerUtils
+
+#endif // COMPILER_UTILS_H
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/control.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,148 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+** Copyright (C) 2002-2005 Roberto Raggi <roberto@kdevelop.org>
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+
+#include "control.h"
+#include "lexer.h"
+
+Control::Control()
+  : current_context(0),
+    _M_skipFunctionBody(false),
+    _M_lexer(0),
+    _M_parser(0)
+{
+  pushContext();
+
+  declareTypedef(findOrInsertName("__builtin_va_list",
+         strlen("__builtin_va_list")), 0);
+}
+
+Control::~Control()
+{
+  popContext();
+
+  Q_ASSERT(current_context == 0);
+}
+
+Lexer *Control::changeLexer(Lexer *lexer)
+{
+  Lexer *old = _M_lexer;
+  _M_lexer = lexer;
+  return old;
+}
+
+Parser *Control::changeParser(Parser *parser)
+{
+  Parser *old = _M_parser;
+  _M_parser = parser;
+  return old;
+}
+
+Type *Control::lookupType(const NameSymbol *name) const
+{
+  Q_ASSERT(current_context != 0);
+
+  return current_context->resolve(name);
+}
+
+void Control::declare(const NameSymbol *name, Type *type)
+{
+  //printf("*** Declare:");
+  //printSymbol(name);
+  //putchar('\n');
+  Q_ASSERT(current_context != 0);
+
+  current_context->bind(name, type);
+}
+
+void Control::pushContext()
+{
+  // printf("+Context\n");
+  Context *new_context = new Context;
+  new_context->parent = current_context;
+  current_context = new_context;
+}
+
+void Control::popContext()
+{
+  // printf("-Context\n");
+  Q_ASSERT(current_context != 0);
+
+  Context *old_context = current_context;
+  current_context = current_context->parent;
+
+  delete old_context;
+}
+
+void Control::declareTypedef(const NameSymbol *name, Declarator *d)
+{
+  //  printf("declared typedef:");
+  //  printSymbol(name);
+  //  printf("\n");
+  stl_typedef_table.insert(name, d);
+}
+
+bool Control::isTypedef(const NameSymbol *name) const
+{
+  //  printf("is typedef:");
+  //  printSymbol(name);
+  // printf("= %d\n", (stl_typedef_table.find(name) != stl_typedef_table.end()));
+
+  return stl_typedef_table.contains(name);
+}
+
+QList<Control::ErrorMessage> Control::errorMessages () const
+{
+  return _M_error_messages;
+}
+
+void Control::clearErrorMessages ()
+{
+  _M_error_messages.clear ();
+}
+
+void Control::reportError (const ErrorMessage &errmsg)
+{
+    _M_error_messages.append(errmsg);
+}
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/control.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,153 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+** Copyright (C) 2002-2005 Roberto Raggi <roberto@kdevelop.org>
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+
+#ifndef CONTROL_H
+#define CONTROL_H
+
+#include "symbol.h"
+#include "smallobject.h"
+
+#include <QtCore/QHash>
+
+struct Declarator;
+struct Type;
+class Lexer;
+class Parser;
+
+struct Context
+{
+  Context *parent;
+
+  inline void bind(const NameSymbol *name, Type *type)
+  { symbol_table.insert(name, type); }
+
+  inline Type *resolve(const NameSymbol *name) const
+  {
+    if (Type *type = symbol_table.value(name))
+      return type;
+    else if (parent)
+      return parent->resolve(name);
+
+    return 0;
+  }
+
+  typedef QHash<const NameSymbol*, Type*> symbol_table_t;
+
+  symbol_table_t symbol_table;
+};
+
+class Control
+{
+public:
+  class ErrorMessage
+  {
+  public:
+    ErrorMessage ():
+      _M_line (0),
+      _M_column (0) {}
+
+    inline int line () const { return _M_line; }
+    inline void setLine (int line) { _M_line = line; }
+
+    inline int column () const { return _M_column; }
+    inline void setColumn (int column) { _M_column = column; }
+
+    inline QString fileName () const { return _M_fileName; }
+    inline void setFileName (const QString &fileName) { _M_fileName = fileName; }
+
+    inline QString message () const { return _M_message; }
+    inline void setMessage (const QString &message) { _M_message = message; }
+
+  private:
+    int _M_line;
+    int _M_column;
+    QString _M_fileName;
+    QString _M_message;
+  };
+
+  Control();
+  ~Control();
+
+  inline bool skipFunctionBody() const { return _M_skipFunctionBody; }
+  inline void setSkipFunctionBody(bool skip) { _M_skipFunctionBody = skip; }
+
+  Lexer *changeLexer(Lexer *lexer);
+  Parser *changeParser(Parser *parser);
+
+  Lexer *currentLexer() const { return _M_lexer; }
+  Parser *currentParser() const { return _M_parser; }
+
+  Context *current_context;
+
+  inline Context *currentContext() const
+    { return current_context; }
+
+  void pushContext();
+  void popContext();
+
+  Type *lookupType(const NameSymbol *name) const;
+  void declare(const NameSymbol *name, Type *type);
+
+  inline const NameSymbol *findOrInsertName(const char *data, size_t count)
+  { return name_table.findOrInsert(data, count); }
+
+  void declareTypedef(const NameSymbol *name, Declarator *d);
+  bool isTypedef(const NameSymbol *name) const;
+
+  void reportError (const ErrorMessage &errmsg);
+  QList<ErrorMessage> errorMessages () const;
+  void clearErrorMessages ();
+
+private:
+  NameTable name_table;
+  QHash<const NameSymbol*, Declarator*> stl_typedef_table;
+  bool _M_skipFunctionBody;
+  Lexer *_M_lexer;
+  Parser *_M_parser;
+
+  QList<ErrorMessage> _M_error_messages;
+};
+
+#endif // CONTROL_H
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/declarator_compiler.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,173 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+** Copyright (C) 2002-2005 Roberto Raggi <roberto@kdevelop.org>
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+
+#include "declarator_compiler.h"
+#include "name_compiler.h"
+#include "type_compiler.h"
+#include "compiler_utils.h"
+#include "lexer.h"
+#include "binder.h"
+#include "tokens.h"
+
+#include <qdebug.h>
+
+DeclaratorCompiler::DeclaratorCompiler(Binder *binder)
+  : _M_binder (binder), _M_token_stream (binder->tokenStream ())
+{
+}
+
+void DeclaratorCompiler::run(DeclaratorAST *node)
+{
+  _M_id.clear();
+  _M_parameters.clear();
+  _M_array.clear();
+  _M_function = false;
+  _M_reference = false;
+  _M_variadics = false;
+  _M_indirection = 0;
+
+  if (node)
+    {
+      NameCompiler name_cc(_M_binder);
+
+      DeclaratorAST *decl = node;
+      while (decl && decl->sub_declarator)
+        decl = decl->sub_declarator;
+
+      Q_ASSERT (decl != 0);
+
+      name_cc.run(decl->id);
+      _M_id = name_cc.name();
+      _M_function = (node->parameter_declaration_clause != 0);
+      if (node->parameter_declaration_clause && node->parameter_declaration_clause->ellipsis)
+        _M_variadics = true;
+
+      visitNodes(this, node->ptr_ops);
+      visit(node->parameter_declaration_clause);
+
+      if (const ListNode<ExpressionAST*> *it = node->array_dimensions)
+        {
+          it->toFront();
+          const ListNode<ExpressionAST*> *end = it;
+
+          do
+            {
+              QString elt;
+              if (ExpressionAST *expr = it->element)
+                {
+                  const Token &start_token = _M_token_stream->token((int) expr->start_token);
+                  const Token &end_token = _M_token_stream->token((int) expr->end_token);
+
+                  elt += QString::fromUtf8(&start_token.text[start_token.position],
+                                           (int) (end_token.position - start_token.position)).trimmed();
+                }
+
+              _M_array.append (elt);
+
+              it = it->next;
+            }
+          while (it != end);
+        }
+    }
+}
+
+void DeclaratorCompiler::visitPtrOperator(PtrOperatorAST *node)
+{
+  std::size_t op =  _M_token_stream->kind(node->op);
+
+  switch (op)
+    {
+      case '&':
+        _M_reference = true;
+        break;
+      case '*':
+        ++_M_indirection;
+        break;
+
+      default:
+        break;
+    }
+
+  if (node->mem_ptr)
+    {
+#if defined(__GNUC__)
+#warning "ptr to mem -- not implemented"
+#endif
+    }
+}
+
+void DeclaratorCompiler::visitParameterDeclaration(ParameterDeclarationAST *node)
+{
+  Parameter p;
+
+  TypeCompiler type_cc(_M_binder);
+  DeclaratorCompiler decl_cc(_M_binder);
+
+  decl_cc.run(node->declarator);
+
+  p.name = decl_cc.id();
+  p.type = CompilerUtils::typeDescription(node->type_specifier, node->declarator, _M_binder);
+  if (node->expression != 0)
+    {
+      const Token &start = _M_token_stream->token((int) node->expression->start_token);
+      const Token &end = _M_token_stream->token((int) node->expression->end_token);
+      int length = (int) (end.position - start.position);
+
+      p.defaultValueExpression = QString();
+      QString source = QString::fromUtf8(&start.text[start.position], length).trimmed();
+      QStringList list = source.split("\n");
+
+
+      for (int i=0; i<list.size(); ++i) {
+          if (!list.at(i).startsWith("#"))
+              p.defaultValueExpression += list.at(i).trimmed();
+      }
+
+      p.defaultValue = p.defaultValueExpression.size() > 0;
+
+    }
+
+  _M_parameters.append(p);
+}
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/declarator_compiler.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,101 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+** Copyright (C) 2002-2005 Roberto Raggi <roberto@kdevelop.org>
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+
+#ifndef DECLARATOR_COMPILER_H
+#define DECLARATOR_COMPILER_H
+
+#include "default_visitor.h"
+#include "codemodel.h"
+
+#include <QtCore/QString>
+#include <QtCore/QList>
+
+class TokenStream;
+class Binder;
+
+class DeclaratorCompiler: protected DefaultVisitor
+{
+public:
+  struct Parameter
+  {
+    TypeInfo type;
+    QString name;
+    QString defaultValueExpression;
+    bool defaultValue;
+
+    Parameter(): defaultValue(false) {}
+  };
+
+public:
+  DeclaratorCompiler(Binder *binder);
+
+  void run(DeclaratorAST *node);
+
+  inline QString id() const { return _M_id; }
+  inline QStringList arrayElements() const { return _M_array; }
+  inline bool isFunction() const { return _M_function; }
+  inline bool isVariadics() const { return _M_variadics; }
+  inline bool isReference() const { return _M_reference; }
+  inline int indirection() const { return _M_indirection; }
+  inline QList<Parameter> parameters() const { return _M_parameters; }
+
+protected:
+  virtual void visitPtrOperator(PtrOperatorAST *node);
+  virtual void visitParameterDeclaration(ParameterDeclarationAST *node);
+
+private:
+  Binder *_M_binder;
+  TokenStream *_M_token_stream;
+
+  bool _M_function;
+  bool _M_reference;
+  bool _M_variadics;
+  int _M_indirection;
+  QString _M_id;
+  QStringList _M_array;
+  QList<Parameter> _M_parameters;
+};
+
+#endif // DECLARATOR_COMPILER_H
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/default_visitor.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,477 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+** Copyright (C) 2002-2005 Roberto Raggi <roberto@kdevelop.org>
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+
+#include "default_visitor.h"
+
+void DefaultVisitor::visitAccessSpecifier(AccessSpecifierAST *)
+{
+  // nothing to do
+}
+
+void DefaultVisitor::visitAsmDefinition(AsmDefinitionAST *)
+{
+  // nothing to do
+}
+
+void DefaultVisitor::visitBaseClause(BaseClauseAST *node)
+{
+  visitNodes(this, node->base_specifiers);
+}
+
+void DefaultVisitor::visitBaseSpecifier(BaseSpecifierAST *node)
+{
+  visit(node->name);
+}
+
+void DefaultVisitor::visitBinaryExpression(BinaryExpressionAST *node)
+{
+  visit(node->left_expression);
+  visit(node->right_expression);
+}
+
+void DefaultVisitor::visitCastExpression(CastExpressionAST *node)
+{
+  visit(node->type_id);
+  visit(node->expression);
+}
+
+void DefaultVisitor::visitClassMemberAccess(ClassMemberAccessAST *node)
+{
+  visit(node->name);
+}
+
+void DefaultVisitor::visitClassSpecifier(ClassSpecifierAST *node)
+{
+  visit(node->win_decl_specifiers);
+  visit(node->name);
+  visit(node->base_clause);
+  visitNodes(this, node->member_specs);
+}
+
+void DefaultVisitor::visitCompoundStatement(CompoundStatementAST *node)
+{
+  visitNodes(this, node->statements);
+}
+
+void DefaultVisitor::visitCondition(ConditionAST *node)
+{
+  visit(node->type_specifier);
+  visit(node->declarator);
+  visit(node->expression);
+}
+
+void DefaultVisitor::visitConditionalExpression(ConditionalExpressionAST *node)
+{
+  visit(node->condition);
+  visit(node->left_expression);
+  visit(node->right_expression);
+}
+
+void DefaultVisitor::visitCppCastExpression(CppCastExpressionAST *node)
+{
+  visit(node->type_id);
+  visit(node->expression);
+  visitNodes(this, node->sub_expressions);
+}
+
+void DefaultVisitor::visitCtorInitializer(CtorInitializerAST *node)
+{
+  visitNodes(this, node->member_initializers);
+}
+
+void DefaultVisitor::visitDeclarationStatement(DeclarationStatementAST *node)
+{
+  visit(node->declaration);
+}
+
+void DefaultVisitor::visitDeclarator(DeclaratorAST *node)
+{
+  visit(node->sub_declarator);
+  visitNodes(this, node->ptr_ops);
+  visit(node->id);
+  visit(node->bit_expression);
+  visitNodes(this, node->array_dimensions);
+  visit(node->parameter_declaration_clause);
+  visit(node->exception_spec);
+}
+
+void DefaultVisitor::visitDeleteExpression(DeleteExpressionAST *node)
+{
+  visit(node->expression);
+}
+
+void DefaultVisitor::visitDoStatement(DoStatementAST *node)
+{
+  visit(node->statement);
+  visit(node->expression);
+}
+
+void DefaultVisitor::visitElaboratedTypeSpecifier(ElaboratedTypeSpecifierAST *node)
+{
+  visit(node->name);
+}
+
+void DefaultVisitor::visitEnumSpecifier(EnumSpecifierAST *node)
+{
+  visit(node->name);
+  visitNodes(this, node->enumerators);
+}
+
+void DefaultVisitor::visitEnumerator(EnumeratorAST *node)
+{
+  visit(node->expression);
+}
+
+void DefaultVisitor::visitExceptionSpecification(ExceptionSpecificationAST *node)
+{
+  visitNodes(this, node->type_ids);
+}
+
+void DefaultVisitor::visitExpressionOrDeclarationStatement(ExpressionOrDeclarationStatementAST *node)
+{
+  visit(node->expression);
+  visit(node->declaration);
+}
+
+void DefaultVisitor::visitExpressionStatement(ExpressionStatementAST *node)
+{
+  visit(node->expression);
+}
+
+void DefaultVisitor::visitForStatement(ForStatementAST *node)
+{
+  visit(node->init_statement);
+  visit(node->condition);
+  visit(node->expression);
+  visit(node->statement);
+}
+
+void DefaultVisitor::visitFunctionCall(FunctionCallAST *node)
+{
+  visit(node->arguments);
+}
+
+void DefaultVisitor::visitFunctionDefinition(FunctionDefinitionAST *node)
+{
+  visit(node->type_specifier);
+  visit(node->init_declarator);
+  visit(node->function_body);
+  visit(node->win_decl_specifiers);
+}
+
+void DefaultVisitor::visitIfStatement(IfStatementAST *node)
+{
+  visit(node->condition);
+  visit(node->statement);
+  visit(node->else_statement);
+}
+
+void DefaultVisitor::visitIncrDecrExpression(IncrDecrExpressionAST *)
+{
+  // nothing to do
+}
+
+void DefaultVisitor::visitInitDeclarator(InitDeclaratorAST *node)
+{
+  visit(node->declarator);
+  visit(node->initializer);
+}
+
+void DefaultVisitor::visitInitializer(InitializerAST *node)
+{
+  visit(node->initializer_clause);
+  visit(node->expression);
+}
+
+void DefaultVisitor::visitInitializerClause(InitializerClauseAST *node)
+{
+  visit(node->expression);
+}
+
+void DefaultVisitor::visitLabeledStatement(LabeledStatementAST *)
+{
+  // nothing to do
+}
+
+void DefaultVisitor::visitLinkageBody(LinkageBodyAST *node)
+{
+  visitNodes(this, node->declarations);
+}
+
+void DefaultVisitor::visitLinkageSpecification(LinkageSpecificationAST *node)
+{
+  visit(node->linkage_body);
+  visit(node->declaration);
+}
+
+void DefaultVisitor::visitMemInitializer(MemInitializerAST *node)
+{
+  visit(node->initializer_id);
+  visit(node->expression);
+}
+
+void DefaultVisitor::visitName(NameAST *node)
+{
+  visitNodes(this, node->qualified_names);
+  visit(node->unqualified_name);
+}
+
+void DefaultVisitor::visitNamespace(NamespaceAST *node)
+{
+  visit(node->linkage_body);
+}
+
+void DefaultVisitor::visitNamespaceAliasDefinition(NamespaceAliasDefinitionAST *node)
+{
+  visit(node->alias_name);
+}
+
+void DefaultVisitor::visitNewDeclarator(NewDeclaratorAST *node)
+{
+  visit(node->ptr_op);
+  visit(node->sub_declarator);
+  visitNodes(this, node->expressions);
+}
+
+void DefaultVisitor::visitNewExpression(NewExpressionAST *node)
+{
+  visit(node->expression);
+  visit(node->type_id);
+  visit(node->new_type_id);
+  visit(node->new_initializer);
+}
+
+void DefaultVisitor::visitNewInitializer(NewInitializerAST *node)
+{
+  visit(node->expression);
+}
+
+void DefaultVisitor::visitNewTypeId(NewTypeIdAST *node)
+{
+  visit(node->type_specifier);
+  visit(node->new_initializer);
+  visit(node->new_declarator);
+}
+
+void DefaultVisitor::visitOperator(OperatorAST *)
+{
+  // nothing to do
+}
+
+void DefaultVisitor::visitOperatorFunctionId(OperatorFunctionIdAST *node)
+{
+  visit(node->op);
+  visit(node->type_specifier);
+  visitNodes(this, node->ptr_ops);
+}
+
+void DefaultVisitor::visitParameterDeclaration(ParameterDeclarationAST *node)
+{
+  visit(node->type_specifier);
+  visit(node->declarator);
+  visit(node->expression);
+}
+
+void DefaultVisitor::visitParameterDeclarationClause(ParameterDeclarationClauseAST *node)
+{
+  visitNodes(this, node->parameter_declarations);
+}
+
+void DefaultVisitor::visitPostfixExpression(PostfixExpressionAST *node)
+{
+  visit(node->type_specifier);
+  visit(node->expression);
+  visitNodes(this, node->sub_expressions);
+}
+
+void DefaultVisitor::visitPrimaryExpression(PrimaryExpressionAST *node)
+{
+  visit(node->literal);
+  visit(node->expression_statement);
+  visit(node->sub_expression);
+  visit(node->name);
+}
+
+void DefaultVisitor::visitPtrOperator(PtrOperatorAST *node)
+{
+  visit(node->mem_ptr);
+}
+
+void DefaultVisitor::visitPtrToMember(PtrToMemberAST *)
+{
+  // nothing to do
+}
+
+void DefaultVisitor::visitReturnStatement(ReturnStatementAST *node)
+{
+  visit(node->expression);
+}
+
+void DefaultVisitor::visitSimpleDeclaration(SimpleDeclarationAST *node)
+{
+  visit(node->type_specifier);
+  visitNodes(this, node->init_declarators);
+  visit(node->win_decl_specifiers);
+}
+
+void DefaultVisitor::visitSimpleTypeSpecifier(SimpleTypeSpecifierAST *node)
+{
+  visit(node->name);
+  visit(node->type_id);
+  visit(node->expression);
+}
+
+void DefaultVisitor::visitSizeofExpression(SizeofExpressionAST *node)
+{
+  visit(node->type_id);
+  visit(node->expression);
+}
+
+void DefaultVisitor::visitStringLiteral(StringLiteralAST *)
+{
+  // nothing to do
+}
+
+void DefaultVisitor::visitSubscriptExpression(SubscriptExpressionAST *node)
+{
+  visit(node->subscript);
+}
+
+void DefaultVisitor::visitSwitchStatement(SwitchStatementAST *node)
+{
+  visit(node->condition);
+  visit(node->statement);
+}
+
+void DefaultVisitor::visitTemplateArgument(TemplateArgumentAST *node)
+{
+  visit(node->type_id);
+  visit(node->expression);
+}
+
+void DefaultVisitor::visitTemplateDeclaration(TemplateDeclarationAST *node)
+{
+  visitNodes(this, node->template_parameters);
+  visit(node->declaration);
+}
+
+void DefaultVisitor::visitTemplateParameter(TemplateParameterAST *node)
+{
+  visit(node->type_parameter);
+  visit(node->parameter_declaration);
+}
+
+void DefaultVisitor::visitThrowExpression(ThrowExpressionAST *node)
+{
+  visit(node->expression);
+}
+
+void DefaultVisitor::visitTranslationUnit(TranslationUnitAST *node)
+{
+  visitNodes(this, node->declarations);
+}
+
+void DefaultVisitor::visitTryBlockStatement(TryBlockStatementAST *)
+{
+  // nothing to do
+}
+
+void DefaultVisitor::visitTypeId(TypeIdAST *node)
+{
+  visit(node->type_specifier);
+  visit(node->declarator);
+}
+
+void DefaultVisitor::visitTypeIdentification(TypeIdentificationAST *node)
+{
+  visit(node->name);
+  visit(node->expression);
+}
+
+void DefaultVisitor::visitTypeParameter(TypeParameterAST *node)
+{
+  visit(node->name);
+  visit(node->type_id);
+  visitNodes(this, node->template_parameters);
+  visit(node->template_name);
+}
+
+void DefaultVisitor::visitTypedef(TypedefAST *node)
+{
+  visit(node->type_specifier);
+  visitNodes(this, node->init_declarators);
+}
+
+void DefaultVisitor::visitUnaryExpression(UnaryExpressionAST *node)
+{
+  visit(node->expression);
+}
+
+void DefaultVisitor::visitUnqualifiedName(UnqualifiedNameAST *node)
+{
+  visit(node->operator_id);
+  visitNodes(this, node->template_arguments);
+}
+
+void DefaultVisitor::visitUsing(UsingAST *node)
+{
+  visit(node->name);
+}
+
+void DefaultVisitor::visitUsingDirective(UsingDirectiveAST *node)
+{
+  visit(node->name);
+}
+
+void DefaultVisitor::visitWhileStatement(WhileStatementAST *node)
+{
+  visit(node->condition);
+  visit(node->statement);
+}
+
+void DefaultVisitor::visitWinDeclSpec(WinDeclSpecAST *)
+{
+  // nothing to do
+}
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/default_visitor.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,136 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+** Copyright (C) 2002-2005 Roberto Raggi <roberto@kdevelop.org>
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+
+#ifndef DEFAULT_VISITOR_H
+#define DEFAULT_VISITOR_H
+
+#include "visitor.h"
+
+class DefaultVisitor: public Visitor
+{
+public:
+  DefaultVisitor() {}
+
+protected:
+  virtual void visitAccessSpecifier(AccessSpecifierAST *);
+  virtual void visitAsmDefinition(AsmDefinitionAST *);
+  virtual void visitBaseClause(BaseClauseAST *);
+  virtual void visitBaseSpecifier(BaseSpecifierAST *);
+  virtual void visitBinaryExpression(BinaryExpressionAST *);
+  virtual void visitCastExpression(CastExpressionAST *);
+  virtual void visitClassMemberAccess(ClassMemberAccessAST *);
+  virtual void visitClassSpecifier(ClassSpecifierAST *);
+  virtual void visitCompoundStatement(CompoundStatementAST *);
+  virtual void visitCondition(ConditionAST *);
+  virtual void visitConditionalExpression(ConditionalExpressionAST *);
+  virtual void visitCppCastExpression(CppCastExpressionAST *);
+  virtual void visitCtorInitializer(CtorInitializerAST *);
+  virtual void visitDeclarationStatement(DeclarationStatementAST *);
+  virtual void visitDeclarator(DeclaratorAST *);
+  virtual void visitDeleteExpression(DeleteExpressionAST *);
+  virtual void visitDoStatement(DoStatementAST *);
+  virtual void visitElaboratedTypeSpecifier(ElaboratedTypeSpecifierAST *);
+  virtual void visitEnumSpecifier(EnumSpecifierAST *);
+  virtual void visitEnumerator(EnumeratorAST *);
+  virtual void visitExceptionSpecification(ExceptionSpecificationAST *);
+  virtual void visitExpressionOrDeclarationStatement(ExpressionOrDeclarationStatementAST *);
+  virtual void visitExpressionStatement(ExpressionStatementAST *);
+  virtual void visitForStatement(ForStatementAST *);
+  virtual void visitFunctionCall(FunctionCallAST *);
+  virtual void visitFunctionDefinition(FunctionDefinitionAST *);
+  virtual void visitIfStatement(IfStatementAST *);
+  virtual void visitIncrDecrExpression(IncrDecrExpressionAST *);
+  virtual void visitInitDeclarator(InitDeclaratorAST *);
+  virtual void visitInitializer(InitializerAST *);
+  virtual void visitInitializerClause(InitializerClauseAST *);
+  virtual void visitLabeledStatement(LabeledStatementAST *);
+  virtual void visitLinkageBody(LinkageBodyAST *);
+  virtual void visitLinkageSpecification(LinkageSpecificationAST *);
+  virtual void visitMemInitializer(MemInitializerAST *);
+  virtual void visitName(NameAST *);
+  virtual void visitNamespace(NamespaceAST *);
+  virtual void visitNamespaceAliasDefinition(NamespaceAliasDefinitionAST *);
+  virtual void visitNewDeclarator(NewDeclaratorAST *);
+  virtual void visitNewExpression(NewExpressionAST *);
+  virtual void visitNewInitializer(NewInitializerAST *);
+  virtual void visitNewTypeId(NewTypeIdAST *);
+  virtual void visitOperator(OperatorAST *);
+  virtual void visitOperatorFunctionId(OperatorFunctionIdAST *);
+  virtual void visitParameterDeclaration(ParameterDeclarationAST *);
+  virtual void visitParameterDeclarationClause(ParameterDeclarationClauseAST *);
+  virtual void visitPostfixExpression(PostfixExpressionAST *);
+  virtual void visitPrimaryExpression(PrimaryExpressionAST *);
+  virtual void visitPtrOperator(PtrOperatorAST *);
+  virtual void visitPtrToMember(PtrToMemberAST *);
+  virtual void visitReturnStatement(ReturnStatementAST *);
+  virtual void visitSimpleDeclaration(SimpleDeclarationAST *);
+  virtual void visitSimpleTypeSpecifier(SimpleTypeSpecifierAST *);
+  virtual void visitSizeofExpression(SizeofExpressionAST *);
+  virtual void visitStringLiteral(StringLiteralAST *);
+  virtual void visitSubscriptExpression(SubscriptExpressionAST *);
+  virtual void visitSwitchStatement(SwitchStatementAST *);
+  virtual void visitTemplateArgument(TemplateArgumentAST *);
+  virtual void visitTemplateDeclaration(TemplateDeclarationAST *);
+  virtual void visitTemplateParameter(TemplateParameterAST *);
+  virtual void visitThrowExpression(ThrowExpressionAST *);
+  virtual void visitTranslationUnit(TranslationUnitAST *);
+  virtual void visitTryBlockStatement(TryBlockStatementAST *);
+  virtual void visitTypeId(TypeIdAST *);
+  virtual void visitTypeIdentification(TypeIdentificationAST *);
+  virtual void visitTypeParameter(TypeParameterAST *);
+  virtual void visitTypedef(TypedefAST *);
+  virtual void visitUnaryExpression(UnaryExpressionAST *);
+  virtual void visitUnqualifiedName(UnqualifiedNameAST *);
+  virtual void visitUsing(UsingAST *);
+  virtual void visitUsingDirective(UsingDirectiveAST *);
+  virtual void visitWhileStatement(WhileStatementAST *);
+  virtual void visitWinDeclSpec(WinDeclSpecAST *);
+
+private:
+  typedef void (Visitor::*visitor_fun_ptr)(AST *);
+  static visitor_fun_ptr _S_table[];
+};
+
+#endif // VISITOR_H
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/dumptree.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,143 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+** Copyright (C) 2002-2005 Roberto Raggi <roberto@kdevelop.org>
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+
+#include "dumptree.h"
+
+#include <QtCore/QString>
+#include <QtCore/qdebug.h>
+
+static char const * const names[] = {
+  0,
+  "AccessSpecifier",
+  "AsmDefinition",
+  "BaseClause",
+  "BaseSpecifier",
+  "BinaryExpression",
+  "CastExpression",
+  "ClassMemberAccess",
+  "ClassSpecifier",
+  "CompoundStatement",
+  "Condition",
+  "ConditionalExpression",
+  "CppCastExpression",
+  "CtorInitializer",
+  "DeclarationStatement",
+  "Declarator",
+  "DeleteExpression",
+  "DoStatement",
+  "ElaboratedTypeSpecifier",
+  "EnumSpecifier",
+  "Enumerator",
+  "ExceptionSpecification",
+  "ExpressionOrDeclarationStatement",
+  "ExpressionStatement",
+  "ForStatement",
+  "FunctionCall",
+  "FunctionDefinition",
+  "IfStatement",
+  "IncrDecrExpression",
+  "InitDeclarator",
+  "Initializer",
+  "InitializerClause",
+  "LabeledStatement",
+  "LinkageBody",
+  "LinkageSpecification",
+  "MemInitializer",
+  "Name",
+  "Namespace",
+  "NamespaceAliasDefinition",
+  "NewDeclarator",
+  "NewExpression",
+  "NewInitializer",
+  "NewTypeId",
+  "Operator",
+  "OperatorFunctionId",
+  "ParameterDeclaration",
+  "ParameterDeclarationClause",
+  "PostfixExpression",
+  "PrimaryExpression",
+  "PtrOperator",
+  "PtrToMember",
+  "ReturnStatement",
+  "SimpleDeclaration",
+  "SimpleTypeSpecifier",
+  "SizeofExpression",
+  "StringLiteral",
+  "SubscriptExpression",
+  "SwitchStatement",
+  "TemplateArgument",
+  "TemplateDeclaration",
+  "TemplateParameter",
+  "ThrowExpression",
+  "TranslationUnit",
+  "TryBlockStatement",
+  "TypeId",
+  "TypeIdentification",
+  "TypeParameter",
+  "Typedef",
+  "UnaryExpression",
+  "UnqualifiedName",
+  "Using",
+  "UsingDirective",
+  "WhileStatement",
+  "WinDeclSpec"
+};
+
+DumpTree::DumpTree()
+{
+}
+
+void DumpTree::visit(AST *node)
+{
+  static int indent = 0;
+
+  if (node)
+    qDebug() << QString(indent * 2, ' ').toLatin1().constData() << names[node->kind]
+             << '[' << node->start_token << ", " << node->end_token << ']';
+
+  ++indent;
+  DefaultVisitor::visit(node);
+  --indent;
+}
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/dumptree.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+** Copyright (C) 2002-2005 Roberto Raggi <roberto@kdevelop.org>
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+
+#ifndef DUMPTREE_H
+#define DUMPTREE_H
+
+#include "default_visitor.h"
+
+class DumpTree: protected DefaultVisitor
+{
+public:
+  DumpTree();
+
+  void dump(AST *node) { visit(node); }
+
+protected:
+  virtual void visit(AST *node);
+};
+
+#endif // DUMPTREE_H
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/include/stdarg.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+
+#ifndef __STDARG
+#define __STDARG
+
+#if !defined(_VA_LIST) && !defined(__VA_LIST_DEFINED)
+#define _VA_LIST
+#define _VA_LIST_DEFINED
+
+typedef char *__va_list;
+#endif
+static float __va_arg_tmp;
+typedef __va_list va_list;
+
+#define va_start(list, start)               ((void)0)
+#define __va_arg(list, mode, n)             ((void)0)
+#define _bigendian_va_arg(list, mode, n)    ((void)0)
+#define _littleendian_va_arg(list, mode, n) ((void)0)
+#define va_end(list)                        ((void)0)
+#define va_arg(list, mode)                  ((void)0)
+
+typedef void *__gnuc_va_list;
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/lexer.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,1886 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+** Copyright (C) 2002-2005 Roberto Raggi <roberto@kdevelop.org>
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+
+#include "lexer.h"
+#include "tokens.h"
+#include "control.h"
+
+#include <cctype>
+#include <iostream>
+
+scan_fun_ptr Lexer::s_scan_keyword_table[] = {
+  &Lexer::scanKeyword0, &Lexer::scanKeyword0,
+  &Lexer::scanKeyword2, &Lexer::scanKeyword3,
+  &Lexer::scanKeyword4, &Lexer::scanKeyword5,
+  &Lexer::scanKeyword6, &Lexer::scanKeyword7,
+  &Lexer::scanKeyword8, &Lexer::scanKeyword9,
+  &Lexer::scanKeyword10, &Lexer::scanKeyword11,
+  &Lexer::scanKeyword12, &Lexer::scanKeyword13,
+  &Lexer::scanKeyword14, &Lexer::scanKeyword0,
+  &Lexer::scanKeyword16
+};
+
+void LocationManager::extract_line(int offset, int *line, QString *filename) const
+{
+  *line = 0;
+  if (token_stream.size () < 1)
+    return;
+
+  const unsigned char *begin_buffer = reinterpret_cast<const unsigned char *>(token_stream[0].text);
+  const unsigned char *cursor = begin_buffer + offset;
+
+  ++cursor; // skip '#'
+  if (std::isspace(*cursor) && std::isdigit(*(cursor + 1)))
+    {
+      ++cursor;
+      char buffer[1024], *cp = buffer;
+      do {
+        *cp++ = *cursor++;
+      } while (std::isdigit(*cursor));
+      *cp = '\0';
+      int l = strtol(buffer, 0, 0);
+
+      Q_ASSERT(std::isspace(*cursor));
+      ++cursor;
+
+      Q_ASSERT(*cursor == '"');
+      ++cursor;
+
+      cp = buffer;
+      while (*cursor && *cursor != '"') {
+        *cp++ = *cursor++;
+      }
+      *cp = '\0';
+      Q_ASSERT(*cursor == '"');
+      ++cursor;
+
+      *filename = buffer;
+      *line = l;
+      // printf("filename: %s line: %d\n", buffer, line);
+    }
+}
+
+void LocationManager::positionAt(std::size_t offset, int *line, int *column,
+                                 QString *filename) const
+{
+  int ppline, ppcolumn;
+  line_table.positionAt(offset, &ppline, &ppcolumn);
+
+  int base_line;
+  extract_line((int) line_table[ppline-1], &base_line, filename);
+
+  int line2, column2;
+  location_table.positionAt((int) line_table[ppline-1], &line2, &column2);
+
+  location_table.positionAt(offset, line, column);
+  *line = base_line + *line - line2  - 1;
+}
+
+scan_fun_ptr Lexer::s_scan_table[256];
+bool Lexer::s_initialized = false;
+
+void Lexer::tokenize(const char *contents, std::size_t size)
+{
+  if (!s_initialized)
+    initialize_scan_table();
+
+  token_stream.resize(1024);
+  token_stream[0].kind = Token_EOF;
+  token_stream[0].text = contents;
+
+  index = 1;
+
+  cursor = (const unsigned char *) contents;
+  begin_buffer = (const unsigned char *) contents;
+  end_buffer = cursor + size;
+
+  location_table.resize(1024);
+  location_table[0] = 0;
+  location_table.current_line = 1;
+
+  line_table.resize(1024);
+  line_table[0] = 0;
+  line_table.current_line = 1;
+
+  do {
+    if (index == token_stream.size())
+      token_stream.resize(token_stream.size() * 2);
+
+    Token *current_token = &token_stream[(int) index];
+    current_token->text = reinterpret_cast<const char*>(begin_buffer);
+    current_token->position = cursor - begin_buffer;
+    (this->*s_scan_table[*cursor])();
+    current_token->size = cursor - begin_buffer - current_token->position;
+  } while (cursor < end_buffer);
+
+  if (index == token_stream.size())
+      token_stream.resize(token_stream.size() * 2);
+
+  Q_ASSERT(index < token_stream.size());
+  token_stream[(int) index].position = cursor - begin_buffer;
+  token_stream[(int) index].kind = Token_EOF;
+}
+
+void Lexer::reportError(const QString& msg)
+{
+    int line, column;
+    QString fileName;
+
+    std::size_t tok = token_stream.cursor();
+    _M_location.positionAt(token_stream.position(tok),
+        &line, &column, &fileName);
+
+    Control::ErrorMessage errmsg;
+    errmsg.setLine(line + 1);
+    errmsg.setColumn(column);
+    errmsg.setFileName(fileName);
+    errmsg.setMessage(QLatin1String("** LEXER ERROR ") + msg);
+    control->reportError(errmsg);
+}
+
+void Lexer::initialize_scan_table()
+{
+  s_initialized = true;
+
+  for (int i=0; i<256; ++i)
+    {
+      if (isspace(i))
+    s_scan_table[i] = &Lexer::scan_white_spaces;
+      else if (isalpha(i) || i == '_')
+    s_scan_table[i] = &Lexer::scan_identifier_or_keyword;
+      else if (isdigit(i))
+    s_scan_table[i] = &Lexer::scan_int_constant;
+      else
+    s_scan_table[i] = &Lexer::scan_invalid_input;
+    }
+
+  s_scan_table[int('L')] = &Lexer::scan_identifier_or_literal;
+  s_scan_table[int('\n')] = &Lexer::scan_newline;
+  s_scan_table[int('#')] = &Lexer::scan_preprocessor;
+
+  s_scan_table[int('\'')] = &Lexer::scan_char_constant;
+  s_scan_table[int('"')]  = &Lexer::scan_string_constant;
+
+  s_scan_table[int('.')] = &Lexer::scan_int_constant;
+
+  s_scan_table[int('!')] = &Lexer::scan_not;
+  s_scan_table[int('%')] = &Lexer::scan_remainder;
+  s_scan_table[int('&')] = &Lexer::scan_and;
+  s_scan_table[int('(')] = &Lexer::scan_left_paren;
+  s_scan_table[int(')')] = &Lexer::scan_right_paren;
+  s_scan_table[int('*')] = &Lexer::scan_star;
+  s_scan_table[int('+')] = &Lexer::scan_plus;
+  s_scan_table[int(',')] = &Lexer::scan_comma;
+  s_scan_table[int('-')] = &Lexer::scan_minus;
+  s_scan_table[int('/')] = &Lexer::scan_divide;
+  s_scan_table[int(':')] = &Lexer::scan_colon;
+  s_scan_table[int(';')] = &Lexer::scan_semicolon;
+  s_scan_table[int('<')] = &Lexer::scan_less;
+  s_scan_table[int('=')] = &Lexer::scan_equal;
+  s_scan_table[int('>')] = &Lexer::scan_greater;
+  s_scan_table[int('?')] = &Lexer::scan_question;
+  s_scan_table[int('[')] = &Lexer::scan_left_bracket;
+  s_scan_table[int(']')] = &Lexer::scan_right_bracket;
+  s_scan_table[int('^')] = &Lexer::scan_xor;
+  s_scan_table[int('{')] = &Lexer::scan_left_brace;
+  s_scan_table[int('|')] = &Lexer::scan_or;
+  s_scan_table[int('}')] = &Lexer::scan_right_brace;
+  s_scan_table[int('~')] = &Lexer::scan_tilde;
+
+  s_scan_table[0] = &Lexer::scan_EOF;
+}
+
+void Lexer::scan_preprocessor()
+{
+  if (line_table.current_line == line_table.size())
+    line_table.resize(line_table.current_line * 2);
+
+  line_table[(int) line_table.current_line++] = (cursor - begin_buffer);
+
+  while (*cursor && *cursor != '\n')
+    ++cursor;
+
+  if (*cursor != '\n')
+      reportError("expected newline");
+}
+
+void Lexer::scan_char_constant()
+{
+  const unsigned char *begin = cursor;
+
+  ++cursor;
+  while (*cursor && *cursor != '\'')
+    {
+      if (*cursor == '\n')
+        reportError("did not expect newline");
+
+      if (*cursor == '\\')
+    ++cursor;
+      ++cursor;
+    }
+
+    if (*cursor != '\'')
+      reportError("expected \'");
+
+  ++cursor;
+
+  token_stream[(int) index].extra.symbol =
+    control->findOrInsertName((const char*) begin, cursor - begin);
+
+  token_stream[(int) index++].kind = Token_char_literal;
+}
+
+void Lexer::scan_string_constant()
+{
+  const unsigned char *begin = cursor;
+
+  ++cursor;
+  while (*cursor && *cursor != '"')
+    {
+      if (*cursor == '\n')
+        reportError("did not expect newline");
+
+      if (*cursor == '\\')
+    ++cursor;
+      ++cursor;
+    }
+
+  if (*cursor != '"')
+    reportError("expected \"");
+
+  ++cursor;
+
+  token_stream[(int) index].extra.symbol =
+    control->findOrInsertName((const char*) begin, cursor - begin);
+
+  token_stream[(int) index++].kind = Token_string_literal;
+}
+
+void Lexer::scan_newline()
+{
+  if (location_table.current_line == location_table.size())
+    location_table.resize(location_table.current_line * 2);
+
+  location_table[(int) location_table.current_line++] = (cursor - begin_buffer);
+  ++cursor;
+}
+
+void Lexer::scan_white_spaces()
+{
+  while (isspace(*cursor))
+    {
+      if (*cursor == '\n')
+    scan_newline();
+      else
+    ++cursor;
+    }
+}
+
+void Lexer::scan_identifier_or_literal()
+{
+  switch (*(cursor + 1))
+    {
+    case '\'':
+      ++cursor;
+      scan_char_constant();
+      break;
+
+    case '\"':
+      ++cursor;
+      scan_string_constant();
+      break;
+
+    default:
+      scan_identifier_or_keyword();
+      break;
+    }
+}
+
+void Lexer::scan_identifier_or_keyword()
+{
+  const unsigned char *skip = cursor;
+  while (isalnum(*skip) || *skip== '_')
+    ++skip;
+
+  int n = skip - cursor;
+  Token *current_token = &token_stream[(int) index];
+  (this->*s_scan_keyword_table[n < 17 ? n : 0])();
+
+  if (current_token->kind == Token_identifier)
+    {
+      current_token->extra.symbol =
+    control->findOrInsertName((const char*) cursor, n);
+    }
+
+  cursor = skip;
+}
+
+void Lexer::scan_int_constant()
+{
+  if (*cursor == '.' && !std::isdigit(*(cursor + 1)))
+    {
+      scan_dot();
+      return;
+    }
+
+  const unsigned char *begin = cursor;
+
+  while (isalnum(*cursor) || *cursor == '.')
+    ++cursor;
+
+  token_stream[(int) index].extra.symbol =
+    control->findOrInsertName((const char*) begin, cursor - begin);
+
+  token_stream[(int) index++].kind = Token_number_literal;
+}
+
+void Lexer::scan_not()
+{
+  /*
+    '!'     ::= not
+    '!='        ::= not_equal
+  */
+
+  ++cursor;
+
+  if (*cursor == '=')
+    {
+      ++cursor;
+      token_stream[(int) index++].kind = Token_not_eq;
+    }
+  else
+    {
+      token_stream[(int) index++].kind = '!';
+    }
+}
+
+void Lexer::scan_remainder()
+{
+  /*
+    '%'     ::= remainder
+    '%='        ::= remainder_equal
+  */
+
+  ++cursor;
+
+  if (*cursor == '=')
+    {
+      ++cursor;
+      token_stream[(int) index++].kind = Token_assign;
+    }
+  else
+    {
+      token_stream[(int) index++].kind = '%';
+    }
+}
+
+void Lexer::scan_and()
+{
+  /*
+    '&&'        ::= and_and
+    '&'     ::= and
+    '&='        ::= and_equal
+  */
+
+  ++cursor;
+  if (*cursor == '=')
+    {
+      ++cursor;
+      token_stream[(int) index++].kind = Token_assign;
+    }
+  else if (*cursor == '&')
+    {
+      ++cursor;
+      token_stream[(int) index++].kind = Token_and;
+    }
+  else
+    {
+      token_stream[(int) index++].kind = '&';
+    }
+}
+
+void Lexer::scan_left_paren()
+{
+  ++cursor;
+  token_stream[(int) index++].kind = '(';
+}
+
+void Lexer::scan_right_paren()
+{
+  ++cursor;
+  token_stream[(int) index++].kind = ')';
+}
+
+void Lexer::scan_star()
+{
+  /*
+    '*'     ::= star
+    '*='        ::= star_equal
+  */
+
+  ++cursor;
+
+  if (*cursor == '=')
+    {
+      ++cursor;
+      token_stream[(int) index++].kind = Token_assign;
+    }
+  else
+    {
+      token_stream[(int) index++].kind = '*';
+    }
+}
+
+void Lexer::scan_plus()
+{
+  /*
+    '+'     ::= plus
+    '++'        ::= incr
+    '+='        ::= plus_equal
+  */
+
+  ++cursor;
+  if (*cursor == '=')
+    {
+      ++cursor;
+      token_stream[(int) index++].kind = Token_assign;
+    }
+  else if (*cursor == '+')
+    {
+      ++cursor;
+      token_stream[(int) index++].kind = Token_incr;
+    }
+  else
+    {
+      token_stream[(int) index++].kind = '+';
+    }
+}
+
+void Lexer::scan_comma()
+{
+  ++cursor;
+  token_stream[(int) index++].kind = ',';
+}
+
+void Lexer::scan_minus()
+{
+  /*
+    '-'     ::= minus
+    '--'        ::= decr
+    '-='        ::= minus_equal
+    '->'        ::= left_arrow
+  */
+
+  ++cursor;
+  if (*cursor == '=')
+    {
+      ++cursor;
+      token_stream[(int) index++].kind = Token_assign;
+    }
+  else if (*cursor == '-')
+    {
+      ++cursor;
+      token_stream[(int) index++].kind = Token_decr;
+    }
+  else if (*cursor == '>')
+    {
+      ++cursor;
+      token_stream[(int) index++].kind = Token_arrow;
+      if (*cursor == '*')
+    {
+      ++cursor;
+      token_stream[(int) index++].kind = Token_ptrmem;
+    }
+    }
+  else
+    {
+      token_stream[(int) index++].kind = '-';
+    }
+}
+
+void Lexer::scan_dot()
+{
+  /*
+    '.'     ::= dot
+    '...'       ::= ellipsis
+  */
+
+  ++cursor;
+  if (*cursor == '.' && *(cursor + 1) == '.')
+    {
+      cursor += 2;
+      token_stream[(int) index++].kind = Token_ellipsis;
+    }
+  else if (*cursor == '.' && *(cursor + 1) == '*')
+    {
+      cursor += 2;
+      token_stream[(int) index++].kind = Token_ptrmem;
+    }
+  else
+    token_stream[(int) index++].kind = '.';
+}
+
+void Lexer::scan_divide()
+{
+  /*
+    '/'     ::= divide
+    '/='    ::= divide_equal
+  */
+
+  ++cursor;
+
+  if (*cursor == '=')
+    {
+      ++cursor;
+      token_stream[(int) index++].kind = Token_assign;
+    }
+  else
+    {
+      token_stream[(int) index++].kind = '/';
+    }
+}
+
+void Lexer::scan_colon()
+{
+  ++cursor;
+  if (*cursor == ':')
+    {
+      ++cursor;
+      token_stream[(int) index++].kind = Token_scope;
+    }
+  else
+    {
+      token_stream[(int) index++].kind = ':';
+    }
+}
+
+void Lexer::scan_semicolon()
+{
+  ++cursor;
+  token_stream[(int) index++].kind = ';';
+}
+
+void Lexer::scan_less()
+{
+  /*
+    '<'         ::= less
+    '<<'        ::= left_shift
+    '<<='       ::= left_shift_equal
+    '<='        ::= less_equal
+  */
+
+  ++cursor;
+  if (*cursor == '=')
+    {
+      ++cursor;
+      token_stream[(int) index++].kind = Token_leq;
+    }
+  else if (*cursor == '<')
+    {
+      ++cursor;
+      if (*cursor == '=')
+    {
+      ++cursor;
+      token_stream[(int) index++].kind = Token_assign;
+    }
+      else
+    {
+      token_stream[(int) index++].kind = Token_shift;
+    }
+    }
+  else
+    {
+      token_stream[(int) index++].kind = '<';
+    }
+}
+
+void Lexer::scan_equal()
+{
+  /*
+    '='         ::= equal
+    '=='        ::= equal_equal
+  */
+  ++cursor;
+
+  if (*cursor == '=')
+    {
+      ++cursor;
+      token_stream[(int) index++].kind = Token_eq;
+    }
+  else
+    {
+      token_stream[(int) index++].kind = '=';
+    }
+}
+
+void Lexer::scan_greater()
+{
+  /*
+    '>'         ::= greater
+    '>='        ::= greater_equal
+    '>>'        ::= right_shift
+    '>>='       ::= right_shift_equal
+  */
+
+  ++cursor;
+  if (*cursor == '=')
+    {
+      ++cursor;
+      token_stream[(int) index++].kind = Token_geq;
+    }
+  else if (*cursor == '>')
+    {
+      ++cursor;
+      if (*cursor == '=')
+    {
+      ++cursor;
+      token_stream[(int) index++].kind = Token_assign;
+    }
+      else
+    {
+      token_stream[(int) index++].kind = Token_shift;
+    }
+    }
+  else
+    {
+      token_stream[(int) index++].kind = '>';
+    }
+}
+
+void Lexer::scan_question()
+{
+  ++cursor;
+  token_stream[(int) index++].kind = '?';
+}
+
+void Lexer::scan_left_bracket()
+{
+  ++cursor;
+  token_stream[(int) index++].kind = '[';
+}
+
+void Lexer::scan_right_bracket()
+{
+  ++cursor;
+  token_stream[(int) index++].kind = ']';
+}
+
+void Lexer::scan_xor()
+{
+  /*
+    '^'         ::= xor
+    '^='        ::= xor_equal
+  */
+  ++cursor;
+
+  if (*cursor == '=')
+    {
+      ++cursor;
+      token_stream[(int) index++].kind = Token_assign;
+    }
+  else
+    {
+      token_stream[(int) index++].kind = '^';
+    }
+}
+
+void Lexer::scan_left_brace()
+{
+  ++cursor;
+  token_stream[(int) index++].kind = '{';
+}
+
+void Lexer::scan_or()
+{
+  /*
+    '|'         ::= or
+    '|='        ::= or_equal
+    '||'        ::= or_or
+  */
+  ++cursor;
+  if (*cursor == '=')
+    {
+      ++cursor;
+      token_stream[(int) index++].kind = Token_assign;
+    }
+  else if (*cursor == '|')
+    {
+      ++cursor;
+      token_stream[(int) index++].kind = Token_or;
+    }
+  else
+    {
+    token_stream[(int) index++].kind = '|';
+  }
+}
+
+void Lexer::scan_right_brace()
+{
+  ++cursor;
+  token_stream[(int) index++].kind = '}';
+}
+
+void Lexer::scan_tilde()
+{
+  ++cursor;
+  token_stream[(int) index++].kind = '~';
+}
+
+void Lexer::scan_EOF()
+{
+  ++cursor;
+  token_stream[(int) index++].kind = Token_EOF;
+}
+
+void Lexer::scan_invalid_input()
+{
+  QString errmsg("invalid input: %1");
+  errmsg.arg(int(*cursor));
+  reportError(errmsg);
+  ++cursor;
+}
+
+void LocationTable::positionAt(std::size_t offset, int max_line,
+                   int *line, int *column) const
+{
+  if (!(line && column && max_line != 0))
+    return;
+
+  int first = 0;
+  int len = max_line;
+  int half;
+  int middle;
+
+  while (len > 0)
+    {
+      half = len >> 1;
+      middle = first;
+
+      middle += half;
+
+      if (lines[middle] < offset)
+    {
+      first = middle;
+      ++first;
+      len = len - half - 1;
+    }
+      else
+    len = half;
+    }
+
+  *line = std::max(first, 1);
+  *column = (int) (offset - lines[*line - 1] - 1);
+
+  if (*column < 0)
+    {
+      *column = 0;
+    }
+}
+
+void Lexer::scanKeyword0()
+{
+  token_stream[(int) index++].kind = Token_identifier;
+}
+
+void Lexer::scanKeyword2()
+{
+  switch (*cursor)
+    {
+    case 'i':
+      if (*(cursor + 1) == 'f')
+    {
+      token_stream[(int) index++].kind = Token_if;
+      return;
+    }
+      break;
+
+    case 'd':
+      if (*(cursor + 1) == 'o')
+    {
+      token_stream[(int) index++].kind = Token_do;
+      return;
+    }
+      break;
+
+    case 'o':
+      if (*(cursor + 1) == 'r')
+    {
+      token_stream[(int) index++].kind = Token_or;
+      return;
+    }
+      break;
+
+    }
+  token_stream[(int) index++].kind = Token_identifier;
+}
+
+void Lexer::scanKeyword3()
+{
+  switch (*cursor)
+    {
+    case 'a':
+      if (*(cursor + 1) == 'n' &&
+      *(cursor + 2) == 'd')
+    {
+      token_stream[(int) index++].kind = Token_and;
+      return;
+    }
+      if (*(cursor + 1) == 's' &&
+      *(cursor + 2) == 'm')
+    {
+      token_stream[(int) index++].kind = Token_asm;
+      return;
+    }
+      break;
+
+    case 'f':
+      if (*(cursor + 1) == 'o' &&
+      *(cursor + 2) == 'r')
+    {
+      token_stream[(int) index++].kind = Token_for;
+      return;
+    }
+      break;
+
+    case 'i':
+      if (*(cursor + 1) == 'n' &&
+      *(cursor + 2) == 't')
+    {
+      token_stream[(int) index++].kind = Token_int;
+      return;
+    }
+      break;
+
+    case 'n':
+      if (*(cursor + 1) == 'e' &&
+      *(cursor + 2) == 'w')
+    {
+      token_stream[(int) index++].kind = Token_new;
+      return;
+    }
+      if (*(cursor + 1) == 'o' &&
+      *(cursor + 2) == 't')
+    {
+      token_stream[(int) index++].kind = Token_not;
+      return;
+    }
+      break;
+
+    case 't':
+      if (*(cursor + 1) == 'r' &&
+      *(cursor + 2) == 'y')
+    {
+      token_stream[(int) index++].kind = Token_try;
+      return;
+    }
+      break;
+
+    case 'x':
+      if (*(cursor + 1) == 'o' &&
+      *(cursor + 2) == 'r')
+    {
+      token_stream[(int) index++].kind = Token_xor;
+      return;
+    }
+      break;
+
+    }
+  token_stream[(int) index++].kind = Token_identifier;
+}
+
+void Lexer::scanKeyword4()
+{
+  switch (*cursor)
+    {
+    case 'a':
+      if (*(cursor + 1) == 'u' &&
+      *(cursor + 2) == 't' &&
+      *(cursor + 3) == 'o')
+    {
+      token_stream[(int) index++].kind = Token_auto;
+      return;
+    }
+      break;
+
+    case 'c':
+      if (*(cursor + 1) == 'a' &&
+      *(cursor + 2) == 's' &&
+      *(cursor + 3) == 'e')
+    {
+      token_stream[(int) index++].kind = Token_case;
+      return;
+    }
+      if (*(cursor + 1) == 'h' &&
+      *(cursor + 2) == 'a' &&
+      *(cursor + 3) == 'r')
+    {
+      token_stream[(int) index++].kind = Token_char;
+      return;
+    }
+      break;
+
+    case 'b':
+      if (*(cursor + 1) == 'o' &&
+      *(cursor + 2) == 'o' &&
+      *(cursor + 3) == 'l')
+    {
+      token_stream[(int) index++].kind = Token_bool;
+      return;
+    }
+      break;
+
+    case 'e':
+      if (*(cursor + 1) == 'l' &&
+      *(cursor + 2) == 's' &&
+      *(cursor + 3) == 'e')
+    {
+      token_stream[(int) index++].kind = Token_else;
+      return;
+    }
+      if (*(cursor + 1) == 'm' &&
+      *(cursor + 2) == 'i' &&
+      *(cursor + 3) == 't')
+    {
+      token_stream[(int) index++].kind = Token_emit;
+      return;
+    }
+      if (*(cursor + 1) == 'n' &&
+      *(cursor + 2) == 'u' &&
+      *(cursor + 3) == 'm')
+    {
+      token_stream[(int) index++].kind = Token_enum;
+      return;
+    }
+      break;
+
+    case 'g':
+      if (*(cursor + 1) == 'o' &&
+      *(cursor + 2) == 't' &&
+      *(cursor + 3) == 'o')
+    {
+      token_stream[(int) index++].kind = Token_goto;
+      return;
+    }
+      break;
+
+    case 'l':
+      if (*(cursor + 1) == 'o' &&
+      *(cursor + 2) == 'n' &&
+      *(cursor + 3) == 'g')
+    {
+      token_stream[(int) index++].kind = Token_long;
+      return;
+    }
+      break;
+
+    case 't':
+      if (*(cursor + 1) == 'h' &&
+      *(cursor + 2) == 'i' &&
+      *(cursor + 3) == 's')
+    {
+      token_stream[(int) index++].kind = Token_this;
+      return;
+    }
+      break;
+
+    case 'v':
+      if (*(cursor + 1) == 'o' &&
+      *(cursor + 2) == 'i' &&
+      *(cursor + 3) == 'd')
+    {
+      token_stream[(int) index++].kind = Token_void;
+      return;
+    }
+      break;
+
+    }
+  token_stream[(int) index++].kind = Token_identifier;
+}
+
+void Lexer::scanKeyword5()
+{
+  switch (*cursor)
+    {
+    case 'c':
+      if (*(cursor + 1) == 'a' &&
+      *(cursor + 2) == 't' &&
+      *(cursor + 3) == 'c' &&
+      *(cursor + 4) == 'h')
+    {
+      token_stream[(int) index++].kind = Token_catch;
+      return;
+    }
+      if (*(cursor + 1) == 'l' &&
+      *(cursor + 2) == 'a' &&
+      *(cursor + 3) == 's' &&
+      *(cursor + 4) == 's')
+    {
+      token_stream[(int) index++].kind = Token_class;
+      return;
+    }
+      if (*(cursor + 1) == 'o' &&
+      *(cursor + 2) == 'm' &&
+      *(cursor + 3) == 'p' &&
+      *(cursor + 4) == 'l')
+    {
+      token_stream[(int) index++].kind = Token_compl;
+      return;
+    }
+      if (*(cursor + 1) == 'o' &&
+      *(cursor + 2) == 'n' &&
+      *(cursor + 3) == 's' &&
+      *(cursor + 4) == 't')
+    {
+      token_stream[(int) index++].kind = Token_const;
+      return;
+    }
+      break;
+
+    case 'b':
+      if (*(cursor + 1) == 'i' &&
+      *(cursor + 2) == 't' &&
+      *(cursor + 3) == 'o' &&
+      *(cursor + 4) == 'r')
+    {
+      token_stream[(int) index++].kind = Token_bitor;
+      return;
+    }
+      if (*(cursor + 1) == 'r' &&
+      *(cursor + 2) == 'e' &&
+      *(cursor + 3) == 'a' &&
+      *(cursor + 4) == 'k')
+    {
+      token_stream[(int) index++].kind = Token_break;
+      return;
+    }
+      break;
+
+    case 'f':
+      if (*(cursor + 1) == 'l' &&
+      *(cursor + 2) == 'o' &&
+      *(cursor + 3) == 'a' &&
+      *(cursor + 4) == 't')
+    {
+      token_stream[(int) index++].kind = Token_float;
+      return;
+    }
+      break;
+
+    case 'o':
+      if (*(cursor + 1) == 'r' &&
+      *(cursor + 2) == '_' &&
+      *(cursor + 3) == 'e' &&
+      *(cursor + 4) == 'q')
+    {
+      token_stream[(int) index++].kind = Token_or_eq;
+      return;
+    }
+      break;
+
+    case 's':
+      if (*(cursor + 1) == 'h' &&
+      *(cursor + 2) == 'o' &&
+      *(cursor + 3) == 'r' &&
+      *(cursor + 4) == 't')
+    {
+      token_stream[(int) index++].kind = Token_short;
+      return;
+    }
+      if (*(cursor + 1) == 'l' &&
+      *(cursor + 2) == 'o' &&
+      *(cursor + 3) == 't' &&
+      *(cursor + 4) == 's')
+    {
+      token_stream[(int) index++].kind = Token_slots;
+      return;
+    }
+      break;
+
+    case 'u':
+      if (*(cursor + 1) == 'n' &&
+      *(cursor + 2) == 'i' &&
+      *(cursor + 3) == 'o' &&
+      *(cursor + 4) == 'n')
+    {
+      token_stream[(int) index++].kind = Token_union;
+      return;
+    }
+      if (*(cursor + 1) == 's' &&
+      *(cursor + 2) == 'i' &&
+      *(cursor + 3) == 'n' &&
+      *(cursor + 4) == 'g')
+    {
+      token_stream[(int) index++].kind = Token_using;
+      return;
+    }
+      break;
+
+    case 't':
+      if (*(cursor + 1) == 'h' &&
+      *(cursor + 2) == 'r' &&
+      *(cursor + 3) == 'o' &&
+      *(cursor + 4) == 'w')
+    {
+      token_stream[(int) index++].kind = Token_throw;
+      return;
+    }
+      break;
+
+    case 'w':
+      if (*(cursor + 1) == 'h' &&
+      *(cursor + 2) == 'i' &&
+      *(cursor + 3) == 'l' &&
+      *(cursor + 4) == 'e')
+    {
+      token_stream[(int) index++].kind = Token_while;
+      return;
+    }
+      break;
+
+    }
+  token_stream[(int) index++].kind = Token_identifier;
+}
+
+void Lexer::scanKeyword6()
+{
+  switch (*cursor)
+    {
+    case 'a':
+      if (*(cursor + 1) == 'n' &&
+      *(cursor + 2) == 'd' &&
+      *(cursor + 3) == '_' &&
+      *(cursor + 4) == 'e' &&
+      *(cursor + 5) == 'q')
+    {
+      token_stream[(int) index++].kind = Token_and_eq;
+      return;
+    }
+      break;
+
+    case 'b':
+      if (*(cursor + 1) == 'i' &&
+      *(cursor + 2) == 't' &&
+      *(cursor + 3) == 'a' &&
+      *(cursor + 4) == 'n' &&
+      *(cursor + 5) == 'd')
+    {
+      token_stream[(int) index++].kind = Token_bitand;
+      return;
+    }
+      break;
+
+    case 'e':
+      if (*(cursor + 1) == 'x' &&
+      *(cursor + 2) == 'p' &&
+      *(cursor + 3) == 'o' &&
+      *(cursor + 4) == 'r' &&
+      *(cursor + 5) == 't')
+    {
+      token_stream[(int) index++].kind = Token_export;
+      return;
+    }
+      if (*(cursor + 1) == 'x' &&
+      *(cursor + 2) == 't' &&
+      *(cursor + 3) == 'e' &&
+      *(cursor + 4) == 'r' &&
+      *(cursor + 5) == 'n')
+    {
+      token_stream[(int) index++].kind = Token_extern;
+      return;
+    }
+      break;
+
+    case 'd':
+      if (*(cursor + 1) == 'e' &&
+      *(cursor + 2) == 'l' &&
+      *(cursor + 3) == 'e' &&
+      *(cursor + 4) == 't' &&
+      *(cursor + 5) == 'e')
+    {
+      token_stream[(int) index++].kind = Token_delete;
+      return;
+    }
+      if (*(cursor + 1) == 'o' &&
+      *(cursor + 2) == 'u' &&
+      *(cursor + 3) == 'b' &&
+      *(cursor + 4) == 'l' &&
+      *(cursor + 5) == 'e')
+    {
+      token_stream[(int) index++].kind = Token_double;
+      return;
+    }
+      break;
+
+    case 'f':
+      if (*(cursor + 1) == 'r' &&
+      *(cursor + 2) == 'i' &&
+      *(cursor + 3) == 'e' &&
+      *(cursor + 4) == 'n' &&
+      *(cursor + 5) == 'd')
+    {
+      token_stream[(int) index++].kind = Token_friend;
+      return;
+    }
+      break;
+
+    case 'i':
+      if (*(cursor + 1) == 'n' &&
+      *(cursor + 2) == 'l' &&
+      *(cursor + 3) == 'i' &&
+      *(cursor + 4) == 'n' &&
+      *(cursor + 5) == 'e')
+    {
+      token_stream[(int) index++].kind = Token_inline;
+      return;
+    }
+      break;
+
+    case 'K':
+      if (*(cursor + 1) == '_' &&
+      *(cursor + 2) == 'D' &&
+      *(cursor + 3) == 'C' &&
+      *(cursor + 4) == 'O' &&
+      *(cursor + 5) == 'P')
+    {
+      token_stream[(int) index++].kind = Token_K_DCOP;
+      return;
+    }
+      break;
+
+    case 'n':
+      if (*(cursor + 1) == 'o' &&
+      *(cursor + 2) == 't' &&
+      *(cursor + 3) == '_' &&
+      *(cursor + 4) == 'e' &&
+      *(cursor + 5) == 'q')
+    {
+      token_stream[(int) index++].kind = Token_not_eq;
+      return;
+    }
+      break;
+
+    case 'p':
+      if (*(cursor + 1) == 'u' &&
+      *(cursor + 2) == 'b' &&
+      *(cursor + 3) == 'l' &&
+      *(cursor + 4) == 'i' &&
+      *(cursor + 5) == 'c')
+    {
+      token_stream[(int) index++].kind = Token_public;
+      return;
+    }
+      break;
+
+    case 's':
+      if (*(cursor + 1) == 'i' &&
+      *(cursor + 2) == 'g' &&
+      *(cursor + 3) == 'n' &&
+      *(cursor + 4) == 'e' &&
+      *(cursor + 5) == 'd')
+    {
+      token_stream[(int) index++].kind = Token_signed;
+      return;
+    }
+      if (*(cursor + 1) == 'i' &&
+      *(cursor + 2) == 'z' &&
+      *(cursor + 3) == 'e' &&
+      *(cursor + 4) == 'o' &&
+      *(cursor + 5) == 'f')
+    {
+      token_stream[(int) index++].kind = Token_sizeof;
+      return;
+    }
+      if (*(cursor + 1) == 't' &&
+      *(cursor + 2) == 'a' &&
+      *(cursor + 3) == 't' &&
+      *(cursor + 4) == 'i' &&
+      *(cursor + 5) == 'c')
+    {
+      token_stream[(int) index++].kind = Token_static;
+      return;
+    }
+      if (*(cursor + 1) == 't' &&
+      *(cursor + 2) == 'r' &&
+      *(cursor + 3) == 'u' &&
+      *(cursor + 4) == 'c' &&
+      *(cursor + 5) == 't')
+    {
+      token_stream[(int) index++].kind = Token_struct;
+      return;
+    }
+      if (*(cursor + 1) == 'w' &&
+      *(cursor + 2) == 'i' &&
+      *(cursor + 3) == 't' &&
+      *(cursor + 4) == 'c' &&
+      *(cursor + 5) == 'h')
+    {
+      token_stream[(int) index++].kind = Token_switch;
+      return;
+    }
+      break;
+
+    case 'r':
+      if (*(cursor + 1) == 'e' &&
+      *(cursor + 2) == 't' &&
+      *(cursor + 3) == 'u' &&
+      *(cursor + 4) == 'r' &&
+      *(cursor + 5) == 'n')
+    {
+      token_stream[(int) index++].kind = Token_return;
+      return;
+    }
+      break;
+
+    case 't':
+      if (*(cursor + 1) == 'y' &&
+      *(cursor + 2) == 'p' &&
+      *(cursor + 3) == 'e' &&
+      *(cursor + 4) == 'i' &&
+      *(cursor + 5) == 'd')
+    {
+      token_stream[(int) index++].kind = Token_typeid;
+      return;
+    }
+      break;
+
+    case 'x':
+      if (*(cursor + 1) == 'o' &&
+      *(cursor + 2) == 'r' &&
+      *(cursor + 3) == '_' &&
+      *(cursor + 4) == 'e' &&
+      *(cursor + 5) == 'q')
+    {
+      token_stream[(int) index++].kind = Token_xor_eq;
+      return;
+    }
+      break;
+
+    case 'k':
+      if (*(cursor + 1) == '_' &&
+      *(cursor + 2) == 'd' &&
+      *(cursor + 3) == 'c' &&
+      *(cursor + 4) == 'o' &&
+      *(cursor + 5) == 'p')
+    {
+      token_stream[(int) index++].kind = Token_k_dcop;
+      return;
+    }
+      break;
+
+    }
+  token_stream[(int) index++].kind = Token_identifier;
+}
+
+void Lexer::scanKeyword7()
+{
+  switch (*cursor)
+    {
+    case 'd':
+      if (*(cursor + 1) == 'e' &&
+      *(cursor + 2) == 'f' &&
+      *(cursor + 3) == 'a' &&
+      *(cursor + 4) == 'u' &&
+      *(cursor + 5) == 'l' &&
+      *(cursor + 6) == 't')
+    {
+      token_stream[(int) index++].kind = Token_default;
+      return;
+    }
+      break;
+
+    case 'm':
+      if (*(cursor + 1) == 'u' &&
+      *(cursor + 2) == 't' &&
+      *(cursor + 3) == 'a' &&
+      *(cursor + 4) == 'b' &&
+      *(cursor + 5) == 'l' &&
+      *(cursor + 6) == 'e')
+    {
+      token_stream[(int) index++].kind = Token_mutable;
+      return;
+    }
+      break;
+
+    case 'p':
+      if (*(cursor + 1) == 'r' &&
+      *(cursor + 2) == 'i' &&
+      *(cursor + 3) == 'v' &&
+      *(cursor + 4) == 'a' &&
+      *(cursor + 5) == 't' &&
+      *(cursor + 6) == 'e')
+    {
+      token_stream[(int) index++].kind = Token_private;
+      return;
+    }
+      break;
+    case 's':
+      if (*(cursor + 1) == 'i' &&
+      *(cursor + 2) == 'g' &&
+      *(cursor + 3) == 'n' &&
+      *(cursor + 4) == 'a' &&
+      *(cursor + 5) == 'l' &&
+      *(cursor + 6) == 's')
+    {
+      token_stream[(int) index++].kind = Token_signals;
+      return;
+    }
+      break;
+    case 't':
+      if (*(cursor + 1) == 'y' &&
+      *(cursor + 2) == 'p' &&
+      *(cursor + 3) == 'e' &&
+      *(cursor + 4) == 'd' &&
+      *(cursor + 5) == 'e' &&
+      *(cursor + 6) == 'f')
+    {
+      token_stream[(int) index++].kind = Token_typedef;
+      return;
+    }
+      break;
+
+    case 'v':
+      if (*(cursor + 1) == 'i' &&
+      *(cursor + 2) == 'r' &&
+      *(cursor + 3) == 't' &&
+      *(cursor + 4) == 'u' &&
+      *(cursor + 5) == 'a' &&
+      *(cursor + 6) == 'l')
+    {
+      token_stream[(int) index++].kind = Token_virtual;
+      return;
+    }
+      break;
+
+    case 'Q':
+      if (*(cursor + 1) == '_' &&
+      *(cursor + 2) == 'E' &&
+      *(cursor + 3) == 'N' &&
+      *(cursor + 4) == 'U' &&
+      *(cursor + 5) == 'M' &&
+      *(cursor + 6) == 'S')
+      {
+        token_stream[(int) index++].kind = Token_Q_ENUMS;
+        return;
+      }
+        break;
+
+    }
+  token_stream[(int) index++].kind = Token_identifier;
+}
+
+void Lexer::scanKeyword8()
+{
+  switch (*cursor)
+    {
+    case '_':
+      if (*(cursor + 1) == '_' &&
+      *(cursor + 2) == 't' &&
+      *(cursor + 3) == 'y' &&
+      *(cursor + 4) == 'p' &&
+      *(cursor + 5) == 'e' &&
+      *(cursor + 6) == 'o' &&
+      *(cursor + 7) == 'f')
+    {
+      token_stream[(int) index++].kind = Token___typeof;
+      return;
+    }
+      break;
+
+    case 'c':
+      if (*(cursor + 1) == 'o' &&
+      *(cursor + 2) == 'n' &&
+      *(cursor + 3) == 't' &&
+      *(cursor + 4) == 'i' &&
+      *(cursor + 5) == 'n' &&
+      *(cursor + 6) == 'u' &&
+      *(cursor + 7) == 'e')
+    {
+      token_stream[(int) index++].kind = Token_continue;
+      return;
+    }
+      break;
+
+    case 'e':
+      if (*(cursor + 1) == 'x' &&
+      *(cursor + 2) == 'p' &&
+      *(cursor + 3) == 'l' &&
+      *(cursor + 4) == 'i' &&
+      *(cursor + 5) == 'c' &&
+      *(cursor + 6) == 'i' &&
+      *(cursor + 7) == 't')
+    {
+      token_stream[(int) index++].kind = Token_explicit;
+      return;
+    }
+      break;
+
+    case 'o':
+      if (*(cursor + 1) == 'p' &&
+      *(cursor + 2) == 'e' &&
+      *(cursor + 3) == 'r' &&
+      *(cursor + 4) == 'a' &&
+      *(cursor + 5) == 't' &&
+      *(cursor + 6) == 'o' &&
+      *(cursor + 7) == 'r')
+    {
+      token_stream[(int) index++].kind = Token_operator;
+      return;
+    }
+      break;
+
+    case 'Q':
+      if (*(cursor + 1) == '_' &&
+      *(cursor + 2) == 'O' &&
+      *(cursor + 3) == 'B' &&
+      *(cursor + 4) == 'J' &&
+      *(cursor + 5) == 'E' &&
+      *(cursor + 6) == 'C' &&
+      *(cursor + 7) == 'T')
+    {
+      token_stream[(int) index++].kind = Token_Q_OBJECT;
+      return;
+    }
+      break;
+
+    case 'r':
+      if (*(cursor + 1) == 'e' &&
+      *(cursor + 2) == 'g' &&
+      *(cursor + 3) == 'i' &&
+      *(cursor + 4) == 's' &&
+      *(cursor + 5) == 't' &&
+      *(cursor + 6) == 'e' &&
+      *(cursor + 7) == 'r')
+    {
+      token_stream[(int) index++].kind = Token_register;
+      return;
+    }
+      break;
+
+    case 'u':
+      if (*(cursor + 1) == 'n' &&
+      *(cursor + 2) == 's' &&
+      *(cursor + 3) == 'i' &&
+      *(cursor + 4) == 'g' &&
+      *(cursor + 5) == 'n' &&
+      *(cursor + 6) == 'e' &&
+      *(cursor + 7) == 'd')
+    {
+      token_stream[(int) index++].kind = Token_unsigned;
+      return;
+    }
+      break;
+
+    case 't':
+      if (*(cursor + 1) == 'e' &&
+      *(cursor + 2) == 'm' &&
+      *(cursor + 3) == 'p' &&
+      *(cursor + 4) == 'l' &&
+      *(cursor + 5) == 'a' &&
+      *(cursor + 6) == 't' &&
+      *(cursor + 7) == 'e')
+    {
+      token_stream[(int) index++].kind = Token_template;
+      return;
+    }
+      if (*(cursor + 1) == 'y' &&
+      *(cursor + 2) == 'p' &&
+      *(cursor + 3) == 'e' &&
+      *(cursor + 4) == 'n' &&
+      *(cursor + 5) == 'a' &&
+      *(cursor + 6) == 'm' &&
+      *(cursor + 7) == 'e')
+    {
+      token_stream[(int) index++].kind = Token_typename;
+      return;
+    }
+      break;
+
+    case 'v':
+      if (*(cursor + 1) == 'o' &&
+      *(cursor + 2) == 'l' &&
+      *(cursor + 3) == 'a' &&
+      *(cursor + 4) == 't' &&
+      *(cursor + 5) == 'i' &&
+      *(cursor + 6) == 'l' &&
+      *(cursor + 7) == 'e')
+    {
+      token_stream[(int) index++].kind = Token_volatile;
+      return;
+    }
+      break;
+
+    }
+  token_stream[(int) index++].kind = Token_identifier;
+}
+
+void Lexer::scanKeyword9()
+{
+  switch (*cursor)
+    {
+    case 'p':
+      if (*(cursor + 1) == 'r' &&
+      *(cursor + 2) == 'o' &&
+      *(cursor + 3) == 't' &&
+      *(cursor + 4) == 'e' &&
+      *(cursor + 5) == 'c' &&
+      *(cursor + 6) == 't' &&
+      *(cursor + 7) == 'e' &&
+      *(cursor + 8) == 'd')
+    {
+      token_stream[(int) index++].kind = Token_protected;
+      return;
+    }
+      break;
+
+    case 'n':
+      if (*(cursor + 1) == 'a' &&
+      *(cursor + 2) == 'm' &&
+      *(cursor + 3) == 'e' &&
+      *(cursor + 4) == 's' &&
+      *(cursor + 5) == 'p' &&
+      *(cursor + 6) == 'a' &&
+      *(cursor + 7) == 'c' &&
+      *(cursor + 8) == 'e')
+    {
+      token_stream[(int) index++].kind = Token_namespace;
+      return;
+    }
+      break;
+
+    }
+  token_stream[(int) index++].kind = Token_identifier;
+}
+
+void Lexer::scanKeyword10()
+{
+  switch (*cursor)
+    {
+    case 'c':
+      if (*(cursor + 1) == 'o' &&
+      *(cursor + 2) == 'n' &&
+      *(cursor + 3) == 's' &&
+      *(cursor + 4) == 't' &&
+      *(cursor + 5) == '_' &&
+      *(cursor + 6) == 'c' &&
+      *(cursor + 7) == 'a' &&
+      *(cursor + 8) == 's' &&
+      *(cursor + 9) == 't')
+    {
+      token_stream[(int) index++].kind = Token_const_cast;
+      return;
+    }
+      break;
+
+    case 'Q':
+        if (*(cursor + 1) == '_' &&
+            *(cursor + 2) == 'P' &&
+            *(cursor + 3) == 'R' &&
+            *(cursor + 4) == 'O' &&
+            *(cursor + 5) == 'P' &&
+            *(cursor + 6) == 'E' &&
+            *(cursor + 7) == 'R' &&
+            *(cursor + 8) == 'T' &&
+            *(cursor + 9) == 'Y')
+          {
+            token_stream[(int) index++].kind = Token_Q_PROPERTY;
+            return;
+          }
+
+        break;
+    }
+
+  token_stream[(int) index++].kind = Token_identifier;
+}
+
+void Lexer::scanKeyword11()
+{
+  switch (*cursor)
+    {
+    case 'Q':
+      if (*(cursor + 1) == '_' &&
+      *(cursor + 2) == 'I' &&
+      *(cursor + 3) == 'N' &&
+      *(cursor + 4) == 'V' &&
+      *(cursor + 5) == 'O' &&
+      *(cursor + 6) == 'K' &&
+      *(cursor + 7) == 'A' &&
+      *(cursor + 8) == 'B' &&
+      *(cursor + 9) == 'L' &&
+      *(cursor + 10) == 'E')
+    {
+      token_stream[(int) index++].kind = Token_Q_INVOKABLE;
+      return;
+    }
+      break;
+
+    case 's':
+      if (*(cursor + 1) == 't' &&
+      *(cursor + 2) == 'a' &&
+      *(cursor + 3) == 't' &&
+      *(cursor + 4) == 'i' &&
+      *(cursor + 5) == 'c' &&
+      *(cursor + 6) == '_' &&
+      *(cursor + 7) == 'c' &&
+      *(cursor + 8) == 'a' &&
+      *(cursor + 9) == 's' &&
+      *(cursor + 10) == 't')
+    {
+      token_stream[(int) index++].kind = Token_static_cast;
+      return;
+    }
+      break;
+
+    }
+  token_stream[(int) index++].kind = Token_identifier;
+}
+
+void Lexer::scanKeyword12()
+{
+  switch (*cursor)
+    {
+    case 'd':
+      if (*(cursor + 1) == 'y' &&
+      *(cursor + 2) == 'n' &&
+      *(cursor + 3) == 'a' &&
+      *(cursor + 4) == 'm' &&
+      *(cursor + 5) == 'i' &&
+      *(cursor + 6) == 'c' &&
+      *(cursor + 7) == '_' &&
+      *(cursor + 8) == 'c' &&
+      *(cursor + 9) == 'a' &&
+      *(cursor + 10) == 's' &&
+      *(cursor + 11) == 't')
+    {
+      token_stream[(int) index++].kind = Token_dynamic_cast;
+      return;
+    }
+      break;
+
+    }
+  token_stream[(int) index++].kind = Token_identifier;
+}
+
+void Lexer::scanKeyword13()
+{
+  switch (*cursor)
+    {
+    case '_':
+      if (*(cursor + 1) == '_' &&
+      *(cursor + 2) == 'a' &&
+      *(cursor + 3) == 't' &&
+      *(cursor + 4) == 't' &&
+      *(cursor + 5) == 'r' &&
+      *(cursor + 6) == 'i' &&
+      *(cursor + 7) == 'b' &&
+      *(cursor + 8) == 'u' &&
+      *(cursor + 9) == 't' &&
+      *(cursor + 10) == 'e' &&
+      *(cursor + 11) == '_' &&
+      *(cursor + 12) == '_')
+    {
+      token_stream[(int) index++].kind = Token___attribute__;
+      return;
+    }
+      break;
+    }
+  token_stream[(int) index++].kind = Token_identifier;
+}
+
+void Lexer::scanKeyword14()
+{
+  switch (*cursor)
+    {
+    case 'k':
+      if (*(cursor + 1) == '_' &&
+      *(cursor + 2) == 'd' &&
+      *(cursor + 3) == 'c' &&
+      *(cursor + 4) == 'o' &&
+      *(cursor + 5) == 'p' &&
+      *(cursor + 6) == '_' &&
+      *(cursor + 7) == 's' &&
+      *(cursor + 8) == 'i' &&
+      *(cursor + 9) == 'g' &&
+      *(cursor + 10) == 'n' &&
+      *(cursor + 11) == 'a' &&
+      *(cursor + 12) == 'l' &&
+      *(cursor + 13) == 's')
+    {
+      token_stream[(int) index++].kind = Token_k_dcop_signals;
+      return;
+    }
+      break;
+    }
+  token_stream[(int) index++].kind = Token_identifier;
+}
+
+void Lexer::scanKeyword16()
+{
+  switch (*cursor)
+    {
+    case 'r':
+      if (*(cursor + 1) == 'e' &&
+      *(cursor + 2) == 'i' &&
+      *(cursor + 3) == 'n' &&
+      *(cursor + 4) == 't' &&
+      *(cursor + 5) == 'e' &&
+      *(cursor + 6) == 'r' &&
+      *(cursor + 7) == 'p' &&
+      *(cursor + 8) == 'r' &&
+      *(cursor + 9) == 'e' &&
+      *(cursor + 10) == 't' &&
+      *(cursor + 11) == '_' &&
+      *(cursor + 12) == 'c' &&
+      *(cursor + 13) == 'a' &&
+      *(cursor + 14) == 's' &&
+      *(cursor + 15) == 't')
+    {
+      token_stream[(int) index++].kind = Token_reinterpret_cast;
+      return;
+    }
+      break;
+    }
+
+  token_stream[(int) index++].kind = Token_identifier;
+}
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/lexer.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,299 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+** Copyright (C) 2002-2005 Roberto Raggi <roberto@kdevelop.org>
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+
+#ifndef LEXER_H
+#define LEXER_H
+
+#include "symbol.h"
+
+#include <QtCore/QString>
+#include <cstdlib>
+#include <cassert>
+
+struct NameSymbol;
+class Lexer;
+class Control;
+
+typedef void (Lexer::*scan_fun_ptr)();
+
+class Token
+{
+public:
+  int kind;
+  std::size_t position;
+  std::size_t size;
+  char const *text;
+
+  union
+  {
+    const NameSymbol *symbol;
+    std::size_t right_brace;
+  } extra;
+};
+
+class LocationTable
+{
+private:
+  LocationTable(const LocationTable &source);
+  void operator = (const LocationTable &source);
+
+public:
+  inline LocationTable(std::size_t size = 1024)
+    : lines(0),
+      line_count(0),
+      current_line(0)
+  {
+    resize(size);
+  }
+
+  inline ~LocationTable()
+  {
+    free(lines);
+  }
+
+  inline std::size_t size() const
+  { return line_count; }
+
+  void resize(std::size_t size)
+  {
+    Q_ASSERT(size > 0);
+    lines = (std::size_t*) ::realloc(lines, sizeof(std::size_t) * size);
+    line_count = size;
+  }
+
+  void positionAt(std::size_t offset, int *line, int *column) const
+  { positionAt(offset, (int) current_line, line, column); }
+
+  void positionAt(std::size_t offset, int max_line, int *line, int *column) const;
+
+  inline std::size_t &operator[](int index)
+  { return lines[index]; }
+
+private:
+  std::size_t *lines;
+  std::size_t line_count;
+  std::size_t current_line;
+
+  friend class Lexer;
+};
+
+class TokenStream
+{
+private:
+  TokenStream(const TokenStream &);
+  void operator = (const TokenStream &);
+
+public:
+  inline TokenStream(std::size_t size = 1024)
+     : tokens(0),
+       index(0),
+       token_count(0)
+  {
+    resize(size);
+  }
+
+  inline ~TokenStream()
+  { ::free(tokens); }
+
+  inline std::size_t size() const
+  { return token_count; }
+
+  inline std::size_t cursor() const
+  { return index; }
+
+  inline void rewind(int i)
+  { index = i; }
+
+  void resize(std::size_t size)
+  {
+    Q_ASSERT(size > 0);
+    tokens = (Token*) ::realloc(tokens, sizeof(Token) * size);
+    token_count = size;
+  }
+
+  inline std::size_t nextToken()
+  { return index++; }
+
+  inline int lookAhead(std::size_t i = 0) const
+  { return tokens[index + i].kind; }
+
+  inline int kind(std::size_t i) const
+  { return tokens[i].kind; }
+
+  inline std::size_t position(std::size_t i) const
+  { return tokens[i].position; }
+
+  inline const NameSymbol *symbol(std::size_t i) const
+  { return tokens[i].extra.symbol; }
+
+  inline std::size_t matchingBrace(std::size_t i) const
+  { return tokens[i].extra.right_brace; }
+
+  inline Token &operator[](int index)
+  { return tokens[index]; }
+
+  inline const Token &token(int index) const
+  { return tokens[index]; }
+
+private:
+  Token *tokens;
+  std::size_t index;
+  std::size_t token_count;
+
+private:
+  friend class Lexer;
+};
+
+class LocationManager
+{
+  LocationManager(LocationManager const &__other);
+  void operator = (LocationManager const &__other);
+
+public:
+  LocationManager (TokenStream &__token_stream,
+          LocationTable &__location_table,
+          LocationTable &__line_table):
+    token_stream (__token_stream),
+    location_table (__location_table),
+    line_table (__line_table) {}
+
+  void positionAt(std::size_t offset, int *line, int *column,
+                  QString *filename) const;
+
+  void extract_line(int offset, int *line, QString *filename) const;
+
+  TokenStream &token_stream;
+  LocationTable &location_table;
+  LocationTable &line_table;
+};
+
+class Lexer
+{
+public:
+  Lexer(LocationManager &__location, Control *__control):
+    _M_location(__location),
+    token_stream(_M_location.token_stream),
+    location_table(_M_location.location_table),
+    line_table(_M_location.line_table),
+    control(__control) {}
+
+  void tokenize(const char *contents, std::size_t size);
+
+  LocationManager &_M_location;
+  TokenStream &token_stream;
+  LocationTable &location_table;
+  LocationTable &line_table;
+
+private:
+  void reportError(const QString& msg);
+
+  void initialize_scan_table();
+  void scan_newline();
+  void scan_white_spaces();
+  void scan_identifier_or_keyword();
+  void scan_identifier_or_literal();
+  void scan_int_constant();
+  void scan_char_constant();
+  void scan_string_constant();
+  void scan_invalid_input();
+  void scan_preprocessor();
+
+  // keywords
+  void scanKeyword0();
+  void scanKeyword2();
+  void scanKeyword3();
+  void scanKeyword4();
+  void scanKeyword5();
+  void scanKeyword6();
+  void scanKeyword7();
+  void scanKeyword8();
+  void scanKeyword9();
+  void scanKeyword10();
+  void scanKeyword11();
+  void scanKeyword12();
+  void scanKeyword13();
+  void scanKeyword14();
+  void scanKeyword16();
+
+  // operators
+  void scan_not();
+  void scan_remainder();
+  void scan_and();
+  void scan_left_paren();
+  void scan_right_paren();
+  void scan_star();
+  void scan_plus();
+  void scan_comma();
+  void scan_minus();
+  void scan_dot();
+  void scan_divide();
+  void scan_colon();
+  void scan_semicolon();
+  void scan_less();
+  void scan_equal();
+  void scan_greater();
+  void scan_question();
+  void scan_left_bracket();
+  void scan_right_bracket();
+  void scan_xor();
+  void scan_left_brace();
+  void scan_or();
+  void scan_right_brace();
+  void scan_tilde();
+  void scan_EOF();
+
+private:
+  Control *control;
+  const unsigned char *cursor;
+  const unsigned char *begin_buffer;
+  const unsigned char *end_buffer;
+  std::size_t index;
+
+  static scan_fun_ptr s_scan_table[];
+  static scan_fun_ptr s_scan_keyword_table[];
+  static bool s_initialized;
+};
+
+#endif // LEXER_H
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/list.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,46 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+** Copyright (C) 2002-2005 Roberto Raggi <roberto@kdevelop.org>
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+
+#include "list.h"
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/list.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,120 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+** Copyright (C) 2002-2005 Roberto Raggi <roberto@kdevelop.org>
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+
+#ifndef FASTLIST_H
+#define FASTLIST_H
+
+#include "smallobject.h"
+
+template <typename Tp>
+struct ListNode
+{
+  Tp element;
+  int index;
+  mutable const ListNode<Tp> *next;
+
+  static ListNode *create(const Tp &element, pool *p)
+  {
+    ListNode<Tp> *node = new (p->allocate(sizeof(ListNode))) ListNode();
+    node->element = element;
+    node->index = 0;
+    node->next = node;
+
+    return node;
+  }
+
+  static ListNode *create(const ListNode *n1, const Tp &element, pool *p)
+  {
+    ListNode<Tp> *n2 = ListNode::create(element, p);
+
+    n2->index = n1->index + 1;
+    n2->next = n1->next;
+    n1->next = n2;
+
+    return n2;
+  }
+
+  inline ListNode<Tp>() { }
+
+  inline const ListNode<Tp> *at(int index) const
+  {
+    const ListNode<Tp> *node = this;
+    while (index != node->index)
+      node = node->next;
+
+    return node;
+  }
+
+  inline bool hasNext() const
+  { return index < next->index; }
+
+  inline int count() const
+  { return 1 + toBack()->index; }
+
+  inline const ListNode<Tp> *toFront() const
+  { return toBack()->next; }
+
+  inline const ListNode<Tp> *toBack() const
+  {
+    const ListNode<Tp> *node = this;
+    while (node->hasNext())
+      node = node->next;
+
+    return node;
+  }
+};
+
+template <class Tp>
+inline const ListNode<Tp> *snoc(const ListNode<Tp> *list,
+                const Tp &element, pool *p)
+{
+  if (!list)
+    return ListNode<Tp>::create(element, p);
+
+  return ListNode<Tp>::create(list->toBack(), element, p);
+}
+
+#endif // FASTLIST_H
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/name_compiler.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,160 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+** Copyright (C) 2002-2005 Roberto Raggi <roberto@kdevelop.org>
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+
+#include "name_compiler.h"
+#include "type_compiler.h"
+#include "declarator_compiler.h"
+#include "lexer.h"
+#include "symbol.h"
+#include "binder.h"
+
+#include <QtCore/qdebug.h>
+
+NameCompiler::NameCompiler(Binder *binder)
+  : _M_binder (binder), _M_token_stream (binder->tokenStream ())
+{
+}
+
+QString NameCompiler::decode_operator(std::size_t index) const
+{
+  const Token &tk = _M_token_stream->token((int) index);
+  return QString::fromUtf8(&tk.text[tk.position], (int) tk.size);
+}
+
+QString NameCompiler::internal_run(AST *node)
+{
+  _M_name.clear();
+  visit(node);
+  return name();
+}
+
+void NameCompiler::visitUnqualifiedName(UnqualifiedNameAST *node)
+{
+  QString tmp_name;
+
+  if (node->tilde)
+    tmp_name += QLatin1String("~");
+
+  if (node->id)
+    tmp_name += _M_token_stream->symbol(node->id)->as_string();
+
+  if (OperatorFunctionIdAST *op_id = node->operator_id)
+    {
+#if defined(__GNUC__)
+#warning "NameCompiler::visitUnqualifiedName() -- implement me"
+#endif
+
+      if (op_id->op && op_id->op->op)
+        {
+          tmp_name += QLatin1String("operator");
+          tmp_name += decode_operator(op_id->op->op);
+          if (op_id->op->close)
+            tmp_name += decode_operator(op_id->op->close);
+        }
+      else if (op_id->type_specifier)
+        {
+#if defined(__GNUC__)
+#warning "don't use an hardcoded string as cast' name"
+#endif
+          Token const &tk = _M_token_stream->token ((int) op_id->start_token);
+          Token const &end_tk = _M_token_stream->token ((int) op_id->end_token);
+          tmp_name += QString::fromLatin1 (&tk.text[tk.position],
+                                           (int) (end_tk.position - tk.position)).trimmed ();
+      }
+    }
+
+  _M_name += tmp_name;
+  if (node->template_arguments)
+    {
+      // ### cleanup
+      _M_name.last() += QLatin1String("<");
+      visitNodes(this, node->template_arguments);
+      _M_name.last().truncate(_M_name.last().count() - 1); // remove the last ','
+      _M_name.last() += QLatin1String(">");
+    }
+
+}
+
+void NameCompiler::visitTemplateArgument(TemplateArgumentAST *node)
+{
+  if (node->type_id && node->type_id->type_specifier)
+    {
+      TypeCompiler type_cc(_M_binder);
+      type_cc.run(node->type_id->type_specifier);
+
+      DeclaratorCompiler decl_cc(_M_binder);
+      decl_cc.run(node->type_id->declarator);
+
+      if (type_cc.isConstant())
+        _M_name.last() += "const ";
+
+      QStringList q = type_cc.qualifiedName ();
+
+      if (q.count () == 1)
+        {
+#if defined (RXX_RESOLVE_TYPEDEF) // ### it'll break :(
+          TypeInfo tp;
+          tp.setQualifiedName (q);
+          tp = TypeInfo::resolveType (tp, _M_binder->currentScope ()->toItem ());
+          q = tp.qualifiedName ();
+#endif
+
+          if (CodeModelItem item = _M_binder->model ()->findItem (q, _M_binder->currentScope ()->toItem ()))
+            {
+              if (item->name () == q.last ())
+                q = item->qualifiedName ();
+            }
+        }
+
+      _M_name.last() += q.join("::");
+
+      if (decl_cc.isReference())
+        _M_name.last() += "&";
+      if (decl_cc.indirection())
+        _M_name.last() += QString(decl_cc.indirection(), '*');
+
+      _M_name.last() += QLatin1String(",");
+    }
+}
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/name_compiler.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+** Copyright (C) 2002-2005 Roberto Raggi <roberto@kdevelop.org>
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+
+#ifndef NAME_COMPILER_H
+#define NAME_COMPILER_H
+
+#include "default_visitor.h"
+#include <QtCore/QStringList>
+
+class TokenStream;
+class Binder;
+
+class NameCompiler: protected DefaultVisitor
+{
+public:
+  NameCompiler(Binder *binder);
+
+  void run(NameAST *node) { internal_run(node); }
+  void run(UnqualifiedNameAST *node) { internal_run(node); }
+
+  QString name() const { return _M_name.join("::"); }
+  QStringList qualifiedName() const { return _M_name; }
+
+protected:
+  virtual void visitUnqualifiedName(UnqualifiedNameAST *node);
+  virtual void visitTemplateArgument(TemplateArgumentAST *node);
+
+  QString internal_run(AST *node);
+  QString decode_operator(std::size_t index) const;
+
+private:
+  Binder *_M_binder;
+  TokenStream *_M_token_stream;
+  QStringList _M_name;
+};
+
+#endif // NAME_COMPILER_H
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/parser.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,4438 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+** Copyright (C) 2002-2005 Roberto Raggi <roberto@kdevelop.org>
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+
+
+// c++ support
+#include "parser.h"
+#include "tokens.h"
+#include "lexer.h"
+#include "control.h"
+
+#include <cstdlib>
+#include <iostream>
+
+#define ADVANCE(tk, descr) \
+{ \
+  if (token_stream.lookAhead() != tk) { \
+      tokenRequiredError(tk); \
+      return false; \
+  } \
+  token_stream.nextToken(); \
+}
+
+#define ADVANCE_NR(tk, descr) \
+  do { \
+    if (token_stream.lookAhead() != tk) { \
+      tokenRequiredError(tk); \
+    } \
+    else \
+        token_stream.nextToken(); \
+  } while (0)
+
+#define CHECK(tk) \
+  do { \
+    if (token_stream.lookAhead() != tk) { \
+        return false; \
+    } \
+    token_stream.nextToken(); \
+  } while (0)
+
+#define UPDATE_POS(_node, start, end) \
+  do { \
+      (_node)->start_token = start; \
+      (_node)->end_token = end; \
+  } while (0)
+
+Parser::Parser(Control *c)
+  : _M_location(token_stream, location_table, line_table),
+    control(c),
+    lexer(_M_location, control)
+{
+  _M_block_errors = false;
+}
+
+Parser::~Parser()
+{
+}
+
+void Parser::advance()
+{
+  token_stream.nextToken();
+}
+
+TranslationUnitAST *Parser::parse(const char *contents,
+                                  std::size_t size, pool *p)
+{
+  _M_block_errors = false;
+  _M_pool = p;
+  lexer.tokenize(contents, size);
+  token_stream.nextToken(); // skip the first token
+
+  Lexer *oldLexer = control->changeLexer (&lexer);
+  Parser *oldParser = control->changeParser (this);
+
+  TranslationUnitAST *ast = 0;
+  parseTranslationUnit(ast);
+
+  control->changeLexer (oldLexer);
+  control->changeParser (oldParser);
+
+  return ast;
+}
+
+bool Parser::parseWinDeclSpec(WinDeclSpecAST *&node)
+{
+  if (token_stream.lookAhead() != Token_identifier)
+    return false;
+
+  std::size_t start = token_stream.cursor();
+
+  const NameSymbol *name_symbol = token_stream.symbol(token_stream.cursor());
+  QString name = name_symbol->as_string();
+  if (name != QLatin1String("__declspec"))
+    return false;
+  std::size_t specifier = token_stream.cursor();
+
+  token_stream.nextToken();
+  if (token_stream.lookAhead() != '(')
+    return false;
+
+  token_stream.nextToken();
+  if (token_stream.lookAhead() != Token_identifier)
+    return false;
+  std::size_t modifier = token_stream.cursor();
+
+  token_stream.nextToken();
+  if (token_stream.lookAhead() != ')')
+    return false;
+
+  token_stream.nextToken();
+
+  node = CreateNode<WinDeclSpecAST>(_M_pool);
+  node->specifier = specifier;
+  node->modifier = modifier;
+
+  UPDATE_POS(node, start, token_stream.cursor());
+
+  return true;
+}
+
+void Parser::tokenRequiredError(int token)
+{
+  QString err;
+
+  err += "expected token ";
+  err += "``";
+  err += token_name(token);
+  err += "'' found ``";
+  err += token_name(token_stream.lookAhead());
+  err += "''";
+
+  reportError(err);
+}
+
+void Parser::syntaxError()
+{
+  QString err;
+
+  err += "unexpected token ";
+  err += "``";
+  err += token_name(token_stream.lookAhead());
+  err += "''";
+
+  reportError(err);
+}
+
+void Parser::reportError(const QString& msg)
+{
+    if (!_M_block_errors)
+    {
+        int line, column;
+        QString fileName;
+
+        std::size_t tok = token_stream.cursor();
+        location().positionAt(token_stream.position(tok),
+            &line, &column, &fileName);
+
+        Control::ErrorMessage errmsg;
+        errmsg.setLine(line + 1);
+        errmsg.setColumn(column);
+        errmsg.setFileName(fileName);
+        errmsg.setMessage(QLatin1String("** PARSER ERROR ") + msg);
+        control->reportError(errmsg);
+    }
+}
+
+bool Parser::skipUntil(int token)
+{
+  while (token_stream.lookAhead())
+    {
+      if (token_stream.lookAhead() == token)
+        return true;
+
+      token_stream.nextToken();
+    }
+
+  return false;
+}
+
+bool Parser::skipUntilDeclaration()
+{
+  while (token_stream.lookAhead())
+    {
+
+      switch(token_stream.lookAhead())
+        {
+        case ';':
+        case '~':
+        case Token_scope:
+        case Token_identifier:
+        case Token_operator:
+        case Token_char:
+        case Token_wchar_t:
+        case Token_bool:
+        case Token_short:
+        case Token_int:
+        case Token_long:
+        case Token_signed:
+        case Token_unsigned:
+        case Token_float:
+        case Token_double:
+        case Token_void:
+        case Token_extern:
+        case Token_namespace:
+        case Token_using:
+        case Token_typedef:
+        case Token_asm:
+        case Token_template:
+        case Token_export:
+
+        case Token_const:       // cv
+        case Token_volatile:    // cv
+
+        case Token_public:
+        case Token_protected:
+        case Token_private:
+        case Token_signals:      // Qt
+        case Token_slots:        // Qt
+          return true;
+
+        default:
+          token_stream.nextToken();
+        }
+    }
+
+  return false;
+}
+
+bool Parser::skipUntilStatement()
+{
+  while (token_stream.lookAhead())
+    {
+      switch(token_stream.lookAhead())
+        {
+        case ';':
+        case '{':
+        case '}':
+        case Token_const:
+        case Token_volatile:
+        case Token_identifier:
+        case Token_case:
+        case Token_default:
+        case Token_if:
+        case Token_switch:
+        case Token_while:
+        case Token_do:
+        case Token_for:
+        case Token_break:
+        case Token_continue:
+        case Token_return:
+        case Token_goto:
+        case Token_try:
+        case Token_catch:
+        case Token_throw:
+        case Token_char:
+        case Token_wchar_t:
+        case Token_bool:
+        case Token_short:
+        case Token_int:
+        case Token_long:
+        case Token_signed:
+        case Token_unsigned:
+        case Token_float:
+        case Token_double:
+        case Token_void:
+        case Token_class:
+        case Token_struct:
+        case Token_union:
+        case Token_enum:
+        case Token_scope:
+        case Token_template:
+        case Token_using:
+          return true;
+
+        default:
+          token_stream.nextToken();
+        }
+    }
+
+  return false;
+}
+
+bool Parser::skip(int l, int r)
+{
+  int count = 0;
+  while (token_stream.lookAhead())
+    {
+      int tk = token_stream.lookAhead();
+
+      if (tk == l)
+        ++count;
+      else if (tk == r)
+        --count;
+      else if (l != '{' && (tk == '{' || tk == '}' || tk == ';'))
+        return false;
+
+      if (count == 0)
+        return true;
+
+      token_stream.nextToken();
+    }
+
+  return false;
+}
+
+bool Parser::parseName(NameAST *&node, bool acceptTemplateId)
+{
+  std::size_t start = token_stream.cursor();
+
+  WinDeclSpecAST *winDeclSpec = 0;
+  parseWinDeclSpec(winDeclSpec);
+
+  NameAST *ast = CreateNode<NameAST>(_M_pool);
+
+  if (token_stream.lookAhead() == Token_scope)
+    {
+      ast->global = true;
+      token_stream.nextToken();
+    }
+
+  std::size_t idx = token_stream.cursor();
+
+  while (true)
+    {
+      UnqualifiedNameAST *n = 0;
+      if (!parseUnqualifiedName(n))
+        return false;
+
+      if (token_stream.lookAhead() == Token_scope)
+        {
+          token_stream.nextToken();
+
+          ast->qualified_names
+            = snoc(ast->qualified_names, n, _M_pool);
+
+          if (token_stream.lookAhead() == Token_template)
+            {
+              /// skip optional template     #### @todo CHECK
+              token_stream.nextToken();
+            }
+        }
+      else
+        {
+          Q_ASSERT(n != 0);
+          if (!acceptTemplateId)
+            {
+              token_stream.rewind((int) n->start_token);
+              parseUnqualifiedName(n, false);
+            }
+
+          ast->unqualified_name = n;
+          break;
+        }
+    }
+
+  if (idx == token_stream.cursor())
+    return false;
+
+  UPDATE_POS(ast, start, token_stream.cursor());
+  node = ast;
+
+  return true;
+}
+
+bool Parser::parseTranslationUnit(TranslationUnitAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+  TranslationUnitAST *ast = CreateNode<TranslationUnitAST>(_M_pool);
+
+  while (token_stream.lookAhead())
+    {
+      std::size_t startDecl = token_stream.cursor();
+
+      DeclarationAST *declaration = 0;
+      if (parseDeclaration(declaration))
+        {
+          ast->declarations =
+            snoc(ast->declarations, declaration, _M_pool);
+        }
+      else
+        {
+          // error recovery
+          if (startDecl == token_stream.cursor())
+            {
+              // skip at least one token
+              token_stream.nextToken();
+            }
+
+          skipUntilDeclaration();
+        }
+    }
+
+  UPDATE_POS(ast, start, token_stream.cursor());
+  node = ast;
+
+  return true;
+}
+
+bool Parser::parseDeclaration(DeclarationAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  switch(token_stream.lookAhead())
+    {
+    case ';':
+      token_stream.nextToken();
+      return true;
+
+    case Token_extern:
+      return parseLinkageSpecification(node);
+
+    case Token_namespace:
+      return parseNamespace(node);
+
+    case Token_using:
+      return parseUsing(node);
+
+    case Token_typedef:
+      return parseTypedef(node);
+
+    case Token_asm:
+      return parseAsmDefinition(node);
+
+    case Token_Q_ENUMS:
+        return parseQ_ENUMS(node);
+
+    case Token_template:
+    case Token_export:
+      return parseTemplateDeclaration(node);
+
+    default:
+      {
+        const ListNode<std::size_t> *cv = 0;
+        parseCvQualify(cv);
+
+        const ListNode<std::size_t> *storageSpec = 0;
+        parseStorageClassSpecifier(storageSpec);
+
+        parseCvQualify(cv);
+
+        TypeSpecifierAST *spec = 0;
+        if (parseEnumSpecifier(spec)
+            || parseClassSpecifier(spec)
+            || parseForwardDeclarationSpecifier(spec))
+          {
+            parseCvQualify(cv);
+
+            spec->cv = cv;
+
+            const ListNode<InitDeclaratorAST*> *declarators = 0;
+            parseInitDeclaratorList(declarators);
+            ADVANCE(';', ";");
+
+            SimpleDeclarationAST *ast =
+              CreateNode<SimpleDeclarationAST>(_M_pool);
+
+            ast->storage_specifiers = storageSpec;
+            ast->type_specifier = spec;
+            ast->init_declarators = declarators;
+            UPDATE_POS(ast, start, token_stream.cursor());
+            node = ast;
+
+            return true;
+          }
+      }
+    } // end switch
+
+  token_stream.rewind((int) start);
+  return parseDeclarationInternal(node);
+}
+
+bool Parser::parseLinkageSpecification(DeclarationAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  CHECK(Token_extern);
+
+  LinkageSpecificationAST *ast = CreateNode<LinkageSpecificationAST>(_M_pool);
+
+  if (token_stream.lookAhead() == Token_string_literal)
+    {
+      ast->extern_type = token_stream.cursor();
+      token_stream.nextToken();
+    }
+
+  if (token_stream.lookAhead() == '{')
+    {
+      parseLinkageBody(ast->linkage_body);
+    }
+  else if (!parseDeclaration(ast->declaration))
+    {
+      reportError(("Declaration syntax error"));
+    }
+
+  UPDATE_POS(ast, start, token_stream.cursor());
+  node = ast;
+
+  return true;
+}
+
+bool Parser::parseLinkageBody(LinkageBodyAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  CHECK('{');
+
+  LinkageBodyAST *ast = CreateNode<LinkageBodyAST>(_M_pool);
+
+  while (token_stream.lookAhead())
+    {
+      int tk = token_stream.lookAhead();
+
+      if (tk == '}')
+        break;
+
+      std::size_t startDecl = token_stream.cursor();
+
+      DeclarationAST *declaration = 0;
+      if (parseDeclaration(declaration))
+        {
+          ast->declarations = snoc(ast->declarations, declaration, _M_pool);
+        }
+      else
+        {
+          // error recovery
+          if (startDecl == token_stream.cursor())
+            {
+              // skip at least one token
+              token_stream.nextToken();
+            }
+
+          skipUntilDeclaration();
+        }
+    }
+
+  if (token_stream.lookAhead() != '}')
+    reportError(("} expected"));
+  else
+    token_stream.nextToken();
+
+  UPDATE_POS(ast, start, token_stream.cursor());
+  node = ast;
+
+  return true;
+}
+
+bool Parser::parseNamespace(DeclarationAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  CHECK(Token_namespace);
+
+  std::size_t namespace_name = 0;
+  if (token_stream.lookAhead() == Token_identifier)
+    {
+      namespace_name = token_stream.cursor();
+      token_stream.nextToken();
+    }
+
+  if (token_stream.lookAhead() == '=')
+    {
+      // namespace alias
+      token_stream.nextToken();
+
+      NameAST *name = 0;
+      if (parseName(name))
+        {
+          ADVANCE(';', ";");
+
+          NamespaceAliasDefinitionAST *ast
+            = CreateNode<NamespaceAliasDefinitionAST>(_M_pool);
+          ast->namespace_name = namespace_name;
+          ast->alias_name = name;
+          UPDATE_POS(ast, start, token_stream.cursor());
+          node = ast;
+          return true;
+        }
+      else
+        {
+          reportError(("namespace expected"));
+          return false;
+        }
+    }
+  else if (token_stream.lookAhead() != '{')
+    {
+      reportError(("{ expected"));
+      return false;
+    }
+
+  NamespaceAST *ast = CreateNode<NamespaceAST>(_M_pool);
+  ast->namespace_name = namespace_name;
+  parseLinkageBody(ast->linkage_body);
+
+  UPDATE_POS(ast, start, token_stream.cursor());
+  node = ast;
+
+  return true;
+}
+
+bool Parser::parseUsing(DeclarationAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  CHECK(Token_using);
+
+  if (token_stream.lookAhead() == Token_namespace)
+    return parseUsingDirective(node);
+
+  UsingAST *ast = CreateNode<UsingAST>(_M_pool);
+
+  if (token_stream.lookAhead() == Token_typename)
+    {
+      ast->type_name = token_stream.cursor();
+      token_stream.nextToken();
+    }
+
+  if (!parseName(ast->name))
+    return false;
+
+  ADVANCE(';', ";");
+
+  UPDATE_POS(ast, start, token_stream.cursor());
+  node = ast;
+
+  return true;
+}
+
+bool Parser::parseUsingDirective(DeclarationAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  CHECK(Token_namespace);
+
+  NameAST *name = 0;
+  if (!parseName(name))
+    {
+      reportError(("Namespace name expected"));
+      return false;
+    }
+
+  ADVANCE(';', ";");
+
+  UsingDirectiveAST *ast = CreateNode<UsingDirectiveAST>(_M_pool);
+  ast->name = name;
+  UPDATE_POS(ast, start, token_stream.cursor());
+  node = ast;
+
+  return true;
+}
+
+
+bool Parser::parseOperatorFunctionId(OperatorFunctionIdAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  CHECK(Token_operator);
+
+  OperatorFunctionIdAST *ast = CreateNode<OperatorFunctionIdAST>(_M_pool);
+
+  if (!parseOperator(ast->op))
+    {
+      ast->op = 0;
+
+      // parse cast operator
+      const ListNode<std::size_t> *cv = 0;
+      parseCvQualify(cv);
+
+      if (!parseSimpleTypeSpecifier(ast->type_specifier))
+        {
+          syntaxError();
+          return false;
+        }
+
+      parseCvQualify(cv);
+      ast->type_specifier->cv = cv;
+
+      PtrOperatorAST *ptr_op = 0;
+      while (parsePtrOperator(ptr_op))
+        ast->ptr_ops = snoc(ast->ptr_ops, ptr_op, _M_pool);
+    }
+
+  UPDATE_POS(ast, start, token_stream.cursor());
+  node = ast;
+  return true;
+}
+
+bool Parser::parseTemplateArgumentList(const ListNode<TemplateArgumentAST*> *&node,
+                                       bool reportError)
+{
+  TemplateArgumentAST *templArg = 0;
+  if (!parseTemplateArgument(templArg))
+    return false;
+
+  node = snoc(node, templArg, _M_pool);
+
+  while (token_stream.lookAhead() == ',')
+    {
+      token_stream.nextToken();
+
+      if (!parseTemplateArgument(templArg))
+        {
+          if (reportError)
+            {
+              syntaxError();
+              break;
+            }
+
+          node = 0;
+          return false;
+        }
+
+      node = snoc(node, templArg, _M_pool);
+    }
+
+  return true;
+}
+
+bool Parser::parseTypedef(DeclarationAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  CHECK(Token_typedef);
+
+  TypeSpecifierAST *spec = 0;
+  if (!parseTypeSpecifierOrClassSpec(spec))
+    {
+      reportError(("Need a type specifier to declare"));
+      return false;
+    }
+
+  const ListNode<InitDeclaratorAST*> *declarators = 0;
+  if (!parseInitDeclaratorList(declarators))
+    {
+      //reportError(("Need an identifier to declare"));
+      //return false;
+    }
+
+  ADVANCE(';', ";");
+
+  TypedefAST *ast = CreateNode<TypedefAST>(_M_pool);
+  ast->type_specifier = spec;
+  ast->init_declarators = declarators;
+
+  UPDATE_POS(ast, start, token_stream.cursor());
+  node = ast;
+
+  return true;
+}
+
+bool Parser::parseAsmDefinition(DeclarationAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  ADVANCE(Token_asm, "asm");
+
+  const ListNode<std::size_t> *cv = 0;
+  parseCvQualify(cv);
+
+#if defined(__GNUC__)
+#warning "implement me"
+#endif
+  skip('(', ')');
+  token_stream.nextToken();
+  ADVANCE(';', ";");
+
+  AsmDefinitionAST *ast = CreateNode<AsmDefinitionAST>(_M_pool);
+  ast->cv = cv;
+  UPDATE_POS(ast, start, token_stream.cursor());
+  node = ast;
+
+  return true;
+}
+
+bool Parser::parseTemplateDeclaration(DeclarationAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  std::size_t exported = 0;
+  if (token_stream.lookAhead() == Token_export)
+    {
+      exported = token_stream.cursor();
+      token_stream.nextToken();
+    }
+
+  CHECK(Token_template);
+
+  const ListNode<TemplateParameterAST*> *params = 0;
+  if (token_stream.lookAhead() == '<')
+    {
+      token_stream.nextToken();
+      parseTemplateParameterList(params);
+
+      ADVANCE('>', ">");
+    }
+
+  DeclarationAST *declaration = 0;
+  if (!parseDeclaration(declaration))
+    {
+      reportError(("expected a declaration"));
+    }
+
+  TemplateDeclarationAST *ast = CreateNode<TemplateDeclarationAST>(_M_pool);
+  ast->exported = exported;
+  ast->template_parameters = params;
+  ast->declaration = declaration;
+
+  UPDATE_POS(ast, start, token_stream.cursor());
+  node = ast;
+
+  return true;
+}
+
+bool Parser::parseOperator(OperatorAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  OperatorAST *ast = CreateNode<OperatorAST>(_M_pool);
+
+  switch(token_stream.lookAhead())
+    {
+    case Token_new:
+    case Token_delete:
+      {
+        ast->op = token_stream.cursor();
+        token_stream.nextToken();
+
+        if (token_stream.lookAhead() == '['
+            && token_stream.lookAhead(1) == ']')
+          {
+            ast->open = token_stream.cursor();
+            token_stream.nextToken();
+
+            ast->close = token_stream.cursor();
+            token_stream.nextToken();
+          }
+      }
+      break;
+
+    case '+':
+    case '-':
+    case '*':
+    case '/':
+    case '%':
+    case '^':
+    case '&':
+    case '|':
+    case '~':
+    case '!':
+    case '=':
+    case '<':
+    case '>':
+    case ',':
+    case Token_assign:
+    case Token_shift:
+    case Token_eq:
+    case Token_not_eq:
+    case Token_leq:
+    case Token_geq:
+    case Token_and:
+    case Token_or:
+    case Token_incr:
+    case Token_decr:
+    case Token_ptrmem:
+    case Token_arrow:
+      ast->op = token_stream.cursor();
+      token_stream.nextToken();
+      break;
+
+    default:
+      if (token_stream.lookAhead() == '('
+          && token_stream.lookAhead(1) == ')')
+        {
+          ast->op = ast->open = token_stream.cursor();
+          token_stream.nextToken();
+          ast->close = token_stream.cursor();
+          token_stream.nextToken();
+        }
+      else if (token_stream.lookAhead() == '['
+               && token_stream.lookAhead(1) == ']')
+        {
+          ast->op = ast->open = token_stream.cursor();
+          token_stream.nextToken();
+          ast->close = token_stream.cursor();
+          token_stream.nextToken();
+        }
+      else
+        {
+          return false;
+        }
+    }
+
+  UPDATE_POS(ast, start, token_stream.cursor());
+  node = ast;
+
+  return true;
+}
+
+bool Parser::parseCvQualify(const ListNode<std::size_t> *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  int tk;
+  while (0 != (tk = token_stream.lookAhead())
+         && (tk == Token_const || tk == Token_volatile))
+    {
+      node = snoc(node, token_stream.cursor(), _M_pool);
+      token_stream.nextToken();
+    }
+
+  return start != token_stream.cursor();
+}
+
+bool Parser::parseSimpleTypeSpecifier(TypeSpecifierAST *&node,
+                                      bool onlyIntegral)
+{
+  std::size_t start = token_stream.cursor();
+  bool isIntegral = false;
+  bool done = false;
+
+  const ListNode<std::size_t> *integrals = 0;
+
+  while (!done)
+    {
+      switch(token_stream.lookAhead())
+        {
+        case Token_char:
+        case Token_wchar_t:
+        case Token_bool:
+        case Token_short:
+        case Token_int:
+        case Token_long:
+        case Token_signed:
+        case Token_unsigned:
+        case Token_float:
+        case Token_double:
+        case Token_void:
+          integrals = snoc(integrals, token_stream.cursor(), _M_pool);
+          isIntegral = true;
+          token_stream.nextToken();
+          break;
+
+        default:
+          done = true;
+        }
+    }
+
+  SimpleTypeSpecifierAST *ast = CreateNode<SimpleTypeSpecifierAST>(_M_pool);
+  if (isIntegral)
+    {
+      ast->integrals = integrals;
+    }
+  else if (token_stream.lookAhead() == Token___typeof)
+    {
+      ast->type_of = token_stream.cursor();
+      token_stream.nextToken();
+
+      if (token_stream.lookAhead() == '(')
+        {
+          token_stream.nextToken();
+
+          std::size_t saved = token_stream.cursor();
+          parseTypeId(ast->type_id);
+          if (token_stream.lookAhead() != ')')
+            {
+              ast->type_id = 0;
+              token_stream.rewind((int) saved);
+              parseUnaryExpression(ast->expression);
+            }
+          ADVANCE(')', ")");
+        }
+      else
+        {
+          parseUnaryExpression(ast->expression);
+        }
+    }
+  else if (onlyIntegral)
+    {
+      token_stream.rewind((int) start);
+      return false;
+    }
+  else
+    {
+      if (!parseName(ast->name, true))
+        {
+          ast->name = 0;
+          token_stream.rewind((int) start);
+          return false;
+        }
+    }
+
+  UPDATE_POS(ast, start, token_stream.cursor());
+  node = ast;
+
+  return true;
+}
+
+bool Parser::parsePtrOperator(PtrOperatorAST *&node)
+{
+  int tk = token_stream.lookAhead();
+
+  if (tk != '&' && tk != '*'
+      && tk != Token_scope && tk != Token_identifier)
+    {
+      return false;
+    }
+
+  std::size_t start = token_stream.cursor();
+
+  PtrOperatorAST *ast = CreateNode<PtrOperatorAST>(_M_pool);
+
+  switch (token_stream.lookAhead())
+    {
+    case '&':
+    case '*':
+      ast->op = token_stream.cursor();
+      token_stream.nextToken();
+      break;
+
+    case Token_scope:
+    case Token_identifier:
+      {
+        if (!parsePtrToMember(ast->mem_ptr))
+          {
+            token_stream.rewind((int) start);
+            return false;
+          }
+      }
+      break;
+
+    default:
+      Q_ASSERT(0);
+      break;
+    }
+
+  parseCvQualify(ast->cv);
+
+  UPDATE_POS(ast, start, token_stream.cursor());
+  node = ast;
+
+  return true;
+}
+
+bool Parser::parseTemplateArgument(TemplateArgumentAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  TypeIdAST *typeId = 0;
+  ExpressionAST *expr = 0;
+
+  if (!parseTypeId(typeId) || (token_stream.lookAhead() != ','
+                               && token_stream.lookAhead() != '>'))
+    {
+      token_stream.rewind((int) start);
+
+      if (!parseLogicalOrExpression(expr, true))
+        return false;
+    }
+
+  TemplateArgumentAST *ast = CreateNode<TemplateArgumentAST>(_M_pool);
+  ast->type_id = typeId;
+  ast->expression = expr;
+
+  UPDATE_POS(ast, start, token_stream.cursor());
+  node = ast;
+
+  return true;
+}
+
+bool Parser::parseTypeSpecifier(TypeSpecifierAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  const ListNode<std::size_t> *cv = 0;
+  parseCvQualify(cv);
+
+  TypeSpecifierAST *ast = 0;
+  if (!parseElaboratedTypeSpecifier(ast) && !parseSimpleTypeSpecifier(ast))
+    {
+      token_stream.rewind((int) start);
+      return false;
+    }
+
+  parseCvQualify(cv);
+  ast->cv = cv;
+
+  node = ast;
+
+  return true;
+}
+
+bool Parser::parseDeclarator(DeclaratorAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  DeclaratorAST *ast = CreateNode<DeclaratorAST>(_M_pool);
+
+  DeclaratorAST *decl = 0;
+  NameAST *declId = 0;
+
+  PtrOperatorAST *ptrOp = 0;
+  while (parsePtrOperator(ptrOp))
+    {
+      ast->ptr_ops = snoc(ast->ptr_ops, ptrOp, _M_pool);
+    }
+
+  if (token_stream.lookAhead() == '(')
+    {
+      token_stream.nextToken();
+
+      if (!parseDeclarator(decl))
+        return false;
+
+      ast->sub_declarator = decl;
+
+      CHECK(')');
+    }
+  else
+    {
+      if (token_stream.lookAhead() == ':')
+        {
+          // unnamed bitfield
+        }
+      else if (parseName(declId, true))
+        {
+          ast->id = declId;
+        }
+      else
+        {
+          token_stream.rewind((int) start);
+          return false;
+        }
+
+      if (token_stream.lookAhead() == ':')
+        {
+          token_stream.nextToken();
+
+          if (!parseConstantExpression(ast->bit_expression))
+            {
+              reportError(("Constant expression expected"));
+            }
+          goto update_pos;
+        }
+    }
+
+  {
+    bool isVector = true;
+
+    while (token_stream.lookAhead() == '[')
+      {
+        token_stream.nextToken();
+
+        ExpressionAST *expr = 0;
+        parseCommaExpression(expr);
+
+        ADVANCE(']', "]");
+
+        ast->array_dimensions = snoc(ast->array_dimensions, expr, _M_pool);
+        isVector = true;
+      }
+
+    bool skipParen = false;
+    if (token_stream.lookAhead() == Token_identifier
+        && token_stream.lookAhead(1) == '('
+        && token_stream.lookAhead(2) == '(')
+      {
+        token_stream.nextToken();
+        token_stream.nextToken();
+        skipParen = true;
+      }
+
+    int tok = token_stream.lookAhead();
+    if (ast->sub_declarator
+        && !(isVector || tok == '(' || tok == ','
+             || tok == ';' || tok == '='))
+      {
+        token_stream.rewind((int) start);
+        return false;
+      }
+
+    std::size_t index = token_stream.cursor();
+    if (token_stream.lookAhead() == '(')
+      {
+        token_stream.nextToken();
+
+        ParameterDeclarationClauseAST *params = 0;
+        if (!parseParameterDeclarationClause(params))
+          {
+            token_stream.rewind((int) index);
+            goto update_pos;
+          }
+
+        ast->parameter_declaration_clause = params;
+
+        if (token_stream.lookAhead() != ')')
+          {
+            token_stream.rewind((int) index);
+            goto update_pos;
+          }
+
+        token_stream.nextToken();  // skip ')'
+
+        parseCvQualify(ast->fun_cv);
+        parseExceptionSpecification(ast->exception_spec);
+
+        if (token_stream.lookAhead() == Token___attribute__)
+          {
+          parse_Attribute__();
+          }
+      }
+
+    if (skipParen)
+      {
+        if (token_stream.lookAhead() != ')')
+          {
+            reportError(("')' expected"));
+          }
+        else
+          token_stream.nextToken();
+      }
+  }
+
+ update_pos:
+  UPDATE_POS(ast, start, token_stream.cursor());
+  node = ast;
+
+  return true;
+}
+
+bool Parser::parseAbstractDeclarator(DeclaratorAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  DeclaratorAST *ast = CreateNode<DeclaratorAST>(_M_pool);
+  DeclaratorAST *decl = 0;
+
+  PtrOperatorAST *ptrOp = 0;
+  while (parsePtrOperator(ptrOp))
+    {
+      ast->ptr_ops = snoc(ast->ptr_ops, ptrOp, _M_pool);
+    }
+
+  int index = (int) token_stream.cursor();
+  if (token_stream.lookAhead() == '(')
+    {
+      token_stream.nextToken();
+
+      if (!parseAbstractDeclarator(decl))
+        {
+          token_stream.rewind((int) index);
+          goto label1;
+        }
+
+      ast->sub_declarator = decl;
+
+      if (token_stream.lookAhead() != ')')
+        {
+          token_stream.rewind((int) start);
+          return false;
+        }
+      token_stream.nextToken();
+    }
+  else if (token_stream.lookAhead() == ':')
+    {
+      token_stream.nextToken();
+      if (!parseConstantExpression(ast->bit_expression))
+        {
+          ast->bit_expression = 0;
+          reportError(("Constant expression expected"));
+        }
+      goto update_pos;
+    }
+
+ label1:
+  {
+    bool isVector = true;
+
+    while (token_stream.lookAhead() == '[')
+      {
+        token_stream.nextToken();
+
+        ExpressionAST *expr = 0;
+        parseCommaExpression(expr);
+
+        ADVANCE(']', "]");
+
+        ast->array_dimensions = snoc(ast->array_dimensions, expr, _M_pool);
+        isVector = true;
+      }
+
+    int tok = token_stream.lookAhead();
+    if (ast->sub_declarator
+        && !(isVector || tok == '(' || tok == ','
+             || tok == ';' || tok == '='))
+      {
+        token_stream.rewind((int) start);
+        return false;
+      }
+
+    int index = (int) token_stream.cursor();
+    if (token_stream.lookAhead() == '(')
+      {
+        token_stream.nextToken();
+
+        ParameterDeclarationClauseAST *params = 0;
+        if (!parseParameterDeclarationClause(params))
+          {
+            token_stream.rewind((int) index);
+            goto update_pos;
+          }
+
+        ast->parameter_declaration_clause = params;
+
+        if (token_stream.lookAhead() != ')')
+          {
+            token_stream.rewind((int) index);
+            goto update_pos;
+          }
+
+        token_stream.nextToken();  // skip ')'
+
+        parseCvQualify(ast->fun_cv);
+        parseExceptionSpecification(ast->exception_spec);
+      }
+  }
+
+ update_pos:
+  if (token_stream.cursor() == start)
+    return false;
+
+  UPDATE_POS(ast, start, token_stream.cursor());
+  node = ast;
+
+  return true;
+}
+
+bool Parser::parseEnumSpecifier(TypeSpecifierAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  CHECK(Token_enum);
+
+  NameAST *name = 0;
+  parseName(name);
+
+  if (token_stream.lookAhead() != '{')
+    {
+      token_stream.rewind((int) start);
+      return false;
+    }
+  token_stream.nextToken();
+
+  EnumSpecifierAST *ast = CreateNode<EnumSpecifierAST>(_M_pool);
+  ast->name = name;
+
+  EnumeratorAST *enumerator = 0;
+  if (parseEnumerator(enumerator))
+    {
+      ast->enumerators = snoc(ast->enumerators, enumerator, _M_pool);
+
+      while (token_stream.lookAhead() == ',')
+        {
+          token_stream.nextToken();
+
+          if (!parseEnumerator(enumerator))
+            {
+              //reportError(("Enumerator expected"));
+              break;
+            }
+
+          ast->enumerators = snoc(ast->enumerators, enumerator, _M_pool);
+        }
+    }
+
+  ADVANCE_NR('}', "}");
+
+  UPDATE_POS(ast, start, token_stream.cursor());
+  node = ast;
+
+  return true;
+}
+
+bool Parser::parseTemplateParameterList(const ListNode<TemplateParameterAST*> *&node)
+{
+  TemplateParameterAST *param = 0;
+  if (!parseTemplateParameter(param))
+    return false;
+
+  node = snoc(node, param, _M_pool);
+
+  while (token_stream.lookAhead() == ',')
+    {
+      token_stream.nextToken();
+
+      if (!parseTemplateParameter(param))
+        {
+          syntaxError();
+          break;
+        }
+      else
+        {
+          node = snoc(node, param, _M_pool);
+        }
+    }
+
+  return true;
+}
+
+bool Parser::parseTemplateParameter(TemplateParameterAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+  TemplateParameterAST *ast = CreateNode<TemplateParameterAST>(_M_pool);
+
+  int tk = token_stream.lookAhead();
+
+  if ((tk == Token_class || tk == Token_typename || tk == Token_template)
+      && parseTypeParameter(ast->type_parameter))
+    {
+      // nothing to do
+    }
+  else if (!parseParameterDeclaration(ast->parameter_declaration))
+    return false;
+
+  UPDATE_POS(ast, start, token_stream.cursor());
+  node = ast;
+
+  return true;
+}
+
+bool Parser::parseTypeParameter(TypeParameterAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  TypeParameterAST *ast = CreateNode<TypeParameterAST>(_M_pool);
+  ast->type = start;
+
+  switch(token_stream.lookAhead())
+    {
+    case Token_class:
+    case Token_typename:
+      {
+        token_stream.nextToken(); // skip class
+
+        // parse optional name
+        if(parseName(ast->name, true))
+          {
+            if (token_stream.lookAhead() == '=')
+              {
+                token_stream.nextToken();
+
+                if(!parseTypeId(ast->type_id))
+                  {
+                    //syntaxError();
+                    token_stream.rewind((int) start);
+                    return false;
+                  }
+              }
+            else if (token_stream.lookAhead() != ','
+                     && token_stream.lookAhead() != '>')
+              {
+                token_stream.rewind((int) start);
+                return false;
+              }
+          }
+      }
+      break;
+
+    case Token_template:
+      {
+        token_stream.nextToken(); // skip template
+        ADVANCE('<', "<");
+
+        if (!parseTemplateParameterList(ast->template_parameters))
+          return false;
+
+        ADVANCE('>', ">");
+
+        if (token_stream.lookAhead() == Token_class)
+          token_stream.nextToken();
+
+        // parse optional name
+        if (parseName(ast->name, true))
+          {
+            if (token_stream.lookAhead() == '=')
+              {
+                token_stream.nextToken();
+
+                if (!parseTypeId(ast->type_id))
+                  {
+                    syntaxError();
+                    return false;
+                  }
+              }
+          }
+
+        if (token_stream.lookAhead() == '=')
+          {
+            token_stream.nextToken();
+
+            parseName(ast->template_name, true);
+          }
+      }
+      break;
+
+    default:
+      return false;
+
+    } // end switch
+
+
+  UPDATE_POS(ast, start, token_stream.cursor());
+  node = ast;
+  return true;
+}
+
+bool Parser::parseStorageClassSpecifier(const ListNode<std::size_t> *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  int tk;
+  while (0 != (tk = token_stream.lookAhead())
+         && (tk == Token_friend || tk == Token_auto
+             || tk == Token_register || tk == Token_static
+             || tk == Token_extern || tk == Token_mutable))
+    {
+      node = snoc(node, token_stream.cursor(), _M_pool);
+      token_stream.nextToken();
+    }
+
+  return start != token_stream.cursor();
+}
+
+bool Parser::parseFunctionSpecifier(const ListNode<std::size_t> *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  int tk;
+  while (0 != (tk = token_stream.lookAhead())
+         && (tk == Token_inline || tk == Token_virtual
+             || tk == Token_explicit || tk == Token_Q_INVOKABLE))
+    {
+      node = snoc(node, token_stream.cursor(), _M_pool);
+      token_stream.nextToken();
+    }
+
+  return start != token_stream.cursor();
+}
+
+bool Parser::parseTypeId(TypeIdAST *&node)
+{
+  /// @todo implement the AST for typeId
+  std::size_t start = token_stream.cursor();
+
+  TypeSpecifierAST *spec = 0;
+  if (!parseTypeSpecifier(spec))
+    {
+      token_stream.rewind((int) start);
+      return false;
+    }
+
+  DeclaratorAST *decl = 0;
+  parseAbstractDeclarator(decl);
+
+  TypeIdAST *ast = CreateNode<TypeIdAST>(_M_pool);
+  ast->type_specifier = spec;
+  ast->declarator = decl;
+
+  UPDATE_POS(ast, start, token_stream.cursor());
+  node = ast;
+
+  return true;
+}
+
+bool Parser::parseInitDeclaratorList(const ListNode<InitDeclaratorAST*> *&node)
+{
+  InitDeclaratorAST *decl = 0;
+  if (!parseInitDeclarator(decl))
+    return false;
+
+  node = snoc(node, decl, _M_pool);
+
+  while (token_stream.lookAhead() == ',')
+    {
+      token_stream.nextToken();
+
+      if (!parseInitDeclarator(decl))
+        {
+          syntaxError();
+          break;
+        }
+      node = snoc(node, decl, _M_pool);
+    }
+
+  return true;
+}
+
+bool Parser::parseParameterDeclarationClause(ParameterDeclarationClauseAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  ParameterDeclarationClauseAST *ast
+    = CreateNode<ParameterDeclarationClauseAST>(_M_pool);
+
+  if (!parseParameterDeclarationList(ast->parameter_declarations))
+    {
+      if (token_stream.lookAhead() == ')')
+        goto good;
+
+      if (token_stream.lookAhead() == Token_ellipsis
+          && token_stream.lookAhead(1) == ')')
+        {
+          ast->ellipsis = token_stream.cursor();
+          goto good;
+        }
+
+      return false;
+    }
+
+ good:
+
+  if (token_stream.lookAhead() == Token_ellipsis)
+    {
+      ast->ellipsis = token_stream.cursor();
+      token_stream.nextToken();
+    }
+
+  /// @todo add ellipsis
+  UPDATE_POS(ast, start, token_stream.cursor());
+  node = ast;
+
+  return true;
+}
+
+bool Parser::parseParameterDeclarationList(const ListNode<ParameterDeclarationAST*> *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  ParameterDeclarationAST *param = 0;
+  if (!parseParameterDeclaration(param))
+    {
+      token_stream.rewind((int) start);
+      return false;
+    }
+
+  node = snoc(node, param, _M_pool);
+
+  while (token_stream.lookAhead() == ',')
+    {
+      token_stream.nextToken();
+
+      if (token_stream.lookAhead() == Token_ellipsis)
+        break;
+
+      if (!parseParameterDeclaration(param))
+        {
+          token_stream.rewind((int) start);
+          return false;
+        }
+      node = snoc(node, param, _M_pool);
+    }
+
+  return true;
+}
+
+bool Parser::parseParameterDeclaration(ParameterDeclarationAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  const ListNode<std::size_t> *storage = 0;
+  parseStorageClassSpecifier(storage);
+
+  // parse decl spec
+  TypeSpecifierAST *spec = 0;
+  if (!parseTypeSpecifier(spec))
+    {
+      token_stream.rewind((int) start);
+      return false;
+    }
+
+  int index = (int) token_stream.cursor();
+
+  DeclaratorAST *decl = 0;
+  if (!parseDeclarator(decl))
+    {
+      token_stream.rewind((int) index);
+
+      // try with abstract declarator
+      parseAbstractDeclarator(decl);
+    }
+
+  ExpressionAST *expr = 0;
+  if (token_stream.lookAhead() == '=')
+    {
+      token_stream.nextToken();
+      if (!parseLogicalOrExpression(expr,true))
+        {
+          //reportError(("Expression expected"));
+        }
+    }
+
+  ParameterDeclarationAST *ast = CreateNode<ParameterDeclarationAST>(_M_pool);
+  ast->type_specifier = spec;
+  ast->declarator = decl;
+  ast->expression = expr;
+
+  UPDATE_POS(ast, start, token_stream.cursor());
+  node = ast;
+
+  return true;
+}
+
+bool Parser::parse_Attribute__() {
+    token_stream.nextToken();
+
+    ADVANCE('(', "(");
+
+    ExpressionAST *expr = 0;
+    parseExpression(expr);
+
+    if (token_stream.lookAhead() != ')')
+    {
+        reportError(("')' expected"));
+        return false;
+    }
+    else
+    {
+        token_stream.nextToken();
+    }
+    return true;
+}
+
+QString Parser::tokenText(AST *ast) const
+{
+    if (ast == 0) return QString();
+
+    int start_token = ast->start_token;
+    int end_token = ast->end_token;
+
+    Token const &tk = token_stream.token (start_token);
+    Token const &end_tk = token_stream.token(end_token);
+
+    return QString::fromLatin1 (&tk.text[tk.position],(int) (end_tk.position - tk.position)).trimmed();
+}
+
+bool Parser::parseForwardDeclarationSpecifier(TypeSpecifierAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  int kind = token_stream.lookAhead();
+  if (kind != Token_class && kind != Token_struct && kind != Token_union)
+    return false;
+
+  std::size_t class_key = token_stream.cursor();
+  token_stream.nextToken();
+
+  NameAST *name = 0;
+  if (!parseName(name, false)) {
+      token_stream.rewind((int) start);
+      return false;
+  }
+
+  BaseClauseAST *bases = 0;
+  if (token_stream.lookAhead() == ':')
+    {
+      if (!parseBaseClause(bases))
+        {
+          token_stream.rewind((int) start);
+          return false;
+        }
+    }
+
+  if (token_stream.lookAhead() != ';')
+    {
+        token_stream.rewind((int) start);
+        return false;
+    }
+
+  ForwardDeclarationSpecifierAST *ast = CreateNode<ForwardDeclarationSpecifierAST>(_M_pool);
+  ast->class_key = class_key;
+  ast->name = name;
+  ast->base_clause = bases;
+
+  UPDATE_POS(ast, start, token_stream.cursor());
+  node = ast;
+
+  return true;
+}
+
+bool Parser::parseClassSpecifier(TypeSpecifierAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  int kind = token_stream.lookAhead();
+  if (kind != Token_class && kind != Token_struct && kind != Token_union)
+    return false;
+
+  std::size_t class_key = token_stream.cursor();
+  token_stream.nextToken();
+
+  WinDeclSpecAST *winDeclSpec = 0;
+  parseWinDeclSpec(winDeclSpec);
+
+  if (token_stream.lookAhead() == Token___attribute__) {
+      parse_Attribute__();
+  }
+
+  while (token_stream.lookAhead() == Token_identifier
+         && token_stream.lookAhead(1) == Token_identifier)
+    {
+      token_stream.nextToken();
+    }
+
+  NameAST *name = 0;
+  parseName(name, true);
+
+  BaseClauseAST *bases = 0;
+
+  if (token_stream.lookAhead() == ':')
+    {
+      if (!parseBaseClause(bases))
+        {
+          skipUntil('{');
+        }
+    }
+
+  if (token_stream.lookAhead() != '{')
+    {
+
+      token_stream.rewind((int) start);
+      return false;
+    }
+
+  ADVANCE('{', "{");
+
+  ClassSpecifierAST *ast = CreateNode<ClassSpecifierAST>(_M_pool);
+  ast->win_decl_specifiers = winDeclSpec;
+  ast->class_key = class_key;
+  ast->name = name;
+  ast->base_clause = bases;
+
+  while (token_stream.lookAhead())
+    {
+      if (token_stream.lookAhead() == '}')
+        break;
+
+      std::size_t startDecl = token_stream.cursor();
+
+      DeclarationAST *memSpec = 0;
+      if (!parseMemberSpecification(memSpec))
+        {
+          if (startDecl == token_stream.cursor())
+            token_stream.nextToken(); // skip at least one token
+          skipUntilDeclaration();
+        }
+      else
+        ast->member_specs = snoc(ast->member_specs, memSpec, _M_pool);
+    }
+
+  ADVANCE_NR('}', "}");
+
+  UPDATE_POS(ast, start, token_stream.cursor());
+  node = ast;
+
+  return true;
+}
+
+bool Parser::parseAccessSpecifier(DeclarationAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  const ListNode<std::size_t> *specs = 0;
+
+  bool done = false;
+  while (!done)
+    {
+      switch(token_stream.lookAhead())
+        {
+        case Token_signals:
+        case Token_slots:
+        case Token_k_dcop:
+        case Token_k_dcop_signals:
+        case Token_public:
+        case Token_protected:
+        case Token_private:
+          specs = snoc(specs, token_stream.cursor(), _M_pool);
+          token_stream.nextToken();
+          break;
+
+        default:
+          done = true;
+          break;
+        }
+    }
+
+  if (!specs)
+    return false;
+
+  ADVANCE(':', ":");
+
+  AccessSpecifierAST *ast = CreateNode<AccessSpecifierAST>(_M_pool);
+  ast->specs = specs;
+  UPDATE_POS(ast, start, token_stream.cursor());
+  node = ast;
+
+  return true;
+}
+
+bool Parser::parseMemberSpecification(DeclarationAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  if (token_stream.lookAhead() == ';')
+    {
+      token_stream.nextToken();
+      return true;
+    }
+  else if (token_stream.lookAhead() == Token_Q_OBJECT || token_stream.lookAhead() == Token_K_DCOP)
+    {
+      token_stream.nextToken();
+      return true;
+    }
+  else if (parseTypedef(node))
+    {
+      return true;
+    }
+  else if (parseUsing(node))
+    {
+      return true;
+    }
+  else if (parseTemplateDeclaration(node))
+    {
+      return true;
+    }
+  else if (parseAccessSpecifier(node))
+    {
+      return true;
+    }
+  else if (parseQ_PROPERTY(node))
+    {
+      return true;
+    }
+  else if (parseQ_ENUMS(node))
+    {
+      return true;
+    }
+
+  token_stream.rewind((int) start);
+
+  const ListNode<std::size_t> *cv = 0;
+  parseCvQualify(cv);
+
+  const ListNode<std::size_t> *storageSpec = 0;
+  parseStorageClassSpecifier(storageSpec);
+
+  parseCvQualify(cv);
+
+  TypeSpecifierAST *spec = 0;
+  if (parseEnumSpecifier(spec) || parseClassSpecifier(spec))
+    {
+      parseCvQualify(cv);
+      spec->cv = cv;
+
+      const ListNode<InitDeclaratorAST*> *declarators = 0;
+      parseInitDeclaratorList(declarators);
+      ADVANCE(';', ";");
+
+      SimpleDeclarationAST *ast = CreateNode<SimpleDeclarationAST>(_M_pool);
+      ast->type_specifier = spec;
+      ast->init_declarators = declarators;
+      UPDATE_POS(ast, start, token_stream.cursor());
+      node = ast;
+
+      return true;
+    }
+
+  token_stream.rewind((int) start);
+  return parseDeclarationInternal(node);
+}
+
+bool Parser::parseCtorInitializer(CtorInitializerAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  CHECK(':');
+
+  CtorInitializerAST *ast = CreateNode<CtorInitializerAST>(_M_pool);
+  ast->colon = start;
+
+  if (!parseMemInitializerList(ast->member_initializers))
+    {
+      reportError(("Member initializers expected"));
+    }
+
+  UPDATE_POS(ast, start, token_stream.cursor());
+  node = ast;
+
+  return true;
+}
+
+bool Parser::parseElaboratedTypeSpecifier(TypeSpecifierAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  int tk = token_stream.lookAhead();
+  if (tk == Token_class  ||
+      tk == Token_struct ||
+      tk == Token_union  ||
+      tk == Token_enum   ||
+      tk == Token_typename)
+    {
+      std::size_t type = token_stream.cursor();
+      token_stream.nextToken();
+
+      NameAST *name = 0;
+      if (parseName(name, true))
+        {
+          ElaboratedTypeSpecifierAST *ast
+            = CreateNode<ElaboratedTypeSpecifierAST>(_M_pool);
+
+          ast->type = type;
+          ast->name = name;
+
+          UPDATE_POS(ast, start, token_stream.cursor());
+          node = ast;
+
+          return true;
+        }
+    }
+
+  token_stream.rewind((int) start);
+  return false;
+}
+
+bool Parser::parseExceptionSpecification(ExceptionSpecificationAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  CHECK(Token_throw);
+  ADVANCE('(', "(");
+
+  ExceptionSpecificationAST *ast
+    = CreateNode<ExceptionSpecificationAST>(_M_pool);
+
+  if (token_stream.lookAhead() == Token_ellipsis)
+    {
+      ast->ellipsis = token_stream.cursor();
+      token_stream.nextToken();
+    }
+  else
+    {
+      parseTypeIdList(ast->type_ids);
+    }
+
+  ADVANCE(')', ")");
+
+  UPDATE_POS(ast, start, token_stream.cursor());
+  node = ast;
+
+  return true;
+}
+
+bool Parser::parseEnumerator(EnumeratorAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  CHECK(Token_identifier);
+  std::size_t id = token_stream.cursor() - 1;
+
+  EnumeratorAST *ast = CreateNode<EnumeratorAST>(_M_pool);
+  ast->id = id;
+
+  if (token_stream.lookAhead() == '=')
+    {
+      token_stream.nextToken();
+
+      if (!parseConstantExpression(ast->expression))
+        {
+          reportError(("Constant expression expected"));
+        }
+    }
+
+  UPDATE_POS(ast, start, token_stream.cursor());
+  node = ast;
+
+  return true;
+}
+
+bool Parser::parseInitDeclarator(InitDeclaratorAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  DeclaratorAST *decl = 0;
+  if (!parseDeclarator(decl))
+    {
+      return false;
+    }
+
+  if (token_stream.lookAhead(0) == Token_asm)
+    {
+      token_stream.nextToken();
+      skip('(', ')');
+      token_stream.nextToken();
+    }
+
+  InitializerAST *init = 0;
+  parseInitializer(init);
+
+  InitDeclaratorAST *ast = CreateNode<InitDeclaratorAST>(_M_pool);
+  ast->declarator = decl;
+  ast->initializer = init;
+
+  UPDATE_POS(ast, start, token_stream.cursor());
+  node = ast;
+
+  return true;
+}
+
+bool Parser::parseBaseClause(BaseClauseAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  CHECK(':');
+
+  BaseSpecifierAST *baseSpec = 0;
+  if (!parseBaseSpecifier(baseSpec))
+    return false;
+
+  BaseClauseAST *ast = CreateNode<BaseClauseAST>(_M_pool);
+  ast->base_specifiers = snoc(ast->base_specifiers, baseSpec, _M_pool);
+
+  while (token_stream.lookAhead() == ',')
+    {
+      token_stream.nextToken();
+
+      if (!parseBaseSpecifier(baseSpec))
+        {
+          reportError(("Base class specifier expected"));
+          break;
+        }
+      ast->base_specifiers = snoc(ast->base_specifiers, baseSpec, _M_pool);
+    }
+
+  UPDATE_POS(ast, start, token_stream.cursor());
+  node = ast;
+
+  return true;
+}
+
+bool Parser::parseInitializer(InitializerAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  int tk = token_stream.lookAhead();
+  if (tk != '=' && tk != '(')
+    return false;
+
+  InitializerAST *ast = CreateNode<InitializerAST>(_M_pool);
+
+  if (tk == '=')
+    {
+      token_stream.nextToken();
+
+      if (!parseInitializerClause(ast->initializer_clause))
+        {
+          reportError(("Initializer clause expected"));
+        }
+    }
+  else if (tk == '(')
+    {
+      token_stream.nextToken();
+      parseCommaExpression(ast->expression);
+      CHECK(')');
+    }
+
+  UPDATE_POS(ast, start, token_stream.cursor());
+  node = ast;
+
+  return true;
+}
+
+bool Parser::parseMemInitializerList(const ListNode<MemInitializerAST*> *&node)
+{
+  MemInitializerAST *init = 0;
+
+  if (!parseMemInitializer(init))
+    return false;
+
+  node = snoc(node, init, _M_pool);
+
+  while (token_stream.lookAhead() == ',')
+    {
+      token_stream.nextToken();
+
+      if (!parseMemInitializer(init))
+        break;
+
+      node = snoc(node, init, _M_pool);
+    }
+
+  return true;
+}
+
+bool Parser::parseMemInitializer(MemInitializerAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  NameAST *initId = 0;
+  if (!parseName(initId, true))
+    {
+      reportError(("Identifier expected"));
+      return false;
+    }
+
+  ADVANCE('(', "(");
+  ExpressionAST *expr = 0;
+  parseCommaExpression(expr);
+  ADVANCE(')', ")");
+
+  MemInitializerAST *ast = CreateNode<MemInitializerAST>(_M_pool);
+  ast->initializer_id = initId;
+  ast->expression = expr;
+
+  UPDATE_POS(ast, start, token_stream.cursor());
+  node = ast;
+
+  return true;
+}
+
+bool Parser::parseTypeIdList(const ListNode<TypeIdAST*> *&node)
+{
+  TypeIdAST *typeId = 0;
+  if (!parseTypeId(typeId))
+    return false;
+
+  node = snoc(node, typeId, _M_pool);
+
+  while (token_stream.lookAhead() == ',')
+    {
+      token_stream.nextToken();
+      if (parseTypeId(typeId))
+        {
+          node = snoc(node, typeId, _M_pool);
+        }
+      else
+        {
+          reportError(("Type id expected"));
+          break;
+        }
+    }
+
+  return true;
+}
+
+bool Parser::parseBaseSpecifier(BaseSpecifierAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  BaseSpecifierAST *ast = CreateNode<BaseSpecifierAST>(_M_pool);
+
+  if (token_stream.lookAhead() == Token_virtual)
+    {
+      ast->virt = token_stream.cursor();
+      token_stream.nextToken();
+
+      int tk = token_stream.lookAhead();
+      if (tk == Token_public || tk == Token_protected
+          || tk == Token_private)
+        {
+          ast->access_specifier = token_stream.cursor();
+          token_stream.nextToken();
+        }
+    }
+  else
+    {
+      int tk = token_stream.lookAhead();
+      if (tk == Token_public || tk == Token_protected
+          || tk == Token_private)
+        {
+          ast->access_specifier = token_stream.cursor();
+          token_stream.nextToken();
+        }
+
+      if (token_stream.lookAhead() == Token_virtual)
+        {
+          ast->virt = token_stream.cursor();
+          token_stream.nextToken();
+        }
+    }
+
+  if (!parseName(ast->name, true))
+    reportError(("Class name expected"));
+
+  UPDATE_POS(ast, start, token_stream.cursor());
+  node = ast;
+
+  return true;
+}
+
+bool Parser::parseInitializerClause(InitializerClauseAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  InitializerClauseAST *ast = CreateNode<InitializerClauseAST>(_M_pool);
+
+  if (token_stream.lookAhead() == '{')
+    {
+#if defined(__GNUC__)
+#warning "implement me"
+#endif
+      if (skip('{','}'))
+        token_stream.nextToken();
+      else
+        reportError(("} missing"));
+    }
+  else
+    {
+      if (!parseAssignmentExpression(ast->expression))
+        {
+          //reportError(("Expression expected"));
+        }
+    }
+
+  UPDATE_POS(ast, start, token_stream.cursor());
+  node = ast;
+
+  return true;
+}
+
+bool Parser::parsePtrToMember(PtrToMemberAST *&node)
+{
+#if defined(__GNUC__)
+#warning "implemente me (AST)"
+#endif
+
+  std::size_t start = token_stream.cursor();
+
+  std::size_t global_scope = 0;
+  if (token_stream.lookAhead() == Token_scope)
+    {
+      global_scope = token_stream.cursor();
+      token_stream.nextToken();
+    }
+
+  UnqualifiedNameAST *name = 0;
+  while (token_stream.lookAhead() == Token_identifier)
+    {
+      if (!parseUnqualifiedName(name))
+        break;
+
+      if (token_stream.lookAhead() == Token_scope
+          && token_stream.lookAhead(1) == '*')
+        {
+          token_stream.nextToken();
+          token_stream.nextToken();
+
+          PtrToMemberAST *ast = CreateNode<PtrToMemberAST>(_M_pool);
+          UPDATE_POS(ast, start, token_stream.cursor());
+          node = ast;
+
+          return true;
+        }
+
+      if (token_stream.lookAhead() == Token_scope)
+        token_stream.nextToken();
+    }
+
+  token_stream.rewind((int) start);
+  return false;
+}
+
+bool Parser::parseUnqualifiedName(UnqualifiedNameAST *&node,
+                                  bool parseTemplateId)
+{
+  std::size_t start = token_stream.cursor();
+
+  std::size_t tilde = 0;
+  std::size_t id = 0;
+  OperatorFunctionIdAST *operator_id = 0;
+
+  if (token_stream.lookAhead() == Token_identifier)
+    {
+      id = token_stream.cursor();
+      token_stream.nextToken();
+    }
+  else if (token_stream.lookAhead() == '~'
+           && token_stream.lookAhead(1) == Token_identifier)
+    {
+      tilde = token_stream.cursor();
+      token_stream.nextToken(); // skip ~
+
+      id = token_stream.cursor();
+      token_stream.nextToken(); // skip classname
+    }
+  else if (token_stream.lookAhead() == Token_operator)
+    {
+      if (!parseOperatorFunctionId(operator_id))
+        return false;
+    }
+  else
+    {
+      return false;
+    }
+
+  UnqualifiedNameAST *ast = CreateNode<UnqualifiedNameAST>(_M_pool);
+  ast->tilde = tilde;
+  ast->id = id;
+  ast->operator_id = operator_id;
+
+  if (parseTemplateId && !tilde)
+    {
+      std::size_t index = token_stream.cursor();
+
+      if (token_stream.lookAhead() == '<')
+        {
+          token_stream.nextToken();
+
+          // optional template arguments
+          parseTemplateArgumentList(ast->template_arguments);
+
+          if (token_stream.lookAhead() == '>')
+            {
+              token_stream.nextToken();
+            }
+          else
+            {
+              ast->template_arguments = 0;
+              token_stream.rewind((int) index);
+            }
+        }
+    }
+
+  UPDATE_POS(ast, start, token_stream.cursor());
+  node = ast;
+
+  return true;
+}
+
+bool Parser::parseStringLiteral(StringLiteralAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  if (token_stream.lookAhead() != Token_string_literal)
+    return false;
+
+  StringLiteralAST *ast = CreateNode<StringLiteralAST>(_M_pool);
+
+  while (token_stream.lookAhead() == Token_string_literal)
+    {
+      ast->literals = snoc(ast->literals, token_stream.cursor(), _M_pool);
+      token_stream.nextToken();
+    }
+
+  UPDATE_POS(ast, start, token_stream.cursor());
+  node = ast;
+
+  return true;
+}
+
+bool Parser::parseExpressionStatement(StatementAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  ExpressionAST *expr = 0;
+  parseCommaExpression(expr);
+
+  ADVANCE(';', ";");
+
+  ExpressionStatementAST *ast = CreateNode<ExpressionStatementAST>(_M_pool);
+  ast->expression = expr;
+
+  UPDATE_POS(ast, start, token_stream.cursor());
+  node = ast;
+
+  return true;
+}
+
+bool Parser::parseStatement(StatementAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  switch(token_stream.lookAhead())
+    {
+    case Token_while:
+      return parseWhileStatement(node);
+
+    case Token_do:
+      return parseDoStatement(node);
+
+    case Token_for:
+      return parseForStatement(node);
+
+    case Token_if:
+      return parseIfStatement(node);
+
+    case Token_switch:
+      return parseSwitchStatement(node);
+
+    case Token_try:
+      return parseTryBlockStatement(node);
+
+    case Token_case:
+    case Token_default:
+      return parseLabeledStatement(node);
+
+    case Token_break:
+    case Token_continue:
+#if defined(__GNUC__)
+#warning "implement me"
+#endif
+      token_stream.nextToken();
+      ADVANCE(';', ";");
+      return true;
+
+    case Token_goto:
+#if defined(__GNUC__)
+#warning "implement me"
+#endif
+      token_stream.nextToken();
+      ADVANCE(Token_identifier, "identifier");
+      ADVANCE(';', ";");
+      return true;
+
+    case Token_return:
+      {
+        token_stream.nextToken();
+        ExpressionAST *expr = 0;
+        parseCommaExpression(expr);
+
+        ADVANCE(';', ";");
+
+        ReturnStatementAST *ast = CreateNode<ReturnStatementAST>(_M_pool);
+        ast->expression = expr;
+
+        UPDATE_POS(ast, start, token_stream.cursor());
+        node = ast;
+      }
+      return true;
+
+    case '{':
+      return parseCompoundStatement(node);
+
+    case Token_identifier:
+      if (parseLabeledStatement(node))
+        return true;
+      break;
+    }
+
+  return parseExpressionOrDeclarationStatement(node);
+}
+
+bool Parser::parseExpressionOrDeclarationStatement(StatementAST *&node)
+{
+  bool blocked = block_errors(true);
+
+  std::size_t start = token_stream.cursor();
+
+  StatementAST *decl_ast = 0;
+  bool maybe_amb = parseDeclarationStatement(decl_ast);
+  maybe_amb &= token_stream.kind(token_stream.cursor() - 1) == ';';
+
+  std::size_t end = token_stream.cursor();
+
+  token_stream.rewind((int) start);
+  StatementAST *expr_ast = 0;
+  maybe_amb &= parseExpressionStatement(expr_ast);
+  maybe_amb &= token_stream.kind(token_stream.cursor() - 1) == ';';
+
+  if (maybe_amb)
+    {
+      Q_ASSERT(decl_ast != 0 && expr_ast != 0);
+      ExpressionOrDeclarationStatementAST *ast
+        = CreateNode<ExpressionOrDeclarationStatementAST>(_M_pool);
+      ast->declaration = decl_ast;
+      ast->expression = expr_ast;
+
+      UPDATE_POS(ast, start, token_stream.cursor());
+      node = ast;
+    }
+  else
+    {
+      token_stream.rewind((int) std::max(end, token_stream.cursor()));
+
+      node = decl_ast;
+      if (!node)
+        node = expr_ast;
+    }
+
+  block_errors(blocked);
+
+  if (!node)
+    syntaxError();
+
+  return node != 0;
+}
+
+bool Parser::parseCondition(ConditionAST *&node, bool initRequired)
+{
+  std::size_t start = token_stream.cursor();
+
+  ConditionAST *ast = CreateNode<ConditionAST>(_M_pool);
+  TypeSpecifierAST *spec = 0;
+
+  if (parseTypeSpecifier(spec))
+    {
+      ast->type_specifier = spec;
+
+      std::size_t declarator_start = token_stream.cursor();
+
+      DeclaratorAST *decl = 0;
+      if (!parseDeclarator(decl))
+        {
+          token_stream.rewind((int) declarator_start);
+          if (!initRequired && !parseAbstractDeclarator(decl))
+            decl = 0;
+        }
+
+      if (decl && (!initRequired || token_stream.lookAhead() == '='))
+        {
+          ast->declarator = decl;
+
+          if (token_stream.lookAhead() == '=')
+            {
+              token_stream.nextToken();
+
+              parseExpression(ast->expression);
+            }
+
+          UPDATE_POS(ast, start, token_stream.cursor());
+          node = ast;
+
+          return true;
+        }
+    }
+
+  token_stream.rewind((int) start);
+
+  if (!parseCommaExpression(ast->expression))
+    return false;
+
+  UPDATE_POS(ast, start, token_stream.cursor());
+  node = ast;
+
+  return true;
+}
+
+
+bool Parser::parseWhileStatement(StatementAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  ADVANCE(Token_while, "while");
+  ADVANCE('(' , "(");
+
+  ConditionAST *cond = 0;
+  if (!parseCondition(cond))
+    {
+      reportError(("condition expected"));
+      return false;
+    }
+  ADVANCE(')', ")");
+
+  StatementAST *body = 0;
+  if (!parseStatement(body))
+    {
+      reportError(("statement expected"));
+      return false;
+    }
+
+  WhileStatementAST *ast = CreateNode<WhileStatementAST>(_M_pool);
+  ast->condition = cond;
+  ast->statement = body;
+
+  UPDATE_POS(ast, start, token_stream.cursor());
+  node = ast;
+
+  return true;
+}
+
+bool Parser::parseDoStatement(StatementAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  ADVANCE(Token_do, "do");
+
+  StatementAST *body = 0;
+  if (!parseStatement(body))
+    {
+      reportError(("statement expected"));
+      //return false;
+    }
+
+  ADVANCE_NR(Token_while, "while");
+  ADVANCE_NR('(' , "(");
+
+  ExpressionAST *expr = 0;
+  if (!parseCommaExpression(expr))
+    {
+      reportError(("expression expected"));
+      //return false;
+    }
+
+  ADVANCE_NR(')', ")");
+  ADVANCE_NR(';', ";");
+
+  DoStatementAST *ast = CreateNode<DoStatementAST>(_M_pool);
+  ast->statement = body;
+  ast->expression = expr;
+
+  UPDATE_POS(ast, start, token_stream.cursor());
+  node = ast;
+
+  return true;
+}
+
+bool Parser::parseForStatement(StatementAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  ADVANCE(Token_for, "for");
+  ADVANCE('(', "(");
+
+  StatementAST *init = 0;
+  if (!parseForInitStatement(init))
+    {
+      reportError(("for initialization expected"));
+      return false;
+    }
+
+  ConditionAST *cond = 0;
+  parseCondition(cond);
+  ADVANCE(';', ";");
+
+  ExpressionAST *expr = 0;
+  parseCommaExpression(expr);
+  ADVANCE(')', ")");
+
+  StatementAST *body = 0;
+  if (!parseStatement(body))
+    return false;
+
+  ForStatementAST *ast = CreateNode<ForStatementAST>(_M_pool);
+  ast->init_statement = init;
+  ast->condition = cond;
+  ast->expression = expr;
+  ast->statement = body;
+
+  UPDATE_POS(ast, start, token_stream.cursor());
+  node = ast;
+
+  return true;
+}
+
+bool Parser::parseForInitStatement(StatementAST *&node)
+{
+  if (parseDeclarationStatement(node))
+    return true;
+
+  return parseExpressionStatement(node);
+}
+
+bool Parser::parseCompoundStatement(StatementAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  CHECK('{');
+
+  CompoundStatementAST *ast = CreateNode<CompoundStatementAST>(_M_pool);
+
+  while (token_stream.lookAhead())
+    {
+      if (token_stream.lookAhead() == '}')
+        break;
+
+      std::size_t startStmt = token_stream.cursor();
+
+      StatementAST *stmt = 0;
+      if (!parseStatement(stmt))
+        {
+          if (startStmt == token_stream.cursor())
+            token_stream.nextToken();
+
+          skipUntilStatement();
+        }
+      else
+        {
+          ast->statements = snoc(ast->statements, stmt, _M_pool);
+        }
+    }
+
+  ADVANCE_NR('}', "}");
+
+  UPDATE_POS(ast, start, token_stream.cursor());
+  node = ast;
+
+  return true;
+}
+
+bool Parser::parseIfStatement(StatementAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  ADVANCE(Token_if, "if");
+
+  ADVANCE('(' , "(");
+
+  IfStatementAST *ast = CreateNode<IfStatementAST>(_M_pool);
+
+  ConditionAST *cond = 0;
+  if (!parseCondition(cond))
+    {
+      reportError(("condition expected"));
+      return false;
+    }
+  ADVANCE(')', ")");
+
+  StatementAST *stmt = 0;
+  if (!parseStatement(stmt))
+    {
+      reportError(("statement expected"));
+      return false;
+    }
+
+  ast->condition = cond;
+  ast->statement = stmt;
+
+  if (token_stream.lookAhead() == Token_else)
+    {
+      token_stream.nextToken();
+
+      if (!parseStatement(ast->else_statement))
+        {
+          reportError(("statement expected"));
+          return false;
+        }
+    }
+
+  UPDATE_POS(ast, start, token_stream.cursor());
+  node = ast;
+
+  return true;
+}
+
+bool Parser::parseSwitchStatement(StatementAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+  ADVANCE(Token_switch, "switch");
+
+  ADVANCE('(' , "(");
+
+  ConditionAST *cond = 0;
+  if (!parseCondition(cond))
+    {
+      reportError(("condition expected"));
+      return false;
+    }
+  ADVANCE(')', ")");
+
+  StatementAST *stmt = 0;
+  if (!parseCompoundStatement(stmt))
+    {
+      syntaxError();
+      return false;
+    }
+
+  SwitchStatementAST *ast = CreateNode<SwitchStatementAST>(_M_pool);
+  ast->condition = cond;
+  ast->statement = stmt;
+
+  UPDATE_POS(ast, start, token_stream.cursor());
+  node = ast;
+
+  return true;
+}
+
+bool Parser::parseLabeledStatement(StatementAST *&node)
+{
+  switch(token_stream.lookAhead())
+    {
+    case Token_identifier:
+    case Token_default:
+      if (token_stream.lookAhead(1) == ':')
+        {
+          token_stream.nextToken();
+          token_stream.nextToken();
+
+          StatementAST *stmt = 0;
+          if (parseStatement(stmt))
+            {
+              node = stmt;
+              return true;
+            }
+        }
+      break;
+
+    case Token_case:
+      {
+        token_stream.nextToken();
+        ExpressionAST *expr = 0;
+        if (!parseConstantExpression(expr))
+          {
+            reportError(("expression expected"));
+          }
+        else if (token_stream.lookAhead() == Token_ellipsis)
+          {
+            token_stream.nextToken();
+
+            ExpressionAST *expr2 = 0;
+            if (!parseConstantExpression(expr2))
+              {
+                reportError(("expression expected"));
+              }
+          }
+        ADVANCE(':', ":");
+
+        StatementAST *stmt = 0;
+        if (parseStatement(stmt))
+          {
+            node = stmt;
+            return true;
+          }
+      }
+      break;
+
+    }
+
+  return false;
+}
+
+bool Parser::parseBlockDeclaration(DeclarationAST *&node)
+{
+  switch(token_stream.lookAhead())
+    {
+    case Token_typedef:
+      return parseTypedef(node);
+    case Token_using:
+      return parseUsing(node);
+    case Token_asm:
+      return parseAsmDefinition(node);
+    case Token_namespace:
+      return parseNamespaceAliasDefinition(node);
+    }
+
+  std::size_t start = token_stream.cursor();
+
+  const ListNode<std::size_t> *cv = 0;
+  parseCvQualify(cv);
+
+  const ListNode<std::size_t> *storageSpec = 0;
+  parseStorageClassSpecifier(storageSpec);
+
+  parseCvQualify(cv);
+
+  TypeSpecifierAST *spec = 0;
+  if (!parseTypeSpecifierOrClassSpec(spec))
+    { // replace with simpleTypeSpecifier?!?!
+      token_stream.rewind((int) start);
+      return false;
+    }
+
+  parseCvQualify(cv);
+  spec->cv = cv;
+
+  const ListNode<InitDeclaratorAST*> *declarators = 0;
+  parseInitDeclaratorList(declarators);
+
+  if (token_stream.lookAhead() != ';')
+    {
+      token_stream.rewind((int) start);
+      return false;
+    }
+  token_stream.nextToken();
+
+  SimpleDeclarationAST *ast = CreateNode<SimpleDeclarationAST>(_M_pool);
+  ast->type_specifier = spec;
+  ast->init_declarators = declarators;
+
+  UPDATE_POS(ast, start, token_stream.cursor());
+  node = ast;
+
+  return true;
+}
+
+bool Parser::parseNamespaceAliasDefinition(DeclarationAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  CHECK(Token_namespace);
+
+  NamespaceAliasDefinitionAST *ast
+    = CreateNode<NamespaceAliasDefinitionAST>(_M_pool);
+
+  ADVANCE(Token_identifier,  "identifier");
+  ast->namespace_name = token_stream.cursor() - 1;
+
+  ADVANCE('=', "=");
+
+  if (!parseName(ast->alias_name))
+    {
+      reportError(("Namespace name expected"));
+    }
+
+  ADVANCE(';', ";");
+
+  UPDATE_POS(ast, start, token_stream.cursor());
+  node = ast;
+
+  return true;
+}
+
+bool Parser::parseDeclarationStatement(StatementAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  DeclarationAST *decl = 0;
+  if (!parseBlockDeclaration(decl))
+    return false;
+
+  DeclarationStatementAST *ast = CreateNode<DeclarationStatementAST>(_M_pool);
+  ast->declaration = decl;
+
+  UPDATE_POS(ast, start, token_stream.cursor());
+  node = ast;
+
+  return true;
+}
+
+bool Parser::parseDeclarationInternal(DeclarationAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  // that is for the case '__declspec(dllexport) int ...' or
+  // '__declspec(dllexport) inline int ...', etc.
+  WinDeclSpecAST *winDeclSpec = 0;
+  parseWinDeclSpec(winDeclSpec);
+
+  const ListNode<std::size_t> *funSpec = 0;
+  bool hasFunSpec = parseFunctionSpecifier(funSpec);
+
+  const ListNode<std::size_t> *cv = 0;
+  parseCvQualify(cv);
+
+  const ListNode<std::size_t> *storageSpec = 0;
+  bool hasStorageSpec = parseStorageClassSpecifier(storageSpec);
+
+  if (hasStorageSpec && !hasFunSpec)
+    hasFunSpec = parseFunctionSpecifier(funSpec);
+
+  // that is for the case 'friend __declspec(dllexport) ....'
+  parseWinDeclSpec(winDeclSpec);
+
+  if (!cv)
+    parseCvQualify(cv);
+
+  int index = (int) token_stream.cursor();
+  NameAST *name = 0;
+  if (parseName(name, true) && token_stream.lookAhead() == '(')
+    {
+      // no type specifier, maybe a constructor or a cast operator??
+
+      token_stream.rewind((int) index);
+
+      InitDeclaratorAST *declarator = 0;
+      if (parseInitDeclarator(declarator))
+        {
+          switch(token_stream.lookAhead())
+            {
+            case ';':
+              {
+                token_stream.nextToken();
+
+                SimpleDeclarationAST *ast
+                  = CreateNode<SimpleDeclarationAST>(_M_pool);
+
+                ast->storage_specifiers = storageSpec;
+                ast->function_specifiers = funSpec;
+                ast->init_declarators = snoc(ast->init_declarators,
+                                             declarator, _M_pool);
+
+                UPDATE_POS(ast, start, token_stream.cursor());
+                node = ast;
+              }
+              return true;
+
+            case ':':
+              {
+                CtorInitializerAST *ctorInit = 0;
+                StatementAST *funBody = 0;
+
+                if (parseCtorInitializer(ctorInit)
+                    && parseFunctionBody(funBody))
+                  {
+                    FunctionDefinitionAST *ast
+                      = CreateNode<FunctionDefinitionAST>(_M_pool);
+
+                    ast->storage_specifiers = storageSpec;
+                    ast->function_specifiers = funSpec;
+                    ast->init_declarator = declarator;
+                    ast->function_body = funBody;
+
+                    UPDATE_POS(ast, start, token_stream.cursor());
+                    node = ast;
+
+                    return true;
+                  }
+              }
+              break;
+
+            case '{':
+              {
+                StatementAST *funBody = 0;
+                if (parseFunctionBody(funBody))
+                  {
+                    FunctionDefinitionAST *ast
+                      = CreateNode<FunctionDefinitionAST>(_M_pool);
+
+                    ast->storage_specifiers = storageSpec;
+                    ast->function_specifiers = funSpec;
+                    ast->init_declarator = declarator;
+                    ast->function_body = funBody;
+
+                    UPDATE_POS(ast, start, token_stream.cursor());
+                    node = ast;
+
+                    return true;
+                  }
+              }
+              break;
+
+            case '(':
+            case '[':
+              // ops!! it seems a declarator
+              goto start_decl;
+              break;
+            }
+
+        }
+    }
+
+ start_decl:
+  token_stream.rewind((int) index);
+
+  if (token_stream.lookAhead() == Token_const
+      && token_stream.lookAhead(1) == Token_identifier
+      && token_stream.lookAhead(2) == '=')
+    {
+      // constant definition
+      token_stream.nextToken(); // skip const
+
+      const ListNode<InitDeclaratorAST*> *declarators = 0;
+      if (!parseInitDeclaratorList(declarators))
+        {
+          syntaxError();
+          return false;
+        }
+
+      ADVANCE(';', ";");
+
+#if defined(__GNUC__)
+#warning "mark the ast as constant"
+#endif
+      SimpleDeclarationAST *ast = CreateNode<SimpleDeclarationAST>(_M_pool);
+      ast->init_declarators = declarators;
+
+      UPDATE_POS(ast, start, token_stream.cursor());
+      node = ast;
+
+      return true;
+    }
+
+  TypeSpecifierAST *spec = 0;
+  if (parseTypeSpecifier(spec))
+    {
+      Q_ASSERT(spec != 0);
+
+      if (!hasFunSpec)
+        parseFunctionSpecifier(funSpec);         // e.g. "void inline"
+
+      spec->cv = cv;
+
+      const ListNode<InitDeclaratorAST*> *declarators = 0;
+      InitDeclaratorAST *decl = 0;
+      int startDeclarator = (int) token_stream.cursor();
+      bool maybeFunctionDefinition = false;
+
+      if (token_stream.lookAhead() != ';')
+        {
+          if (parseInitDeclarator(decl) && token_stream.lookAhead() == '{')
+            {
+              // function definition
+              maybeFunctionDefinition = true;
+            }
+          else
+            {
+              token_stream.rewind((int) startDeclarator);
+              if (!parseInitDeclaratorList(declarators))
+                {
+                  syntaxError();
+                  return false;
+                }
+            }
+        }
+
+      switch(token_stream.lookAhead())
+        {
+        case ';':
+          {
+            token_stream.nextToken();
+            SimpleDeclarationAST *ast
+              = CreateNode<SimpleDeclarationAST>(_M_pool);
+
+            ast->storage_specifiers = storageSpec;
+            ast->function_specifiers = funSpec;
+            ast->type_specifier = spec;
+            ast->win_decl_specifiers = winDeclSpec;
+            ast->init_declarators = declarators;
+
+            UPDATE_POS(ast, start, token_stream.cursor());
+            node = ast;
+          }
+          return true;
+
+        case '{':
+          {
+            if (!maybeFunctionDefinition)
+              {
+                syntaxError();
+                return false;
+              }
+
+            StatementAST *funBody = 0;
+            if (parseFunctionBody(funBody))
+              {
+                FunctionDefinitionAST *ast
+                  = CreateNode<FunctionDefinitionAST>(_M_pool);
+
+                ast->win_decl_specifiers = winDeclSpec;
+                ast->storage_specifiers = storageSpec;
+                ast->function_specifiers = funSpec;
+                ast->type_specifier = spec;
+                ast->init_declarator = decl;
+                ast->function_body = funBody;
+
+                UPDATE_POS(ast, start, token_stream.cursor());
+                node = ast;
+
+                return true;
+              }
+          }
+          break;
+        } // end switch
+    }
+
+  syntaxError();
+  return false;
+}
+
+bool Parser::skipFunctionBody(StatementAST *&)
+{
+#if defined(__GNUC__)
+#warning "Parser::skipFunctionBody() -- implement me"
+#endif
+  Q_ASSERT(0); // ### not implemented
+  return 0;
+}
+
+bool Parser::parseFunctionBody(StatementAST *&node)
+{
+  if (control->skipFunctionBody())
+    return skipFunctionBody(node);
+
+  return parseCompoundStatement(node);
+}
+
+bool Parser::parseTypeSpecifierOrClassSpec(TypeSpecifierAST *&node)
+{
+  if (parseClassSpecifier(node))
+    return true;
+  else if (parseEnumSpecifier(node))
+    return true;
+  else if (parseTypeSpecifier(node))
+    return true;
+
+  return false;
+}
+
+bool Parser::parseTryBlockStatement(StatementAST *&node)
+{
+#if defined(__GNUC__)
+#warning "implement me"
+#endif
+  CHECK(Token_try);
+
+  StatementAST *stmt = 0;
+  if (!parseCompoundStatement(stmt))
+    {
+      syntaxError();
+      return false;
+    }
+
+  if (token_stream.lookAhead() != Token_catch)
+    {
+      reportError(("catch expected"));
+      return false;
+    }
+
+  while (token_stream.lookAhead() == Token_catch)
+    {
+      token_stream.nextToken();
+      ADVANCE('(', "(");
+      ConditionAST *cond = 0;
+      if (token_stream.lookAhead() == Token_ellipsis)
+        {
+          token_stream.nextToken();
+        }
+      else if (!parseCondition(cond, false))
+        {
+          reportError(("condition expected"));
+          return false;
+        }
+      ADVANCE(')', ")");
+
+      StatementAST *body = 0;
+      if (!parseCompoundStatement(body))
+        {
+          syntaxError();
+          return false;
+        }
+    }
+
+  node = stmt;
+  return true;
+}
+
+bool Parser::parsePrimaryExpression(ExpressionAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  PrimaryExpressionAST *ast = CreateNode<PrimaryExpressionAST>(_M_pool);
+
+  switch(token_stream.lookAhead())
+    {
+    case Token_string_literal:
+      parseStringLiteral(ast->literal);
+      break;
+
+    case Token_number_literal:
+    case Token_char_literal:
+    case Token_true:
+    case Token_false:
+    case Token_this:
+      ast->token = token_stream.cursor();
+      token_stream.nextToken();
+      break;
+
+    case '(':
+      token_stream.nextToken();
+
+      if (token_stream.lookAhead() == '{')
+        {
+          if (!parseCompoundStatement(ast->expression_statement))
+            return false;
+        }
+      else
+        {
+          if (!parseExpression(ast->sub_expression))
+            return false;
+        }
+
+      CHECK(')');
+      break;
+
+    default:
+      if (!parseName(ast->name))
+        return false;
+
+      break;
+    }
+
+  UPDATE_POS(ast, start, token_stream.cursor());
+  node = ast;
+
+  return true;
+}
+
+
+/*
+  postfix-expression-internal:
+  [ expression ]
+  ( expression-list [opt] )
+  (.|->) template [opt] id-expression
+  (.|->) pseudo-destructor-name
+  ++
+  --
+*/
+bool Parser::parsePostfixExpressionInternal(ExpressionAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  switch (token_stream.lookAhead())
+    {
+    case '[':
+      {
+        token_stream.nextToken();
+        ExpressionAST *expr = 0;
+        parseExpression(expr);
+        CHECK(']');
+
+        SubscriptExpressionAST *ast
+          = CreateNode<SubscriptExpressionAST>(_M_pool);
+
+        ast->subscript = expr;
+
+        UPDATE_POS(ast, start, token_stream.cursor());
+        node = ast;
+      }
+      return true;
+
+    case '(':
+      {
+        token_stream.nextToken();
+        ExpressionAST *expr = 0;
+        parseExpression(expr);
+        CHECK(')');
+
+        FunctionCallAST *ast = CreateNode<FunctionCallAST>(_M_pool);
+        ast->arguments = expr;
+
+        UPDATE_POS(ast, start, token_stream.cursor());
+        node = ast;
+      }
+      return true;
+
+    case '.':
+    case Token_arrow:
+      {
+        std::size_t op = token_stream.cursor();
+        token_stream.nextToken();
+
+        std::size_t templ = 0;
+        if (token_stream.lookAhead() == Token_template)
+          {
+            templ = token_stream.cursor();
+            token_stream.nextToken();
+          }
+
+        int saved = int(token_stream.cursor());
+        NameAST *name = 0;
+
+        if (parseName(name, true) && name->unqualified_name
+            && name->unqualified_name->template_arguments != 0
+            && token_stream.lookAhead() == '(') {
+          // a template method call
+          // ### reverse the logic
+        } else {
+          token_stream.rewind(saved);
+          name = 0;
+
+          if (! parseName (name, templ != 0))
+            return false;
+        }
+
+        ClassMemberAccessAST *ast = CreateNode<ClassMemberAccessAST>(_M_pool);
+        ast->op = op;
+        ast->name = name;
+
+        UPDATE_POS(ast, start, token_stream.cursor());
+        node = ast;
+      }
+      return true;
+
+    case Token_incr:
+    case Token_decr:
+      {
+        std::size_t op = token_stream.cursor();
+        token_stream.nextToken();
+
+        IncrDecrExpressionAST *ast = CreateNode<IncrDecrExpressionAST>(_M_pool);
+        ast->op = op;
+
+        UPDATE_POS(ast, start, token_stream.cursor());
+        node = ast;
+      }
+      return true;
+
+    default:
+      return false;
+    }
+}
+
+/*
+  postfix-expression:
+  simple-type-specifier ( expression-list [opt] )
+  primary-expression postfix-expression-internal*
+*/
+bool Parser::parsePostfixExpression(ExpressionAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  switch (token_stream.lookAhead())
+    {
+    case Token_dynamic_cast:
+    case Token_static_cast:
+    case Token_reinterpret_cast:
+    case Token_const_cast:
+      {
+        std::size_t castOp = token_stream.cursor();
+        token_stream.nextToken();
+
+        CHECK('<');
+        TypeIdAST *typeId = 0;
+        parseTypeId(typeId);
+        CHECK('>');
+
+        CHECK('(');
+        ExpressionAST *expr = 0;
+        parseCommaExpression(expr);
+        CHECK(')');
+
+        CppCastExpressionAST *ast = CreateNode<CppCastExpressionAST>(_M_pool);
+        ast->op = castOp;
+        ast->type_id = typeId;
+        ast->expression = expr;
+
+        ExpressionAST *e = 0;
+        while (parsePostfixExpressionInternal(e))
+          {
+            ast->sub_expressions = snoc(ast->sub_expressions, e, _M_pool);
+          }
+
+        UPDATE_POS(ast, start, token_stream.cursor());
+        node = ast;
+      }
+      return true;
+
+    case Token_typename:
+      {
+        std::size_t token = token_stream.cursor();
+        token_stream.nextToken();
+
+        NameAST* name = 0;
+        if (!parseName(name, true))
+          return false;
+
+        CHECK('(');
+        ExpressionAST *expr = 0;
+        parseCommaExpression(expr);
+        CHECK(')');
+
+        TypeIdentificationAST *ast = CreateNode<TypeIdentificationAST>(_M_pool);
+        ast->typename_token = token;
+        ast->name = name;
+        ast->expression = expr;
+
+        UPDATE_POS(ast, start, token_stream.cursor());
+        node = ast;
+      }
+      return true;
+
+    case Token_typeid:
+      {
+        token_stream.nextToken();
+
+        CHECK('(');
+        TypeIdAST *typeId = 0;
+        parseTypeId(typeId);
+        CHECK(')');
+
+        TypeIdentificationAST *ast = CreateNode<TypeIdentificationAST>(_M_pool);
+        UPDATE_POS(ast, start, token_stream.cursor());
+        node = ast;
+      }
+      return true;
+
+    default:
+      break;
+    }
+
+  std::size_t saved_pos = token_stream.cursor();
+
+  TypeSpecifierAST *typeSpec = 0;
+  ExpressionAST *expr = 0;
+
+  // let's try to parse a type
+  NameAST *name = 0;
+  if (parseName(name, true))
+    {
+      Q_ASSERT(name->unqualified_name != 0);
+
+      bool has_template_args
+        = name->unqualified_name->template_arguments != 0;
+
+      if (has_template_args && token_stream.lookAhead() == '(')
+        {
+          ExpressionAST *cast_expr = 0;
+          if (parseCastExpression(cast_expr)
+              && cast_expr->kind == AST::Kind_CastExpression)
+            {
+              token_stream.rewind((int) saved_pos);
+              parsePrimaryExpression(expr);
+              goto L_no_rewind;
+            }
+        }
+    }
+
+  token_stream.rewind((int) saved_pos);
+
+ L_no_rewind:
+  if (!expr && parseSimpleTypeSpecifier(typeSpec)
+      && token_stream.lookAhead() == '(')
+    {
+      token_stream.nextToken(); // skip '('
+      parseCommaExpression(expr);
+      CHECK(')');
+    }
+  else if (expr)
+    {
+      typeSpec = 0;
+    }
+  else
+    {
+      typeSpec = 0;
+      token_stream.rewind((int) start);
+
+      if (!parsePrimaryExpression(expr))
+        return false;
+    }
+
+  const ListNode<ExpressionAST*> *sub_expressions = 0;
+  ExpressionAST *sub_expression = 0;
+
+  while (parsePostfixExpressionInternal(sub_expression))
+    sub_expressions = snoc(sub_expressions, sub_expression, _M_pool);
+
+  if (sub_expressions || ! expr || (typeSpec && expr))
+    {
+      PostfixExpressionAST *ast = CreateNode<PostfixExpressionAST>(_M_pool);
+      ast->type_specifier = typeSpec;
+      ast->expression = expr;
+      ast->sub_expressions = sub_expressions;
+
+      UPDATE_POS(ast, start, token_stream.cursor());
+      node = ast;
+    }
+  else
+    node = expr;
+
+  return true;
+}
+
+bool Parser::parseUnaryExpression(ExpressionAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  switch(token_stream.lookAhead())
+    {
+    case Token_incr:
+    case Token_decr:
+    case '*':
+    case '&':
+    case '+':
+    case '-':
+    case '!':
+    case '~':
+      {
+        std::size_t op = token_stream.cursor();
+        token_stream.nextToken();
+
+        ExpressionAST *expr = 0;
+        if (!parseCastExpression(expr))
+          return false;
+
+        UnaryExpressionAST *ast = CreateNode<UnaryExpressionAST>(_M_pool);
+        ast->op = op;
+        ast->expression = expr;
+
+        UPDATE_POS(ast, start, token_stream.cursor());
+        node = ast;
+      }
+      return true;
+
+    case Token_sizeof:
+      {
+        std::size_t sizeof_token = token_stream.cursor();
+        token_stream.nextToken();
+
+        SizeofExpressionAST *ast = CreateNode<SizeofExpressionAST>(_M_pool);
+        ast->sizeof_token = sizeof_token;
+
+        std::size_t index = token_stream.cursor();
+        if (token_stream.lookAhead() == '(')
+          {
+            token_stream.nextToken();
+            if (parseTypeId(ast->type_id) && token_stream.lookAhead() == ')')
+              {
+                token_stream.nextToken(); // skip )
+
+                UPDATE_POS(ast, start, token_stream.cursor());
+                node = ast;
+                return true;
+              }
+
+            ast->type_id = 0;
+            token_stream.rewind((int) index);
+          }
+
+        if (!parseUnaryExpression(ast->expression))
+          return false;
+
+        UPDATE_POS(ast, start, token_stream.cursor());
+        node = ast;
+        return true;
+      }
+
+    default:
+      break;
+    }
+
+  int token = token_stream.lookAhead();
+
+  if (token == Token_new
+      || (token == Token_scope && token_stream.lookAhead(1) == Token_new))
+    return parseNewExpression(node);
+
+  if (token == Token_delete
+      || (token == Token_scope && token_stream.lookAhead(1) == Token_delete))
+    return parseDeleteExpression(node);
+
+  return parsePostfixExpression(node);
+}
+
+bool Parser::parseNewExpression(ExpressionAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  NewExpressionAST *ast = CreateNode<NewExpressionAST>(_M_pool);
+
+  if (token_stream.lookAhead() == Token_scope
+      && token_stream.lookAhead(1) == Token_new)
+    {
+      ast->scope_token = token_stream.cursor();
+      token_stream.nextToken();
+    }
+
+  CHECK(Token_new);
+  ast->new_token = token_stream.cursor() - 1;
+
+  if (token_stream.lookAhead() == '(')
+    {
+      token_stream.nextToken();
+      parseCommaExpression(ast->expression);
+      CHECK(')');
+    }
+
+  if (token_stream.lookAhead() == '(')
+    {
+      token_stream.nextToken();
+      parseTypeId(ast->type_id);
+      CHECK(')');
+    }
+  else
+    {
+      parseNewTypeId(ast->new_type_id);
+    }
+
+  parseNewInitializer(ast->new_initializer);
+
+  UPDATE_POS(ast, start, token_stream.cursor());
+  node = ast;
+
+  return true;
+}
+
+bool Parser::parseNewTypeId(NewTypeIdAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  TypeSpecifierAST *typeSpec = 0;
+  if (!parseTypeSpecifier(typeSpec))
+    return false;
+
+  NewTypeIdAST *ast = CreateNode<NewTypeIdAST>(_M_pool);
+  ast->type_specifier = typeSpec;
+
+  parseNewDeclarator(ast->new_declarator);
+
+  UPDATE_POS(ast, start, token_stream.cursor());
+  node = ast;
+
+  return true;
+}
+
+bool Parser::parseNewDeclarator(NewDeclaratorAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  NewDeclaratorAST *ast = CreateNode<NewDeclaratorAST>(_M_pool);
+
+  PtrOperatorAST *ptrOp = 0;
+  if (parsePtrOperator(ptrOp))
+    {
+      ast->ptr_op = ptrOp;
+      parseNewDeclarator(ast->sub_declarator);
+    }
+
+  while (token_stream.lookAhead() == '[')
+    {
+      token_stream.nextToken();
+      ExpressionAST *expr = 0;
+      parseExpression(expr);
+      ast->expressions = snoc(ast->expressions, expr, _M_pool);
+      ADVANCE(']', "]");
+    }
+
+  UPDATE_POS(ast, start, token_stream.cursor());
+  node = ast;
+
+  return true;
+}
+
+bool Parser::parseNewInitializer(NewInitializerAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  CHECK('(');
+
+  NewInitializerAST *ast = CreateNode<NewInitializerAST>(_M_pool);
+
+  parseCommaExpression(ast->expression);
+
+  CHECK(')');
+
+  UPDATE_POS(ast, start, token_stream.cursor());
+  node = ast;
+
+  return true;
+}
+
+bool Parser::parseDeleteExpression(ExpressionAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  DeleteExpressionAST *ast = CreateNode<DeleteExpressionAST>(_M_pool);
+
+  if (token_stream.lookAhead() == Token_scope
+      && token_stream.lookAhead(1) == Token_delete)
+    {
+      ast->scope_token = token_stream.cursor();
+      token_stream.nextToken();
+    }
+
+  CHECK(Token_delete);
+  ast->delete_token = token_stream.cursor() - 1;
+
+  if (token_stream.lookAhead() == '[')
+    {
+      ast->lbracket_token = token_stream.cursor();
+      token_stream.nextToken();
+      CHECK(']');
+      ast->rbracket_token = token_stream.cursor() - 1;
+    }
+
+  if (!parseCastExpression(ast->expression))
+    return false;
+
+  UPDATE_POS(ast, start, token_stream.cursor());
+  node = ast;
+
+  return true;
+}
+
+bool Parser::parseCastExpression(ExpressionAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  if (token_stream.lookAhead() == '(')
+    {
+      token_stream.nextToken();
+
+      CastExpressionAST *ast = CreateNode<CastExpressionAST>(_M_pool);
+
+      if (parseTypeId(ast->type_id))
+        {
+          if (token_stream.lookAhead() == ')')
+            {
+              token_stream.nextToken();
+
+              if (parseCastExpression(ast->expression))
+                {
+                  UPDATE_POS(ast, start, token_stream.cursor());
+                  node = ast;
+
+                  return true;
+                }
+            }
+        }
+    }
+
+  token_stream.rewind((int) start);
+  return parseUnaryExpression(node);
+}
+
+bool Parser::parsePmExpression(ExpressionAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  if (!parseCastExpression(node) || !node) // ### fixme
+    return false;
+
+  while (token_stream.lookAhead() == Token_ptrmem)
+    {
+      std::size_t op = token_stream.cursor();
+      token_stream.nextToken();
+
+      ExpressionAST *rightExpr = 0;
+      if (!parseCastExpression(rightExpr))
+        return false;
+
+      BinaryExpressionAST *ast = CreateNode<BinaryExpressionAST>(_M_pool);
+      ast->op = op;
+      ast->left_expression = node;
+      ast->right_expression = rightExpr;
+
+      UPDATE_POS(ast, start, token_stream.cursor());
+      node = ast;
+    }
+
+  return true;
+}
+
+bool Parser::parseMultiplicativeExpression(ExpressionAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  if (!parsePmExpression(node))
+    return false;
+
+  while (token_stream.lookAhead() == '*'
+         || token_stream.lookAhead() == '/'
+         || token_stream.lookAhead() == '%')
+    {
+      std::size_t op = token_stream.cursor();
+      token_stream.nextToken();
+
+      ExpressionAST *rightExpr = 0;
+      if (!parsePmExpression(rightExpr))
+        return false;
+
+      BinaryExpressionAST *ast = CreateNode<BinaryExpressionAST>(_M_pool);
+      ast->op = op;
+      ast->left_expression = node;
+      ast->right_expression = rightExpr;
+
+      UPDATE_POS(ast, start, token_stream.cursor());
+      node = ast;
+    }
+
+  return true;
+}
+
+
+bool Parser::parseAdditiveExpression(ExpressionAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  if (!parseMultiplicativeExpression(node))
+    return false;
+
+  while (token_stream.lookAhead() == '+' || token_stream.lookAhead() == '-')
+    {
+      std::size_t op = token_stream.cursor();
+      token_stream.nextToken();
+
+      ExpressionAST *rightExpr = 0;
+      if (!parseMultiplicativeExpression(rightExpr))
+        return false;
+
+      BinaryExpressionAST *ast = CreateNode<BinaryExpressionAST>(_M_pool);
+      ast->op = op;
+      ast->left_expression = node;
+      ast->right_expression = rightExpr;
+
+      UPDATE_POS(ast, start, token_stream.cursor());
+      node = ast;
+    }
+
+  return true;
+}
+
+bool Parser::parseShiftExpression(ExpressionAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  if (!parseAdditiveExpression(node))
+    return false;
+
+  while (token_stream.lookAhead() == Token_shift)
+    {
+      std::size_t op = token_stream.cursor();
+      token_stream.nextToken();
+
+      ExpressionAST *rightExpr = 0;
+      if (!parseAdditiveExpression(rightExpr))
+        return false;
+
+      BinaryExpressionAST *ast = CreateNode<BinaryExpressionAST>(_M_pool);
+      ast->op = op;
+      ast->left_expression = node;
+      ast->right_expression = rightExpr;
+
+      UPDATE_POS(ast, start, token_stream.cursor());
+      node = ast;
+    }
+
+  return true;
+}
+
+bool Parser::parseRelationalExpression(ExpressionAST *&node, bool templArgs)
+{
+  std::size_t start = token_stream.cursor();
+
+  if (!parseShiftExpression(node))
+    return false;
+
+  while (token_stream.lookAhead() == '<'
+         || (token_stream.lookAhead() == '>' && !templArgs)
+         || token_stream.lookAhead() == Token_leq
+         || token_stream.lookAhead() == Token_geq)
+    {
+      std::size_t op = token_stream.cursor();
+      token_stream.nextToken();
+
+      ExpressionAST *rightExpr = 0;
+      if (!parseShiftExpression(rightExpr))
+        return false;
+
+      BinaryExpressionAST *ast = CreateNode<BinaryExpressionAST>(_M_pool);
+      ast->op = op;
+      ast->left_expression = node;
+      ast->right_expression = rightExpr;
+
+      UPDATE_POS(ast, start, token_stream.cursor());
+      node = ast;
+    }
+
+  return true;
+}
+
+bool Parser::parseEqualityExpression(ExpressionAST *&node, bool templArgs)
+{
+  std::size_t start = token_stream.cursor();
+
+  if (!parseRelationalExpression(node, templArgs))
+    return false;
+
+  while (token_stream.lookAhead() == Token_eq
+         || token_stream.lookAhead() == Token_not_eq)
+    {
+      std::size_t op = token_stream.cursor();
+      token_stream.nextToken();
+
+      ExpressionAST *rightExpr = 0;
+      if (!parseRelationalExpression(rightExpr, templArgs))
+        return false;
+
+      BinaryExpressionAST *ast = CreateNode<BinaryExpressionAST>(_M_pool);
+      ast->op = op;
+      ast->left_expression = node;
+      ast->right_expression = rightExpr;
+
+      UPDATE_POS(ast, start, token_stream.cursor());
+      node = ast;
+    }
+
+  return true;
+}
+
+bool Parser::parseAndExpression(ExpressionAST *&node, bool templArgs)
+{
+  std::size_t start = token_stream.cursor();
+
+  if (!parseEqualityExpression(node, templArgs))
+    return false;
+
+  while (token_stream.lookAhead() == '&')
+    {
+      std::size_t op = token_stream.cursor();
+      token_stream.nextToken();
+
+      ExpressionAST *rightExpr = 0;
+      if (!parseEqualityExpression(rightExpr, templArgs))
+        return false;
+
+      BinaryExpressionAST *ast = CreateNode<BinaryExpressionAST>(_M_pool);
+      ast->op = op;
+      ast->left_expression = node;
+      ast->right_expression = rightExpr;
+
+      UPDATE_POS(ast, start, token_stream.cursor());
+      node = ast;
+    }
+
+  return true;
+}
+
+bool Parser::parseExclusiveOrExpression(ExpressionAST *&node, bool templArgs)
+{
+  std::size_t start = token_stream.cursor();
+
+  if (!parseAndExpression(node, templArgs))
+    return false;
+
+  while (token_stream.lookAhead() == '^')
+    {
+      std::size_t op = token_stream.cursor();
+      token_stream.nextToken();
+
+      ExpressionAST *rightExpr = 0;
+      if (!parseAndExpression(rightExpr, templArgs))
+        return false;
+
+      BinaryExpressionAST *ast = CreateNode<BinaryExpressionAST>(_M_pool);
+      ast->op = op;
+      ast->left_expression = node;
+      ast->right_expression = rightExpr;
+
+      UPDATE_POS(ast, start, token_stream.cursor());
+      node = ast;
+    }
+
+  return true;
+}
+
+bool Parser::parseInclusiveOrExpression(ExpressionAST *&node, bool templArgs)
+{
+  std::size_t start = token_stream.cursor();
+
+  if (!parseExclusiveOrExpression(node, templArgs))
+    return false;
+
+  while (token_stream.lookAhead() == '|')
+    {
+      std::size_t op = token_stream.cursor();
+      token_stream.nextToken();
+
+      ExpressionAST *rightExpr = 0;
+      if (!parseExclusiveOrExpression(rightExpr, templArgs))
+        return false;
+
+      BinaryExpressionAST *ast = CreateNode<BinaryExpressionAST>(_M_pool);
+      ast->op = op;
+      ast->left_expression = node;
+      ast->right_expression = rightExpr;
+
+      UPDATE_POS(ast, start, token_stream.cursor());
+      node = ast;
+    }
+
+  return true;
+}
+
+bool Parser::parseLogicalAndExpression(ExpressionAST *&node, bool templArgs)
+{
+  std::size_t start = token_stream.cursor();
+
+  if (!parseInclusiveOrExpression(node, templArgs))
+    return false;
+
+  while (token_stream.lookAhead() == Token_and)
+    {
+      std::size_t op = token_stream.cursor();
+      token_stream.nextToken();
+
+      ExpressionAST *rightExpr = 0;
+      if (!parseInclusiveOrExpression(rightExpr, templArgs))
+        return false;
+
+      BinaryExpressionAST *ast = CreateNode<BinaryExpressionAST>(_M_pool);
+      ast->op = op;
+      ast->left_expression = node;
+      ast->right_expression = rightExpr;
+
+      UPDATE_POS(ast, start, token_stream.cursor());
+      node = ast;
+    }
+
+  return true;
+}
+
+bool Parser::parseLogicalOrExpression(ExpressionAST *&node, bool templArgs)
+{
+  std::size_t start = token_stream.cursor();
+
+  if (!parseLogicalAndExpression(node, templArgs))
+    return false;
+
+  while (token_stream.lookAhead() == Token_or)
+    {
+      std::size_t op = token_stream.cursor();
+      token_stream.nextToken();
+
+      ExpressionAST *rightExpr = 0;
+      if (!parseLogicalAndExpression(rightExpr, templArgs))
+        return false;
+
+      BinaryExpressionAST *ast = CreateNode<BinaryExpressionAST>(_M_pool);
+      ast->op = op;
+      ast->left_expression = node;
+      ast->right_expression = rightExpr;
+
+      UPDATE_POS(ast, start, token_stream.cursor());
+      node = ast;
+    }
+
+  return true;
+}
+
+bool Parser::parseConditionalExpression(ExpressionAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  if (!parseLogicalOrExpression(node))
+    return false;
+
+  if (token_stream.lookAhead() == '?')
+    {
+      token_stream.nextToken();
+
+      ExpressionAST *leftExpr = 0;
+      if (!parseExpression(leftExpr))
+        return false;
+
+      CHECK(':');
+
+      ExpressionAST *rightExpr = 0;
+      if (!parseAssignmentExpression(rightExpr))
+        return false;
+
+      ConditionalExpressionAST *ast
+        = CreateNode<ConditionalExpressionAST>(_M_pool);
+
+      ast->condition = node;
+      ast->left_expression = leftExpr;
+      ast->right_expression = rightExpr;
+
+      UPDATE_POS(ast, start, token_stream.cursor());
+      node = ast;
+    }
+
+  return true;
+}
+
+bool Parser::parseAssignmentExpression(ExpressionAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  if (token_stream.lookAhead() == Token_throw && !parseThrowExpression(node))
+    return false;
+  else if (!parseConditionalExpression(node))
+    return false;
+
+  while (token_stream.lookAhead() == Token_assign
+         || token_stream.lookAhead() == '=')
+    {
+      std::size_t op = token_stream.cursor();
+      token_stream.nextToken();
+
+      ExpressionAST *rightExpr = 0;
+      if (!parseConditionalExpression(rightExpr))
+        return false;
+
+      BinaryExpressionAST *ast = CreateNode<BinaryExpressionAST>(_M_pool);
+      ast->op = op;
+      ast->left_expression = node;
+      ast->right_expression = rightExpr;
+
+      UPDATE_POS(ast, start, token_stream.cursor());
+      node = ast;
+    }
+
+  return true;
+}
+
+bool Parser::parseConstantExpression(ExpressionAST *&node)
+{
+  return parseConditionalExpression(node);
+}
+
+bool Parser::parseExpression(ExpressionAST *&node)
+{
+  return parseCommaExpression(node);
+}
+
+bool Parser::parseCommaExpression(ExpressionAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  if (!parseAssignmentExpression(node))
+    return false;
+
+  while (token_stream.lookAhead() == ',')
+    {
+      std::size_t op = token_stream.cursor();
+      token_stream.nextToken();
+
+      ExpressionAST *rightExpr = 0;
+      if (!parseAssignmentExpression(rightExpr))
+        return false;
+
+      BinaryExpressionAST *ast = CreateNode<BinaryExpressionAST>(_M_pool);
+      ast->op = op;
+      ast->left_expression = node;
+      ast->right_expression = rightExpr;
+
+      UPDATE_POS(ast, start, token_stream.cursor());
+      node = ast;
+    }
+
+  return true;
+}
+
+bool Parser::parseThrowExpression(ExpressionAST *&node)
+{
+  std::size_t start = token_stream.cursor();
+
+  CHECK(Token_throw);
+
+  ThrowExpressionAST *ast = CreateNode<ThrowExpressionAST>(_M_pool);
+  ast->throw_token = token_stream.cursor() - 1;
+
+  parseAssignmentExpression(ast->expression);
+
+  UPDATE_POS(ast, start, token_stream.cursor());
+  node = ast;
+
+  return true;
+}
+
+bool Parser::parseQ_ENUMS(DeclarationAST *&node)
+{
+  if (token_stream.lookAhead() != Token_Q_ENUMS)
+    return false;
+
+  if (token_stream.lookAhead(1) != '(')
+    return false;
+
+  token_stream.nextToken();
+  token_stream.nextToken();
+
+  int firstToken = token_stream.cursor();
+  while (token_stream.lookAhead() != ')') {
+    token_stream.nextToken();
+  }
+  QEnumsAST *ast = CreateNode<QEnumsAST>(_M_pool);
+  UPDATE_POS(ast, firstToken, token_stream.cursor());
+  node = ast;
+
+  token_stream.nextToken();
+
+  return true;
+}
+
+bool Parser::parseQ_PROPERTY(DeclarationAST *&node)
+{
+  if (token_stream.lookAhead() != Token_Q_PROPERTY)
+    return false;
+
+  if (token_stream.lookAhead(1) != '(')
+    return false;
+
+  token_stream.nextToken();
+  token_stream.nextToken();
+
+  int firstToken = token_stream.cursor();
+  while (token_stream.lookAhead() != ')') {
+    token_stream.nextToken();
+  }
+  QPropertyAST *ast = CreateNode<QPropertyAST>(_M_pool);
+  UPDATE_POS(ast, firstToken, token_stream.cursor());
+  node = ast;
+
+//   const Token &t1 = token_stream[firstToken];
+//   const Token &t2 = token_stream[token_stream.cursor()];
+//   printf("property: %s\n",
+//          qPrintable(QString::fromLatin1(t1.text + t1.position, t2.position - t1.position)));
+
+  token_stream.nextToken();
+
+  return true;
+}
+
+bool Parser::block_errors(bool block)
+{
+  bool current = _M_block_errors;
+  _M_block_errors = block;
+  return current;
+}
+
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/parser.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,216 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+** Copyright (C) 2002-2005 Roberto Raggi <roberto@kdevelop.org>
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+
+#ifndef PARSER_H
+#define PARSER_H
+
+#include "ast.h"
+#include "lexer.h"
+
+#include <QtCore/QString>
+
+class FileSymbol;
+class Control;
+
+class Parser
+{
+public:
+  Parser(Control *control);
+  ~Parser();
+
+  LocationManager &location() { return _M_location; }
+
+  TranslationUnitAST *parse(const char *contents, std::size_t size, pool *p);
+
+private:
+  void reportError(const QString& msg);
+  void syntaxError();
+  void tokenRequiredError(int expected);
+
+public:
+  bool skipFunctionBody(StatementAST *&node);
+
+public:
+  bool parse_Attribute__();
+  bool parseAbstractDeclarator(DeclaratorAST *&node);
+  bool parseAccessSpecifier(DeclarationAST *&node);
+  bool parseAdditiveExpression(ExpressionAST *&node);
+  bool parseAndExpression(ExpressionAST *&node, bool templArgs = false);
+  bool parseAsmDefinition(DeclarationAST *&node);
+  bool parseAssignmentExpression(ExpressionAST *&node);
+  bool parseBaseClause(BaseClauseAST *&node);
+  bool parseBaseSpecifier(BaseSpecifierAST *&node);
+  bool parseBlockDeclaration(DeclarationAST *&node);
+  bool parseCastExpression(ExpressionAST *&node);
+  bool parseClassSpecifier(TypeSpecifierAST *&node);
+  bool parseForwardDeclarationSpecifier(TypeSpecifierAST *&node);
+  bool parseCommaExpression(ExpressionAST *&node);
+  bool parseCompoundStatement(StatementAST *&node);
+  bool parseCondition(ConditionAST *&node, bool initRequired = true);
+  bool parseConditionalExpression(ExpressionAST *&node);
+  bool parseConstantExpression(ExpressionAST *&node);
+  bool parseCtorInitializer(CtorInitializerAST *&node);
+  bool parseCvQualify(const ListNode<std::size_t> *&node);
+  bool parseDeclaration(DeclarationAST *&node);
+  bool parseDeclarationInternal(DeclarationAST *&node);
+  bool parseDeclarationStatement(StatementAST *&node);
+  bool parseDeclarator(DeclaratorAST *&node);
+  bool parseDeleteExpression(ExpressionAST *&node);
+  bool parseDoStatement(StatementAST *&node);
+  bool parseElaboratedTypeSpecifier(TypeSpecifierAST *&node);
+  bool parseEnumSpecifier(TypeSpecifierAST *&node);
+  bool parseEnumerator(EnumeratorAST *&node);
+  bool parseEqualityExpression(ExpressionAST *&node,
+                   bool templArgs = false);
+  bool parseExceptionSpecification(ExceptionSpecificationAST *&node);
+  bool parseExclusiveOrExpression(ExpressionAST *&node,
+                  bool templArgs = false);
+  bool parseExpression(ExpressionAST *&node);
+  bool parseExpressionOrDeclarationStatement(StatementAST *&node);
+  bool parseExpressionStatement(StatementAST *&node);
+  bool parseForInitStatement(StatementAST *&node);
+  bool parseForStatement(StatementAST *&node);
+  bool parseFunctionBody(StatementAST *&node);
+  bool parseFunctionSpecifier(const ListNode<std::size_t> *&node);
+  bool parseIfStatement(StatementAST *&node);
+  bool parseInclusiveOrExpression(ExpressionAST *&node,
+                  bool templArgs = false);
+  bool parseInitDeclarator(InitDeclaratorAST *&node);
+  bool parseInitDeclaratorList(const ListNode<InitDeclaratorAST*> *&node);
+  bool parseInitializer(InitializerAST *&node);
+  bool parseInitializerClause(InitializerClauseAST *&node);
+  bool parseLabeledStatement(StatementAST *&node);
+  bool parseLinkageBody(LinkageBodyAST *&node);
+  bool parseLinkageSpecification(DeclarationAST *&node);
+  bool parseLogicalAndExpression(ExpressionAST *&node,
+                 bool templArgs = false);
+  bool parseLogicalOrExpression(ExpressionAST *&node,
+                bool templArgs = false);
+  bool parseMemInitializer(MemInitializerAST *&node);
+  bool parseMemInitializerList(const ListNode<MemInitializerAST*> *&node);
+  bool parseMemberSpecification(DeclarationAST *&node);
+  bool parseMultiplicativeExpression(ExpressionAST *&node);
+  bool parseName(NameAST *&node, bool acceptTemplateId = false);
+  bool parseNamespace(DeclarationAST *&node);
+  bool parseNamespaceAliasDefinition(DeclarationAST *&node);
+  bool parseNewDeclarator(NewDeclaratorAST *&node);
+  bool parseNewExpression(ExpressionAST *&node);
+  bool parseNewInitializer(NewInitializerAST *&node);
+  bool parseNewTypeId(NewTypeIdAST *&node);
+  bool parseOperator(OperatorAST *&node);
+  bool parseOperatorFunctionId(OperatorFunctionIdAST *&node);
+  bool parseParameterDeclaration(ParameterDeclarationAST *&node);
+  bool parseParameterDeclarationClause(ParameterDeclarationClauseAST *&node);
+  bool parseParameterDeclarationList(const ListNode<ParameterDeclarationAST*> *&node);
+  bool parsePmExpression(ExpressionAST *&node);
+  bool parsePostfixExpression(ExpressionAST *&node);
+  bool parsePostfixExpressionInternal(ExpressionAST *&node);
+  bool parsePrimaryExpression(ExpressionAST *&node);
+  bool parsePtrOperator(PtrOperatorAST *&node);
+  bool parsePtrToMember(PtrToMemberAST *&node);
+  bool parseRelationalExpression(ExpressionAST *&node,
+                 bool templArgs = false);
+  bool parseShiftExpression(ExpressionAST *&node);
+  bool parseSimpleTypeSpecifier(TypeSpecifierAST *&node,
+                bool onlyIntegral = false);
+  bool parseStatement(StatementAST *&node);
+  bool parseStorageClassSpecifier(const ListNode<std::size_t> *&node);
+  bool parseStringLiteral(StringLiteralAST *&node);
+  bool parseSwitchStatement(StatementAST *&node);
+  bool parseTemplateArgument(TemplateArgumentAST *&node);
+  bool parseTemplateArgumentList(const ListNode<TemplateArgumentAST*> *&node,
+                 bool reportError = true);
+  bool parseTemplateDeclaration(DeclarationAST *&node);
+  bool parseTemplateParameter(TemplateParameterAST *&node);
+  bool parseTemplateParameterList(const ListNode<TemplateParameterAST*> *&node);
+  bool parseThrowExpression(ExpressionAST *&node);
+  bool parseTranslationUnit(TranslationUnitAST *&node);
+  bool parseTryBlockStatement(StatementAST *&node);
+  bool parseTypeId(TypeIdAST *&node);
+  bool parseTypeIdList(const ListNode<TypeIdAST*> *&node);
+  bool parseTypeParameter(TypeParameterAST *&node);
+  bool parseTypeSpecifier(TypeSpecifierAST *&node);
+  bool parseTypeSpecifierOrClassSpec(TypeSpecifierAST *&node);
+  bool parseTypedef(DeclarationAST *&node);
+  bool parseUnaryExpression(ExpressionAST *&node);
+  bool parseUnqualifiedName(UnqualifiedNameAST *&node,
+                bool parseTemplateId = true);
+  bool parseUsing(DeclarationAST *&node);
+  bool parseUsingDirective(DeclarationAST *&node);
+  bool parseWhileStatement(StatementAST *&node);
+  bool parseWinDeclSpec(WinDeclSpecAST *&node);
+
+  bool parseQ_PROPERTY(DeclarationAST *&node);
+  bool parseQ_ENUMS(DeclarationAST *&node);
+
+  bool skipUntil(int token);
+  bool skipUntilDeclaration();
+  bool skipUntilStatement();
+  bool skip(int l, int r);
+
+  void advance();
+
+  // private:
+  TokenStream token_stream;
+  LocationTable location_table;
+  LocationTable line_table;
+
+  bool block_errors(bool block);
+
+private:
+  QString tokenText(AST *) const;
+
+  LocationManager _M_location;
+  Control *control;
+  Lexer lexer;
+  pool *_M_pool;
+  bool _M_block_errors;
+
+private:
+  Parser(const Parser& source);
+  void operator = (const Parser& source);
+};
+
+#endif
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/r++.macros	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,28 @@
+
+#define __attribute__(a...)
+#define __typeof__         __typeof
+
+#define __extension
+#define __extension__
+
+#define __restrict
+#define __restrict__
+
+#define __volatile         volatile
+#define __volatile__       volatile
+
+#define __inline             inline
+#define __inline__           inline
+
+#define __const               const
+#define __const__             const
+
+#define __asm               asm
+#define __asm__             asm
+
+#define __GNUC__                 3
+//#define __GNUC_MINOR__           4
+
+#define __ROBC__                 0
+#define __ROBC_MINOR__           1
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/rpp-allocator.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,42 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#include "rxx_allocator.h"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/rpp/builtin-macros.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,41 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/rpp/pp-cctype.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+** Copyright 2005 Roberto Raggi <roberto@kdevelop.org>
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#ifndef PP_CCTYPE_H
+#define PP_CCTYPE_H
+
+#include <cctype>
+
+namespace rpp {
+
+inline bool pp_isalpha (int __ch)
+{ return std::isalpha ((unsigned char) __ch) != 0; }
+
+inline bool pp_isalnum (int __ch)
+{ return std::isalnum ((unsigned char) __ch) != 0; }
+
+inline bool pp_isdigit (int __ch)
+{ return std::isdigit ((unsigned char) __ch) != 0; }
+
+inline bool pp_isspace (int __ch)
+{ return std::isspace ((unsigned char) __ch) != 0; }
+
+} // namespace rpp
+
+#endif // PP_CCTYPE_H
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/rpp/pp-configuration	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,86 @@
+#define __DBL_MIN_EXP__ (-1021)
+#define __FLT_MIN__ 1.17549435e-38F
+#define __CHAR_BIT__ 8
+#define __WCHAR_MAX__ 2147483647
+#define __DBL_DENORM_MIN__ 4.9406564584124654e-324
+#define __FLT_EVAL_METHOD__ 2
+#define __DBL_MIN_10_EXP__ (-307)
+#define __FINITE_MATH_ONLY__ 0
+#define __GNUC_PATCHLEVEL__ 2
+#define __SHRT_MAX__ 32767
+#define __LDBL_MAX__ 1.18973149535723176502e+4932L
+#define __UINTMAX_TYPE__ long long unsigned int
+#define __linux 1
+#define __unix 1
+#define __LDBL_MAX_EXP__ 16384
+#define __linux__ 1
+#define __SCHAR_MAX__ 127
+#define __USER_LABEL_PREFIX__
+#define __STDC_HOSTED__ 1
+#define __LDBL_HAS_INFINITY__ 1
+#define __DBL_DIG__ 15
+#define __FLT_EPSILON__ 1.19209290e-7F
+#define __GXX_WEAK__ 1
+#define __LDBL_MIN__ 3.36210314311209350626e-4932L
+#define __unix__ 1
+#define __DECIMAL_DIG__ 21
+#define __gnu_linux__ 1
+#define __LDBL_HAS_QUIET_NAN__ 1
+#define __GNUC__ 4
+#define __DBL_MAX__ 1.7976931348623157e+308
+#define __DBL_HAS_INFINITY__ 1
+#define __cplusplus 1
+#define __DEPRECATED 1
+#define __DBL_MAX_EXP__ 1024
+#define __GNUG__ 4
+#define __LONG_LONG_MAX__ 9223372036854775807LL
+#define __GXX_ABI_VERSION 1002
+#define __FLT_MIN_EXP__ (-125)
+#define __DBL_MIN__ 2.2250738585072014e-308
+#define __FLT_MIN_10_EXP__ (-37)
+#define __DBL_HAS_QUIET_NAN__ 1
+#define __REGISTER_PREFIX__
+#define __NO_INLINE__ 1
+#define __i386 1
+#define __FLT_MANT_DIG__ 24
+#define __VERSION__ "4.0.2 20050808 (prerelease) (Ubuntu 4.0.1-4ubuntu9)"
+#define i386 1
+#define __i486__ 1
+#define unix 1
+#define __i386__ 1
+#define __SIZE_TYPE__ unsigned int
+#define __ELF__ 1
+#define __FLT_RADIX__ 2
+#define __LDBL_EPSILON__ 1.08420217248550443401e-19L
+#define __FLT_HAS_QUIET_NAN__ 1
+#define __FLT_MAX_10_EXP__ 38
+#define __LONG_MAX__ 2147483647L
+#define __FLT_HAS_INFINITY__ 1
+#define linux 1
+#define __EXCEPTIONS 1
+#define __LDBL_MANT_DIG__ 64
+#define __WCHAR_TYPE__ int
+#define __FLT_DIG__ 6
+#define __INT_MAX__ 2147483647
+#define __i486 1
+#define __FLT_MAX_EXP__ 128
+#define __DBL_MANT_DIG__ 53
+#define __WINT_TYPE__ unsigned int
+#define __LDBL_MIN_EXP__ (-16381)
+#define __LDBL_MAX_10_EXP__ 4932
+#define __DBL_EPSILON__ 2.2204460492503131e-16
+#define __tune_i486__ 1
+#define __INTMAX_MAX__ 9223372036854775807LL
+#define __FLT_DENORM_MIN__ 1.40129846e-45F
+#define __FLT_MAX__ 3.40282347e+38F
+#define __INTMAX_TYPE__ long long int
+#define __GNUC_MINOR__ 0
+#define __DBL_MAX_10_EXP__ 308
+#define __LDBL_DENORM_MIN__ 3.64519953188247460253e-4951L
+#define __PTRDIFF_TYPE__ int
+#define __LDBL_MIN_10_EXP__ (-4931)
+#define __LDBL_DIG__ 18
+#define _GNU_SOURCE 1
+
+
+#define __STDC__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/rpp/pp-engine-bits.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,1348 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+** Copyright 2005 Roberto Raggi <roberto@kdevelop.org>
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#ifndef PP_ENGINE_BITS_H
+#define PP_ENGINE_BITS_H
+
+namespace rpp {
+
+inline std::string pp::fix_file_path(std::string const &filename) const
+{
+#if defined (PP_OS_WIN)
+    std::string s = filename;
+    for (std::string::iterator it = s.begin(); it != s.end(); ++it)
+      {
+        if (*it == '/')
+            *it = '\\';
+      }
+    return s;
+#else
+    return filename;
+#endif
+}
+
+inline bool pp::is_absolute(std::string const &filename) const
+{
+#if defined(PP_OS_WIN)
+  return filename.length() >= 3
+      && filename.at(1) == ':'
+      && (filename.at(2) == '\\' || filename.at(2) == '/');
+#else
+  return filename.length() >= 1
+          && filename.at(0) == '/';
+#endif
+}
+
+template <typename _OutputIterator>
+void pp::file (std::string const &filename, _OutputIterator __result)
+{
+  FILE *fp = fopen (filename.c_str(), "rb");
+  if (fp != 0)
+    {
+      std::string was = env.current_file;
+      env.current_file = filename;
+      file (fp, __result);
+      env.current_file = was;
+    }
+  //else
+    //std::cerr << "** WARNING file ``" << filename << " not found!" << std::endl;
+}
+
+template <typename _OutputIterator>
+void pp::file (FILE *fp, _OutputIterator __result)
+{
+   assert (fp != 0);
+
+#if defined (HAVE_MMAP)
+  struct stat st;
+  fstat(FILENO (fp), &st);
+  std::size_t size = st.st_size;
+  char *buffer = 0;
+  buffer = (char *) ::mmap(0, size, PROT_READ, MAP_SHARED, FILENO (fp), 0);
+  fclose (fp);
+  if (!buffer || buffer == (char*) -1)
+    return;
+  this->operator () (buffer, buffer + size, __result);
+  ::munmap(buffer, size);
+#else
+  std::string buffer;
+  while (!feof(fp)) {
+      char tmp[1024];
+      int read = (int) fread (tmp, sizeof(char), 1023, fp);
+      tmp[read] = '\0';
+      buffer += tmp;
+  }
+  fclose (fp);
+  this->operator () (buffer.c_str(), buffer.c_str() + buffer.size(), __result);
+#endif
+}
+
+template <typename _InputIterator>
+bool pp::find_header_protection (_InputIterator __first, _InputIterator __last, std::string *__prot)
+{
+  int was = env.current_line;
+
+  while (__first != __last)
+    {
+      if (pp_isspace (*__first))
+        {
+          if (*__first == '\n')
+            ++env.current_line;
+
+          ++__first;
+        }
+      else if (_PP_internal::comment_p (__first, __last))
+        {
+          __first = skip_comment_or_divop (__first, __last);
+          env.current_line += skip_comment_or_divop.lines;
+        }
+      else if (*__first == '#')
+        {
+          __first = skip_blanks (++__first, __last);
+          env.current_line += skip_blanks.lines;
+
+          if (__first != __last && *__first == 'i')
+            {
+              _InputIterator __begin = __first;
+              __first = skip_identifier (__begin, __last);
+              env.current_line += skip_identifier.lines;
+
+              std::string __directive (__begin, __first);
+
+              if (__directive == "ifndef")
+                {
+                  __first = skip_blanks (__first, __last);
+                  env.current_line += skip_blanks.lines;
+
+                  __begin = __first;
+                  __first = skip_identifier (__first, __last);
+                  env.current_line += skip_identifier.lines;
+
+                  if (__begin != __first && __first != __last)
+                    {
+                      __prot->assign (__begin, __first);
+                      return true;
+                    }
+                }
+            }
+          break;
+        }
+      else
+        break;
+    }
+
+ env.current_line = was;
+ return false;
+}
+
+inline pp::PP_DIRECTIVE_TYPE pp::find_directive (char const *__directive, std::size_t __size) const
+{
+  switch (__size)
+    {
+      case 2:
+        if (__directive[0] == 'i'
+            && __directive[1] == 'f')
+          return PP_IF;
+        break;
+
+      case 4:
+        if (__directive[0] == 'e' && !strcmp (__directive, "elif"))
+          return PP_ELIF;
+        else if (__directive[0] == 'e' && !strcmp (__directive, "else"))
+          return PP_ELSE;
+        break;
+
+      case 5:
+        if (__directive[0] == 'i' && !strcmp (__directive, "ifdef"))
+          return PP_IFDEF;
+        else if (__directive[0] == 'u' && !strcmp (__directive, "undef"))
+          return PP_UNDEF;
+        else if (__directive[0] == 'e') {
+          if (!strcmp (__directive, "endif"))
+            return PP_ENDIF;
+          else if (!strcmp (__directive, "error"))
+            return PP_ERROR;
+        }
+        break;
+
+      case 6:
+        if (__directive[0] == 'i' && !strcmp (__directive, "ifndef"))
+          return PP_IFNDEF;
+        else if (__directive[0] == 'd' && !strcmp (__directive, "define"))
+          return PP_DEFINE;
+        else if (__directive[0] == 'p' && !strcmp (__directive, "pragma"))
+          return PP_PRAGMA;
+        break;
+
+      case 7:
+        if (__directive[0] == 'i' && !strcmp (__directive, "include"))
+            return PP_INCLUDE;
+        break;
+
+      case 12:
+        if (__directive[0] == 'i' && !strcmp (__directive, "include_next"))
+          return PP_INCLUDE_NEXT;
+        break;
+
+      default:
+        break;
+    }
+  std::cerr << "** WARNING unknown directive '#" << __directive << "' at " << env.current_file << ":" << env.current_line << std::endl;
+  return PP_UNKNOWN_DIRECTIVE;
+}
+
+inline bool pp::file_isdir (std::string const &__filename) const
+{
+    struct stat __st;
+#if defined(PP_OS_WIN)
+    if (stat(__filename.c_str (), &__st) == 0)
+        return (__st.st_mode & _S_IFDIR) == _S_IFDIR;
+    else
+        return false;
+#else
+    if (lstat (__filename.c_str (), &__st) == 0)
+        return (__st.st_mode & S_IFDIR) == S_IFDIR;
+    else
+        return false;
+#endif
+}
+
+inline bool pp::file_exists (std::string const &__filename) const
+{
+  struct stat __st;
+#if defined(PP_OS_WIN)
+  return stat(__filename.c_str (), &__st) == 0;
+#else
+  return lstat (__filename.c_str (), &__st) == 0;
+#endif
+}
+
+inline FILE *pp::find_include_file(std::string const &__input_filename, std::string *__filepath,
+      INCLUDE_POLICY __include_policy, bool __skip_current_path) const
+{
+  assert (__filepath != 0);
+  assert (! __input_filename.empty());
+
+  __filepath->assign (__input_filename);
+
+  if (is_absolute (*__filepath))
+    return fopen (__filepath->c_str(), "r");
+
+  if (! env.current_file.empty ())
+    _PP_internal::extract_file_path (env.current_file, __filepath);
+
+  if (__include_policy == INCLUDE_LOCAL && ! __skip_current_path)
+    {
+      std::string __tmp (*__filepath);
+      __tmp += __input_filename;
+
+      if (file_exists (__tmp) && !file_isdir(__tmp))
+        {
+          __filepath->append (__input_filename);
+          return fopen (__filepath->c_str (), "r");
+        }
+    }
+
+  std::vector<std::string>::const_iterator it = include_paths.begin ();
+
+  if (__skip_current_path)
+    {
+      it = std::find (include_paths.begin (), include_paths.end (), *__filepath);
+
+      if (it != include_paths.end ())
+        ++it;
+
+      else
+        it = include_paths.begin ();
+    }
+
+  for (; it != include_paths.end (); ++it)
+    {
+      if (__skip_current_path && it == include_paths.begin())
+        continue;
+
+      __filepath->assign (*it);
+      __filepath->append (__input_filename);
+
+      if (file_exists (*__filepath) && !file_isdir(*__filepath))
+        return fopen (__filepath->c_str(), "r");
+    }
+
+  return 0;
+}
+
+template <typename _InputIterator, typename _OutputIterator>
+_InputIterator pp::handle_directive(char const *__directive, std::size_t __size,
+        _InputIterator __first, _InputIterator __last, _OutputIterator __result)
+{
+  __first = skip_blanks (__first, __last);
+
+  PP_DIRECTIVE_TYPE d = find_directive (__directive, __size);
+  switch (d)
+    {
+      case PP_DEFINE:
+        if (! skipping ())
+          return handle_define (__first, __last);
+        break;
+
+      case PP_INCLUDE:
+      case PP_INCLUDE_NEXT:
+        if (! skipping ())
+          return handle_include (d == PP_INCLUDE_NEXT, __first, __last, __result);
+        break;
+
+      case PP_UNDEF:
+        if (! skipping ())
+          return handle_undef(__first, __last);
+        break;
+
+      case PP_ELIF:
+        return handle_elif (__first, __last);
+
+      case PP_ELSE:
+        return handle_else (__first, __last);
+
+      case PP_ENDIF:
+        return handle_endif (__first, __last);
+
+      case PP_IF:
+        return handle_if (__first, __last);
+
+      case PP_IFDEF:
+        return handle_ifdef (false, __first, __last);
+
+      case PP_IFNDEF:
+        return handle_ifdef (true, __first, __last);
+
+      default:
+        break;
+    }
+
+  return __first;
+}
+
+template <typename _InputIterator, typename _OutputIterator>
+_InputIterator pp::handle_include (bool __skip_current_path, _InputIterator __first, _InputIterator __last,
+      _OutputIterator __result)
+{
+  if (pp_isalpha (*__first) || *__first == '_')
+    {
+      pp_macro_expander expand_include (env);
+      std::string name;
+      name.reserve (255);
+      expand_include (__first, __last, std::back_inserter (name));
+      std::string::iterator it = skip_blanks (name.begin (), name.end ());
+      assert (it != name.end () && (*it == '<' || *it == '"'));
+      handle_include (__skip_current_path, it, name.end (), __result);
+      return __first;
+    }
+
+  assert (*__first == '<' || *__first == '"');
+  int quote = (*__first == '"') ? '"' : '>';
+  ++__first;
+
+  _InputIterator end_name = __first;
+  for (; end_name != __last; ++end_name)
+    {
+      assert (*end_name != '\n');
+
+      if (*end_name == quote)
+        break;
+    }
+
+  std::string filename (__first, end_name);
+
+#ifdef PP_OS_WIN
+  std::replace(filename.begin(), filename.end(), '/', '\\');
+#endif
+
+  std::string filepath;
+  FILE *fp = find_include_file (filename, &filepath, quote == '>' ? INCLUDE_GLOBAL : INCLUDE_LOCAL, __skip_current_path);
+
+#if defined (PP_HOOK_ON_FILE_INCLUDED)
+      PP_HOOK_ON_FILE_INCLUDED (env.current_file, fp ? filepath : filename, fp);
+#endif
+
+  if (fp != 0)
+    {
+      std::string old_file = env.current_file;
+      env.current_file = filepath;
+      int __saved_lines = env.current_line;
+
+      env.current_line = 1;
+      //output_line (env.current_file, 1, __result);
+
+      file (fp, __result);
+
+      // restore the file name and the line position
+      env.current_file = old_file;
+      env.current_line = __saved_lines;
+
+      // sync the buffer
+      _PP_internal::output_line (env.current_file, env.current_line, __result);
+    }
+#ifndef RPP_JAMBI
+//   else
+//     std::cerr << "*** WARNING " << filename << ": No such file or directory" << std::endl;
+#endif
+
+  return __first;
+}
+
+template <typename _InputIterator, typename _OutputIterator>
+void pp::operator () (_InputIterator __first, _InputIterator __last, _OutputIterator __result)
+{
+#ifndef PP_NO_SMART_HEADER_PROTECTION
+  std::string __prot;
+  __prot.reserve (255);
+  pp_fast_string __tmp (__prot.c_str (), __prot.size ());
+
+  if (find_header_protection (__first, __last, &__prot)
+      && env.resolve (&__tmp) != 0)
+    {
+      // std::cerr << "** DEBUG found header protection:" << __prot << std::endl;
+      return;
+    }
+#endif
+
+  env.current_line = 1;
+  char __buffer[512];
+
+  while (true)
+    {
+      __first = skip_blanks (__first, __last);
+      env.current_line += skip_blanks.lines;
+
+      if (__first == __last)
+        break;
+      else if (*__first == '#')
+        {
+          assert (*__first == '#');
+          __first = skip_blanks (++__first, __last);
+          env.current_line += skip_blanks.lines;
+
+          _InputIterator end_id = skip_identifier (__first, __last);
+          env.current_line += skip_identifier.lines;
+          std::size_t __size = end_id - __first;
+
+          assert (__size < 512);
+          char *__cp = __buffer;
+          std::copy (__first, end_id, __cp);
+          __cp[__size] = '\0';
+
+          end_id = skip_blanks (end_id, __last);
+          __first = skip (end_id, __last);
+
+          int was = env.current_line;
+          (void) handle_directive (__buffer, __size, end_id, __first, __result);
+
+          if (env.current_line != was)
+            {
+              env.current_line = was;
+              _PP_internal::output_line (env.current_file, env.current_line, __result);
+            }
+        }
+      else if (*__first == '\n')
+        {
+          // ### compress the line
+          *__result++ = *__first++;
+          ++env.current_line;
+        }
+      else if (skipping ())
+        __first = skip (__first, __last);
+      else
+        {
+          _PP_internal::output_line (env.current_file, env.current_line, __result);
+          __first = expand (__first, __last, __result);
+          env.current_line += expand.lines;
+
+          if (expand.generated_lines)
+            _PP_internal::output_line (env.current_file, env.current_line, __result);
+        }
+    }
+}
+
+inline pp::pp (pp_environment &__env):
+  env (__env), expand (env)
+{
+  iflevel = 0;
+  _M_skipping[iflevel] = 0;
+  _M_true_test[iflevel] = 0;
+}
+
+inline std::back_insert_iterator<std::vector<std::string> > pp::include_paths_inserter ()
+{ return std::back_inserter (include_paths); }
+
+inline std::vector<std::string>::iterator pp::include_paths_begin ()
+{ return include_paths.begin (); }
+
+inline std::vector<std::string>::iterator pp::include_paths_end ()
+{ return include_paths.end (); }
+
+inline std::vector<std::string>::const_iterator pp::include_paths_begin () const
+{ return include_paths.begin (); }
+
+inline std::vector<std::string>::const_iterator pp::include_paths_end () const
+{ return include_paths.end (); }
+
+inline void pp::push_include_path (std::string const &__path)
+{
+  if (__path.empty () || __path [__path.size () - 1] != PATH_SEPARATOR)
+    {
+      std::string __tmp (__path);
+      __tmp += PATH_SEPARATOR;
+      include_paths.push_back (__tmp);
+    }
+
+  else
+    include_paths.push_back (__path);
+}
+
+template <typename _InputIterator>
+_InputIterator pp::handle_define (_InputIterator __first, _InputIterator __last)
+{
+  pp_macro macro;
+#if defined (PP_WITH_MACRO_POSITION)
+  macro.file = pp_symbol::get (env.current_file);
+#endif
+  std::string definition;
+
+  __first = skip_blanks (__first, __last);
+  _InputIterator end_macro_name = skip_identifier (__first, __last);
+  pp_fast_string const *macro_name = pp_symbol::get (__first, end_macro_name);
+  __first = end_macro_name;
+
+  if (__first != __last && *__first == '(')
+    {
+      macro.function_like = true;
+      macro.formals.reserve (5);
+
+      __first = skip_blanks (++__first, __last); // skip '('
+      _InputIterator arg_end = skip_identifier (__first, __last);
+      if (__first != arg_end)
+        macro.formals.push_back (pp_symbol::get (__first, arg_end));
+
+      __first = skip_blanks (arg_end, __last);
+
+      if (*__first == '.')
+        {
+          macro.variadics = true;
+          while (*__first == '.')
+            ++__first;
+        }
+
+      while (__first != __last && *__first == ',')
+        {
+          __first = skip_blanks (++__first, __last);
+
+          arg_end = skip_identifier (__first, __last);
+          if (__first != arg_end)
+            macro.formals.push_back (pp_symbol::get (__first, arg_end));
+
+          __first = skip_blanks (arg_end, __last);
+
+          if (*__first == '.')
+            {
+              macro.variadics = true;
+              while (*__first == '.')
+                ++__first;
+            }
+        }
+
+      assert (*__first == ')');
+      ++__first;
+    }
+
+  __first = skip_blanks (__first, __last);
+
+  while (__first != __last && *__first != '\n')
+    {
+    if (*__first == '/') {
+        __first = skip_comment_or_divop(__first, __last);
+        env.current_line += skip_comment_or_divop.lines;
+    }
+
+      if (*__first == '\\')
+        {
+          _InputIterator __begin = __first;
+          __begin = skip_blanks (++__begin, __last);
+
+          if (__begin != __last && *__begin == '\n')
+            {
+              ++macro.lines;
+              __first = skip_blanks (++__begin, __last);
+              definition += ' ';
+              continue;
+            }
+        }
+
+      definition += *__first++;
+    }
+
+  macro.definition = pp_symbol::get (definition);
+  env.bind (macro_name, macro);
+
+  return __first;
+}
+
+template <typename _InputIterator>
+_InputIterator pp::skip (_InputIterator __first, _InputIterator __last)
+{
+  pp_skip_string_literal skip_string_literal;
+  pp_skip_char_literal skip_char_literal;
+
+  while (__first != __last && *__first != '\n')
+    {
+      if (*__first == '/')
+        {
+          __first = skip_comment_or_divop (__first, __last);
+          env.current_line += skip_comment_or_divop.lines;
+        }
+      else if (*__first == '"')
+        {
+          __first = skip_string_literal (__first, __last);
+          env.current_line += skip_string_literal.lines;
+        }
+      else if (*__first == '\'')
+        {
+          __first = skip_char_literal (__first, __last);
+          env.current_line += skip_char_literal.lines;
+        }
+      else if (*__first == '\\')
+        {
+          __first = skip_blanks (++__first, __last);
+          env.current_line += skip_blanks.lines;
+
+          if (__first != __last && *__first == '\n')
+            {
+              ++__first;
+              ++env.current_line;
+            }
+        }
+      else
+        ++__first;
+    }
+
+  return __first;
+}
+
+inline bool pp::test_if_level()
+{
+  bool result = !_M_skipping[iflevel++];
+  _M_skipping[iflevel] = _M_skipping[iflevel - 1];
+  _M_true_test[iflevel] = false;
+  return result;
+}
+
+inline int pp::skipping() const
+{ return _M_skipping[iflevel]; }
+
+template <typename _InputIterator>
+_InputIterator pp::eval_primary(_InputIterator __first, _InputIterator __last, Value *result)
+{
+  bool expect_paren = false;
+  int token;
+  __first = next_token (__first, __last, &token);
+
+  switch (token)
+    {
+    case TOKEN_NUMBER:
+      result->set_long (token_value);
+      break;
+
+    case TOKEN_UNUMBER:
+      result->set_ulong (token_uvalue);
+      break;
+
+    case TOKEN_DEFINED:
+      __first = next_token (__first, __last, &token);
+
+      if (token == '(')
+        {
+          expect_paren = true;
+          __first = next_token (__first, __last, &token);
+        }
+
+      if (token != TOKEN_IDENTIFIER)
+        {
+          std::cerr << "** WARNING expected ``identifier'' found:" << char(token) << std::endl;
+          result->set_long (0);
+          break;
+        }
+
+      result->set_long (env.resolve (token_text->c_str (), token_text->size ()) != 0);
+
+      next_token (__first, __last, &token); // skip '('
+
+      if (expect_paren)
+        {
+          _InputIterator next = next_token (__first, __last, &token);
+          if (token != ')')
+            std::cerr << "** WARNING expected ``)''" << std::endl;
+          else
+            __first = next;
+        }
+      break;
+
+    case TOKEN_IDENTIFIER:
+      result->set_long (0);
+      break;
+
+    case '-':
+      __first = eval_primary (__first, __last, result);
+      result->set_long (- result->l);
+      return __first;
+
+    case '+':
+      __first = eval_primary (__first, __last, result);
+      return __first;
+
+    case '!':
+      __first = eval_primary (__first, __last, result);
+      result->set_long (result->is_zero ());
+      return __first;
+
+    case '(':
+      __first = eval_constant_expression(__first, __last, result);
+      next_token (__first, __last, &token);
+
+      if (token != ')')
+        std::cerr << "** WARNING expected ``)'' = " << token << std::endl;
+      else
+        __first = next_token(__first, __last, &token);
+      break;
+
+    default:
+      result->set_long (0);
+    }
+
+  return __first;
+}
+
+template <typename _InputIterator>
+_InputIterator pp::eval_multiplicative(_InputIterator __first, _InputIterator __last, Value *result)
+{
+  __first = eval_primary(__first, __last, result);
+
+  int token;
+  _InputIterator next = next_token (__first, __last, &token);
+
+  while (token == '*' || token == '/' || token == '%')
+    {
+      Value value;
+      __first = eval_primary(next, __last, &value);
+
+      if (token == '*')
+        result->op_mult (value);
+      else if (token == '/')
+        {
+          if (value.is_zero ())
+            {
+              std::cerr << "** WARNING division by zero" << std::endl;
+              result->set_long (0);
+            }
+          else
+            result->op_div (value);
+        }
+      else
+        {
+          if (value.is_zero ())
+            {
+              std::cerr << "** WARNING division by zero" << std::endl;
+              result->set_long (0);
+            }
+          else
+            result->op_mod (value);
+        }
+      next = next_token (__first, __last, &token);
+    }
+
+  return __first;
+}
+
+template <typename _InputIterator>
+_InputIterator pp::eval_additive(_InputIterator __first, _InputIterator __last, Value *result)
+{
+  __first = eval_multiplicative(__first, __last, result);
+
+  int token;
+  _InputIterator next = next_token (__first, __last, &token);
+
+  while (token == '+' || token == '-')
+    {
+      Value value;
+      __first = eval_multiplicative(next, __last, &value);
+
+      if (token == '+')
+        result->op_add (value);
+      else
+        result->op_sub (value);
+      next = next_token (__first, __last, &token);
+    }
+
+  return __first;
+}
+
+template <typename _InputIterator>
+_InputIterator pp::eval_shift(_InputIterator __first, _InputIterator __last, Value *result)
+{
+  __first = eval_additive(__first, __last, result);
+
+  int token;
+  _InputIterator next = next_token (__first, __last, &token);
+
+  while (token == TOKEN_LT_LT || token == TOKEN_GT_GT)
+    {
+      Value value;
+      __first = eval_additive (next, __last, &value);
+
+      if (token == TOKEN_LT_LT)
+        result->op_lhs (value);
+      else
+        result->op_rhs (value);
+      next = next_token (__first, __last, &token);
+    }
+
+  return __first;
+}
+
+template <typename _InputIterator>
+_InputIterator pp::eval_relational(_InputIterator __first, _InputIterator __last, Value *result)
+{
+  __first = eval_shift(__first, __last, result);
+
+  int token;
+  _InputIterator next = next_token (__first, __last, &token);
+
+  while (token == '<'
+      || token == '>'
+      || token == TOKEN_LT_EQ
+      || token == TOKEN_GT_EQ)
+    {
+      Value value;
+      __first = eval_shift(next, __last, &value);
+
+      switch (token)
+        {
+          default:
+            assert (0);
+            break;
+
+          case '<':
+            result->op_lt (value);
+            break;
+
+          case '>':
+            result->op_gt (value);
+            break;
+
+          case TOKEN_LT_EQ:
+            result->op_le (value);
+            break;
+
+          case TOKEN_GT_EQ:
+            result->op_ge (value);
+            break;
+        }
+      next = next_token (__first, __last, &token);
+    }
+
+  return __first;
+}
+
+template <typename _InputIterator>
+_InputIterator pp::eval_equality(_InputIterator __first, _InputIterator __last, Value *result)
+{
+  __first = eval_relational(__first, __last, result);
+
+  int token;
+  _InputIterator next = next_token (__first, __last, &token);
+
+  while (token == TOKEN_EQ_EQ || token == TOKEN_NOT_EQ)
+    {
+      Value value;
+      __first = eval_relational(next, __last, &value);
+
+      if (token == TOKEN_EQ_EQ)
+        result->op_eq (value);
+      else
+        result->op_ne (value);
+      next = next_token (__first, __last, &token);
+    }
+
+  return __first;
+}
+
+template <typename _InputIterator>
+_InputIterator pp::eval_and(_InputIterator __first, _InputIterator __last, Value *result)
+{
+  __first = eval_equality(__first, __last, result);
+
+  int token;
+  _InputIterator next = next_token (__first, __last, &token);
+
+  while (token == '&')
+    {
+      Value value;
+      __first = eval_equality(next, __last, &value);
+      result->op_bit_and (value);
+      next = next_token (__first, __last, &token);
+    }
+
+  return __first;
+}
+
+template <typename _InputIterator>
+_InputIterator pp::eval_xor(_InputIterator __first, _InputIterator __last, Value *result)
+{
+  __first = eval_and(__first, __last, result);
+
+  int token;
+  _InputIterator next = next_token (__first, __last, &token);
+
+  while (token == '^')
+    {
+      Value value;
+      __first = eval_and(next, __last, &value);
+      result->op_bit_xor (value);
+      next = next_token (__first, __last, &token);
+    }
+
+  return __first;
+}
+
+template <typename _InputIterator>
+_InputIterator pp::eval_or(_InputIterator __first, _InputIterator __last, Value *result)
+{
+  __first = eval_xor(__first, __last, result);
+
+  int token;
+  _InputIterator next = next_token (__first, __last, &token);
+
+  while (token == '|')
+    {
+      Value value;
+      __first = eval_xor(next, __last, &value);
+      result->op_bit_or (value);
+      next = next_token (__first, __last, &token);
+    }
+
+  return __first;
+}
+
+template <typename _InputIterator>
+_InputIterator pp::eval_logical_and(_InputIterator __first, _InputIterator __last, Value *result)
+{
+  __first = eval_or(__first, __last, result);
+
+  int token;
+  _InputIterator next = next_token (__first, __last, &token);
+
+  while (token == TOKEN_AND_AND)
+    {
+      Value value;
+      __first = eval_or(next, __last, &value);
+      result->op_and (value);
+      next = next_token (__first, __last, &token);
+    }
+
+  return __first;
+}
+
+template <typename _InputIterator>
+_InputIterator pp::eval_logical_or(_InputIterator __first, _InputIterator __last, Value *result)
+{
+  __first = eval_logical_and (__first, __last, result);
+
+  int token;
+  _InputIterator next = next_token (__first, __last, &token);
+
+  while (token == TOKEN_OR_OR)
+    {
+      Value value;
+      __first = eval_logical_and(next, __last, &value);
+      result->op_or (value);
+      next = next_token (__first, __last, &token);
+    }
+
+  return __first;
+}
+
+template <typename _InputIterator>
+_InputIterator pp::eval_constant_expression(_InputIterator __first, _InputIterator __last, Value *result)
+{
+  __first = eval_logical_or(__first, __last, result);
+
+  int token;
+  _InputIterator next = next_token (__first, __last, &token);
+
+  if (token == '?')
+    {
+      Value left_value;
+      __first = eval_constant_expression(next, __last, &left_value);
+      __first = skip_blanks (__first, __last);
+
+      __first = next_token(__first, __last, &token);
+      if (token == ':')
+        {
+          Value right_value;
+          __first = eval_constant_expression(__first, __last, &right_value);
+
+          *result = !result->is_zero () ? left_value : right_value;
+        }
+      else
+        {
+          std::cerr << "** WARNING expected ``:'' = " << int (token) << std::endl;
+          *result = left_value;
+        }
+    }
+
+  return __first;
+}
+
+template <typename _InputIterator>
+_InputIterator pp::eval_expression (_InputIterator __first, _InputIterator __last, Value *result)
+{
+  return __first = eval_constant_expression (skip_blanks (__first, __last), __last, result);
+}
+
+template <typename _InputIterator>
+_InputIterator pp::handle_if (_InputIterator __first, _InputIterator __last)
+{
+  if (test_if_level())
+    {
+      pp_macro_expander expand_condition (env);
+      std::string condition;
+      condition.reserve (255);
+      expand_condition (skip_blanks (__first, __last), __last, std::back_inserter (condition));
+
+      Value result;
+      result.set_long (0);
+      eval_expression(condition.c_str (), condition.c_str () + condition.size (), &result);
+
+      _M_true_test[iflevel] = !result.is_zero ();
+      _M_skipping[iflevel] = result.is_zero ();
+    }
+
+  return __first;
+}
+
+template <typename _InputIterator>
+_InputIterator pp::handle_else (_InputIterator __first, _InputIterator /*__last*/)
+{
+  if (iflevel == 0 && !skipping ())
+    {
+      std::cerr << "** WARNING #else without #if" << std::endl;
+    }
+  else if (iflevel > 0 && _M_skipping[iflevel - 1])
+    {
+      _M_skipping[iflevel] = true;
+    }
+  else
+    {
+      _M_skipping[iflevel] = _M_true_test[iflevel];
+    }
+
+  return __first;
+}
+
+template <typename _InputIterator>
+_InputIterator pp::handle_elif (_InputIterator __first, _InputIterator __last)
+{
+  assert(iflevel > 0);
+
+  if (iflevel == 0 && !skipping())
+    {
+      std::cerr << "** WARNING #else without #if" << std::endl;
+    }
+  else if (!_M_true_test[iflevel] && !_M_skipping[iflevel - 1])
+    {
+      Value result;
+      __first = eval_expression(__first, __last, &result);
+      _M_true_test[iflevel] = !result.is_zero ();
+      _M_skipping[iflevel] = result.is_zero ();
+    }
+  else
+    {
+      _M_skipping[iflevel] = true;
+    }
+
+  return __first;
+}
+
+template <typename _InputIterator>
+_InputIterator pp::handle_endif (_InputIterator __first, _InputIterator /*__last*/)
+{
+  if (iflevel == 0 && !skipping())
+    {
+      std::cerr << "** WARNING #endif without #if" << std::endl;
+    }
+  else
+    {
+      _M_skipping[iflevel] = 0;
+      _M_true_test[iflevel] = 0;
+
+      --iflevel;
+    }
+
+  return __first;
+}
+
+template <typename _InputIterator>
+_InputIterator pp::handle_ifdef (bool check_undefined, _InputIterator __first, _InputIterator __last)
+{
+  if (test_if_level())
+    {
+      _InputIterator end_macro_name = skip_identifier (__first, __last);
+
+      std::size_t __size;
+#if defined(__SUNPRO_CC)
+      std::distance (__first, end_macro_name, __size);
+#else
+      __size = std::distance (__first, end_macro_name);
+#endif
+      assert (__size < 256);
+
+      char __buffer [256];
+      std::copy (__first, end_macro_name, __buffer);
+
+      bool value = env.resolve (__buffer, __size) != 0;
+
+      __first = end_macro_name;
+
+      if (check_undefined)
+        value = !value;
+
+      _M_true_test[iflevel] = value;
+      _M_skipping[iflevel] = !value;
+    }
+
+  return __first;
+}
+
+template <typename _InputIterator>
+_InputIterator pp::handle_undef(_InputIterator __first, _InputIterator __last)
+{
+  __first = skip_blanks (__first, __last);
+  _InputIterator end_macro_name = skip_identifier (__first, __last);
+  assert (end_macro_name != __first);
+
+  std::size_t __size;
+#if defined(__SUNPRO_CC)
+  std::distance (__first, end_macro_name, __size);
+#else
+  __size = std::distance (__first, end_macro_name);
+#endif
+
+  assert (__size < 256);
+
+  char __buffer [256];
+  std::copy (__first, end_macro_name, __buffer);
+
+  pp_fast_string const __tmp (__buffer, __size);
+  env.unbind (&__tmp);
+
+  __first = end_macro_name;
+
+  return __first;
+}
+
+template <typename _InputIterator>
+char pp::peek_char (_InputIterator __first, _InputIterator __last)
+{
+  if (__first == __last)
+    return 0;
+
+  return *++__first;
+}
+
+template <typename _InputIterator>
+_InputIterator pp::next_token (_InputIterator __first, _InputIterator __last, int *kind)
+{
+  __first = skip_blanks (__first, __last);
+
+  if (__first == __last)
+    {
+      *kind = 0;
+      return __first;
+    }
+
+  char ch = *__first;
+  char ch2 = peek_char (__first, __last);
+
+  switch (ch)
+    {
+      case '/':
+        if (ch2 == '/' || ch2 == '*')
+          {
+            __first = skip_comment_or_divop (__first, __last);
+            return next_token (__first, __last, kind);
+          }
+        ++__first;
+        *kind = '/';
+        break;
+
+      case '<':
+        ++__first;
+        if (ch2 == '<')
+          {
+            ++__first;
+            *kind = TOKEN_LT_LT;
+          }
+        else if (ch2 == '=')
+          {
+            ++__first;
+            *kind = TOKEN_LT_EQ;
+          }
+        else
+          *kind = '<';
+
+        return __first;
+
+      case '>':
+        ++__first;
+        if (ch2 == '>')
+          {
+            ++__first;
+            *kind = TOKEN_GT_GT;
+          }
+        else if (ch2 == '=')
+          {
+            ++__first;
+            *kind = TOKEN_GT_EQ;
+          }
+        else
+          *kind = '>';
+
+        return __first;
+
+      case '!':
+        ++__first;
+        if (ch2 == '=')
+          {
+            ++__first;
+            *kind = TOKEN_NOT_EQ;
+          }
+        else
+          *kind = '!';
+
+        return __first;
+
+      case '=':
+        ++__first;
+        if (ch2 == '=')
+          {
+            ++__first;
+            *kind = TOKEN_EQ_EQ;
+          }
+        else
+          *kind = '=';
+
+        return __first;
+
+      case '|':
+        ++__first;
+        if (ch2 == '|')
+          {
+            ++__first;
+            *kind = TOKEN_OR_OR;
+          }
+        else
+          *kind = '|';
+
+        return __first;
+
+      case '&':
+        ++__first;
+        if (ch2 == '&')
+          {
+            ++__first;
+            *kind = TOKEN_AND_AND;
+          }
+        else
+          *kind = '&';
+
+        return __first;
+
+      default:
+        if (pp_isalpha (ch) || ch == '_')
+          {
+            _InputIterator end = skip_identifier (__first, __last);
+            _M_current_text.assign (__first, end);
+
+            token_text = &_M_current_text;
+            __first = end;
+
+            if (*token_text == "defined")
+              *kind = TOKEN_DEFINED;
+            else
+              *kind = TOKEN_IDENTIFIER;
+          }
+        else if (pp_isdigit (ch))
+          {
+            _InputIterator end = skip_number (__first, __last);
+            std::string __str (__first, __last);
+            char ch = __str [__str.size () - 1];
+            if (ch == 'u' || ch == 'U')
+              {
+                token_uvalue = strtoul (__str.c_str (), 0, 0);
+                *kind = TOKEN_UNUMBER;
+              }
+            else
+              {
+                token_value = strtol (__str.c_str (), 0, 0);
+                *kind = TOKEN_NUMBER;
+              }
+            __first = end;
+          }
+        else
+          *kind = *__first++;
+    }
+
+  return __first;
+}
+
+} // namespace rpp
+
+#endif // PP_ENGINE_BITS_H
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/rpp/pp-engine.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,293 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+** Copyright 2005 Roberto Raggi <roberto@kdevelop.org>
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#ifndef PP_ENGINE_H
+#define PP_ENGINE_H
+
+namespace rpp {
+
+struct Value
+{
+  enum Kind {
+    Kind_Long,
+    Kind_ULong,
+  };
+
+  Kind kind;
+
+  union {
+    long l;
+    unsigned long ul;
+  };
+
+  inline bool is_ulong () const { return kind == Kind_ULong; }
+
+  inline void set_ulong (unsigned long v)
+  {
+    ul = v;
+    kind = Kind_ULong;
+  }
+
+  inline void set_long (long v)
+  {
+    l = v;
+    kind = Kind_Long;
+  }
+
+  inline bool is_zero () const { return l == 0; }
+
+#define PP_DEFINE_BIN_OP(name, op) \
+  inline Value &name (const Value &other) \
+  { \
+    if (is_ulong () || other.is_ulong ()) \
+      set_ulong (ul op other.ul); \
+    else \
+      set_long (l op other.l); \
+    return *this; \
+  }
+
+  PP_DEFINE_BIN_OP(op_add, +)
+  PP_DEFINE_BIN_OP(op_sub, -)
+  PP_DEFINE_BIN_OP(op_mult, *)
+  PP_DEFINE_BIN_OP(op_div, /)
+  PP_DEFINE_BIN_OP(op_mod, %)
+  PP_DEFINE_BIN_OP(op_lhs, <<)
+  PP_DEFINE_BIN_OP(op_rhs, >>)
+  PP_DEFINE_BIN_OP(op_lt, <)
+  PP_DEFINE_BIN_OP(op_gt, >)
+  PP_DEFINE_BIN_OP(op_le, <=)
+  PP_DEFINE_BIN_OP(op_ge, >=)
+  PP_DEFINE_BIN_OP(op_eq, ==)
+  PP_DEFINE_BIN_OP(op_ne, !=)
+  PP_DEFINE_BIN_OP(op_bit_and, &)
+  PP_DEFINE_BIN_OP(op_bit_or, |)
+  PP_DEFINE_BIN_OP(op_bit_xor, ^)
+  PP_DEFINE_BIN_OP(op_and, &&)
+  PP_DEFINE_BIN_OP(op_or, ||)
+
+#undef PP_DEFINE_BIN_OP
+};
+
+class pp
+{
+  pp_environment &env;
+  pp_macro_expander expand;
+  pp_skip_identifier skip_identifier;
+  pp_skip_comment_or_divop skip_comment_or_divop;
+  pp_skip_blanks skip_blanks;
+  pp_skip_number skip_number;
+  std::vector<std::string> include_paths;
+  std::string _M_current_text;
+
+  enum { MAX_LEVEL = 512 };
+  int _M_skipping[MAX_LEVEL];
+  int _M_true_test[MAX_LEVEL];
+  int iflevel;
+
+  union
+  {
+    long token_value;
+    unsigned long token_uvalue;
+    std::string *token_text;
+  };
+
+  enum INCLUDE_POLICY
+  {
+    INCLUDE_GLOBAL,
+    INCLUDE_LOCAL
+  };
+
+  enum TOKEN_TYPE
+  {
+    TOKEN_NUMBER = 1000,
+    TOKEN_UNUMBER,
+    TOKEN_IDENTIFIER,
+    TOKEN_DEFINED,
+    TOKEN_LT_LT,
+    TOKEN_LT_EQ,
+    TOKEN_GT_GT,
+    TOKEN_GT_EQ,
+    TOKEN_EQ_EQ,
+    TOKEN_NOT_EQ,
+    TOKEN_OR_OR,
+    TOKEN_AND_AND,
+  };
+
+  enum PP_DIRECTIVE_TYPE
+  {
+    PP_UNKNOWN_DIRECTIVE,
+    PP_DEFINE,
+    PP_INCLUDE,
+    PP_INCLUDE_NEXT,
+    PP_ELIF,
+    PP_ELSE,
+    PP_ENDIF,
+    PP_IF,
+    PP_IFDEF,
+    PP_IFNDEF,
+    PP_UNDEF,
+    PP_PRAGMA,
+    PP_ERROR
+  };
+
+public:
+  pp (pp_environment &__env);
+
+  inline std::back_insert_iterator<std::vector<std::string> > include_paths_inserter ();
+
+  inline void push_include_path (std::string const &__path);
+
+  inline std::vector<std::string>::iterator include_paths_begin ();
+  inline std::vector<std::string>::iterator include_paths_end ();
+
+  inline std::vector<std::string>::const_iterator include_paths_begin () const;
+  inline std::vector<std::string>::const_iterator include_paths_end () const;
+
+  template <typename _InputIterator>
+  inline _InputIterator eval_expression (_InputIterator __first, _InputIterator __last, Value *result);
+
+  template <typename _OutputIterator>
+  void file (std::string const &filename, _OutputIterator __result);
+
+  template <typename _OutputIterator>
+  void file (FILE *fp, _OutputIterator __result);
+
+  template <typename _InputIterator, typename _OutputIterator>
+  void operator () (_InputIterator __first, _InputIterator __last, _OutputIterator __result);
+
+private:
+  inline bool file_isdir (std::string const &__filename) const;
+  inline bool file_exists (std::string const &__filename) const;
+  FILE *find_include_file (std::string const &__filename, std::string *__filepath,
+                           INCLUDE_POLICY __include_policy, bool __skip_current_path = false) const;
+
+  inline int skipping() const;
+  bool test_if_level();
+
+  inline std::string fix_file_path (std::string const &filename) const;
+  inline bool is_absolute (std::string const &filename) const;
+
+  PP_DIRECTIVE_TYPE find_directive (char const *__directive, std::size_t __size) const;
+
+  template <typename _InputIterator>
+  bool find_header_protection (_InputIterator __first, _InputIterator __last, std::string *__prot);
+
+  template <typename _InputIterator>
+  _InputIterator skip (_InputIterator __first, _InputIterator __last);
+
+  template <typename _InputIterator>
+  _InputIterator eval_primary(_InputIterator __first, _InputIterator __last, Value *result);
+
+  template <typename _InputIterator>
+  _InputIterator eval_multiplicative(_InputIterator __first, _InputIterator __last, Value *result);
+
+  template <typename _InputIterator>
+  _InputIterator eval_additive(_InputIterator __first, _InputIterator __last, Value *result);
+
+  template <typename _InputIterator>
+  _InputIterator eval_shift(_InputIterator __first, _InputIterator __last, Value *result);
+
+  template <typename _InputIterator>
+  _InputIterator eval_relational(_InputIterator __first, _InputIterator __last, Value *result);
+
+  template <typename _InputIterator>
+  _InputIterator eval_equality(_InputIterator __first, _InputIterator __last, Value *result);
+
+  template <typename _InputIterator>
+  _InputIterator eval_and(_InputIterator __first, _InputIterator __last, Value *result);
+
+  template <typename _InputIterator>
+  _InputIterator eval_xor(_InputIterator __first, _InputIterator __last, Value *result);
+
+  template <typename _InputIterator>
+  _InputIterator eval_or(_InputIterator __first, _InputIterator __last, Value *result);
+
+  template <typename _InputIterator>
+  _InputIterator eval_logical_and(_InputIterator __first, _InputIterator __last, Value *result);
+
+  template <typename _InputIterator>
+  _InputIterator eval_logical_or(_InputIterator __first, _InputIterator __last, Value *result);
+
+  template <typename _InputIterator>
+  _InputIterator eval_constant_expression(_InputIterator __first, _InputIterator __last, Value *result);
+
+  template <typename _InputIterator, typename _OutputIterator>
+  _InputIterator handle_directive(char const *__directive, std::size_t __size,
+          _InputIterator __first, _InputIterator __last, _OutputIterator __result);
+
+  template <typename _InputIterator, typename _OutputIterator>
+  _InputIterator handle_include(bool skip_current_path, _InputIterator __first, _InputIterator __last,
+        _OutputIterator __result);
+
+  template <typename _InputIterator>
+  _InputIterator handle_define (_InputIterator __first, _InputIterator __last);
+
+  template <typename _InputIterator>
+  _InputIterator handle_if (_InputIterator __first, _InputIterator __last);
+
+  template <typename _InputIterator>
+  _InputIterator handle_else (_InputIterator __first, _InputIterator __last);
+
+  template <typename _InputIterator>
+  _InputIterator handle_elif (_InputIterator __first, _InputIterator __last);
+
+  template <typename _InputIterator>
+  _InputIterator handle_endif (_InputIterator __first, _InputIterator __last);
+
+  template <typename _InputIterator>
+  _InputIterator handle_ifdef (bool check_undefined, _InputIterator __first, _InputIterator __last);
+
+  template <typename _InputIterator>
+  _InputIterator handle_undef(_InputIterator __first, _InputIterator __last);
+
+  template <typename _InputIterator>
+  inline char peek_char (_InputIterator __first, _InputIterator __last);
+
+  template <typename _InputIterator>
+  _InputIterator next_token (_InputIterator __first, _InputIterator __last, int *kind);
+};
+
+} // namespace rpp
+
+#endif // PP_ENGINE_H
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/rpp/pp-environment.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,160 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+** Copyright 2005 Roberto Raggi <roberto@kdevelop.org>
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#ifndef PP_ENVIRONMENT_H
+#define PP_ENVIRONMENT_H
+
+#include <vector>
+#include <cstring>
+
+namespace rpp {
+
+class pp_environment
+{
+public:
+  typedef std::vector<pp_macro*>::const_iterator const_iterator;
+
+public:
+  pp_environment ():
+    current_line (0),
+    _M_hash_size (4093)
+  {
+    _M_base = (pp_macro **) memset (new pp_macro* [_M_hash_size], 0, _M_hash_size * sizeof (pp_macro*));
+  }
+
+  ~pp_environment ()
+  {
+    for (std::size_t i = 0; i < _M_macros.size (); ++i)
+      delete _M_macros [i];
+
+    delete [] _M_base;
+  }
+
+  const_iterator first_macro () const { return _M_macros.begin (); }
+  const_iterator last_macro () const { return _M_macros.end (); }
+
+  inline void bind (pp_fast_string const *__name, pp_macro const &__macro)
+  {
+    std::size_t h = hash_code (*__name) % _M_hash_size;
+    pp_macro *m = new pp_macro (__macro);
+    m->name = __name;
+    m->next = _M_base [h];
+    m->hash_code = h;
+    _M_base [h] = m;
+
+    _M_macros.push_back (m);
+
+    if (_M_macros.size() == _M_hash_size)
+      rehash();
+  }
+
+  inline void unbind (pp_fast_string const *__name)
+  {
+    if (pp_macro *m = resolve (__name))
+      m->hidden = true;
+  }
+
+  inline void unbind (char const *__s, std::size_t __size)
+  {
+    pp_fast_string __tmp (__s, __size);
+    unbind (&__tmp);
+  }
+
+  inline pp_macro *resolve (pp_fast_string const *__name) const
+  {
+    std::size_t h = hash_code (*__name) % _M_hash_size;
+    pp_macro *it = _M_base [h];
+
+    while (it && it->name && it->hash_code == h && (*it->name != *__name || it->hidden))
+      it = it->next;
+
+    return it;
+  }
+
+  inline pp_macro *resolve (char const *__data, std::size_t __size) const
+  {
+    pp_fast_string const __tmp (__data, __size);
+    return resolve (&__tmp);
+  }
+
+  std::string current_file;
+  int current_line;
+
+private:
+  inline std::size_t hash_code (pp_fast_string const &s) const
+  {
+    std::size_t hash_value = 0;
+
+    for (std::size_t i = 0; i < s.size (); ++i)
+      hash_value = (hash_value << 5) - hash_value + s.at (i);
+
+    return hash_value;
+  }
+
+  void rehash()
+  {
+    delete[] _M_base;
+
+    _M_hash_size <<= 1;
+
+    _M_base = (pp_macro **) memset (new pp_macro* [_M_hash_size], 0, _M_hash_size * sizeof(pp_macro*));
+    for (std::size_t index = 0; index < _M_macros.size (); ++index)
+      {
+        pp_macro *elt = _M_macros [index];
+        std::size_t h = hash_code (*elt->name) % _M_hash_size;
+        elt->next = _M_base [h];
+        elt->hash_code = h;
+        _M_base [h] = elt;
+      }
+  }
+
+private:
+  std::vector<pp_macro*> _M_macros;
+  pp_macro **_M_base;
+  std::size_t _M_hash_size;
+};
+
+} // namespace rpp
+
+#endif // PP_ENVIRONMENT_H
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/rpp/pp-fwd.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+** Copyright 2005 Roberto Raggi <roberto@kdevelop.org>
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#ifndef PP_FWD_H
+#define PP_FWD_H
+
+namespace rpp {
+
+template <typename _CharT> class pp_string;
+
+typedef pp_string<char> pp_fast_string;
+
+#endif // PP_FWD_H
+
+} // namespace rpp
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/rpp/pp-internal.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,134 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+** Copyright 2005 Roberto Raggi <roberto@kdevelop.org>
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#ifndef PP_INTERNAL_H
+#define PP_INTERNAL_H
+
+#include <algorithm>
+
+namespace rpp {
+
+namespace _PP_internal
+{
+
+inline void extract_file_path (const std::string &__filename, std::string *__filepath)
+{
+  std::size_t __index = __filename.rfind (PATH_SEPARATOR);
+
+  if (__index == std::string::npos)
+    *__filepath = "/";
+
+  else
+    __filepath->assign (__filename, 0, __index + 1);
+}
+
+template <typename _OutputIterator>
+void output_line(const std::string &__filename, int __line, _OutputIterator __result)
+{
+  std::string __msg;
+
+  __msg += "# ";
+
+  char __line_descr[16];
+  pp_snprintf (__line_descr, 16, "%d", __line);
+  __msg += __line_descr;
+
+  __msg += " \"";
+
+  if (__filename.empty ())
+    __msg += "<internal>";
+  else
+    __msg += __filename;
+
+  __msg += "\"\n";
+  std::copy (__msg.begin (), __msg.end (), __result);
+}
+
+template <typename _InputIterator>
+inline bool comment_p (_InputIterator __first, _InputIterator __last) /*const*/
+{
+  if (__first == __last)
+    return false;
+
+  if (*__first != '/')
+    return false;
+
+  if (++__first == __last)
+    return false;
+
+  return (*__first == '/' || *__first == '*');
+}
+
+struct _Compare_string: public std::binary_function<bool, pp_fast_string const *, pp_fast_string const *>
+{
+  inline bool operator () (pp_fast_string const *__lhs, pp_fast_string const *__rhs) const
+  { return *__lhs < *__rhs; }
+};
+
+struct _Equal_to_string: public std::binary_function<bool, pp_fast_string const *, pp_fast_string const *>
+{
+  inline bool operator () (pp_fast_string const *__lhs, pp_fast_string const *__rhs) const
+  { return *__lhs == *__rhs; }
+};
+
+struct _Hash_string: public std::unary_function<std::size_t, pp_fast_string const *>
+{
+  inline std::size_t operator () (pp_fast_string const *__s) const
+  {
+    char const *__ptr = __s->begin ();
+    std::size_t __size = __s->size ();
+    std::size_t __h = 0;
+
+    for (std::size_t i = 0; i < __size; ++i)
+      __h = (__h << 5) - __h + __ptr [i];
+
+    return __h;
+  }
+};
+
+} // _PP_internal
+
+} // namespace rpp
+
+#endif // PP_INTERNAL_H
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/rpp/pp-iterator.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,93 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+** Copyright 2005 Roberto Raggi <roberto@kdevelop.org>
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#ifndef PP_ITERATOR_H
+#define PP_ITERATOR_H
+
+#include <iterator>
+
+namespace rpp {
+
+class pp_null_output_iterator
+  : public std::iterator<std::output_iterator_tag, void, void, void, void>
+{
+public:
+  pp_null_output_iterator() {}
+
+  template <typename _Tp>
+  pp_null_output_iterator &operator=(_Tp const &)
+  { return *this; }
+
+  inline pp_null_output_iterator &operator * () { return *this; }
+  inline pp_null_output_iterator &operator ++ () { return *this; }
+  inline pp_null_output_iterator operator ++ (int) { return *this; }
+};
+
+template <typename _Container>
+class pp_output_iterator
+  : public std::iterator<std::output_iterator_tag, void, void, void, void>
+{
+  std::string &_M_result;
+
+public:
+  explicit pp_output_iterator(std::string &__result):
+    _M_result (__result) {}
+
+  inline pp_output_iterator &operator=(typename _Container::const_reference __v)
+  {
+    if (_M_result.capacity () == _M_result.size ())
+      _M_result.reserve (_M_result.capacity () << 2);
+
+    _M_result.push_back(__v);
+    return *this;
+  }
+
+  inline pp_output_iterator &operator * () { return *this; }
+  inline pp_output_iterator &operator ++ () { return *this; }
+  inline pp_output_iterator operator ++ (int) { return *this; }
+};
+
+} // namespace rpp
+
+#endif // PP_ITERATOR_H
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/rpp/pp-macro-expander.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,410 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+** Copyright 2005 Roberto Raggi <roberto@kdevelop.org>
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#ifndef PP_MACRO_EXPANDER_H
+#define PP_MACRO_EXPANDER_H
+
+namespace rpp {
+
+struct pp_frame
+{
+  pp_macro *expanding_macro;
+  std::vector<std::string> *actuals;
+
+  pp_frame (pp_macro *__expanding_macro, std::vector<std::string> *__actuals):
+    expanding_macro (__expanding_macro), actuals (__actuals) {}
+};
+
+class pp_macro_expander
+{
+  pp_environment &env;
+  pp_frame *frame;
+
+  pp_skip_number skip_number;
+  pp_skip_identifier skip_identifier;
+  pp_skip_string_literal skip_string_literal;
+  pp_skip_char_literal skip_char_literal;
+  pp_skip_argument skip_argument;
+  pp_skip_comment_or_divop skip_comment_or_divop;
+  pp_skip_blanks skip_blanks;
+  pp_skip_whitespaces skip_whitespaces;
+
+  std::string const *resolve_formal (pp_fast_string const *__name)
+  {
+    assert (__name != 0);
+
+    if (! frame)
+      return 0;
+
+    assert (frame->expanding_macro != 0);
+
+    std::vector<pp_fast_string const *> const formals = frame->expanding_macro->formals;
+    for (std::size_t index = 0; index < formals.size(); ++index)
+      {
+        pp_fast_string const *formal = formals[index];
+
+        if (*formal != *__name)
+          continue;
+
+        else if (frame->actuals && index < frame->actuals->size())
+          return &(*frame->actuals)[index];
+
+        else
+          assert (0); // internal error?
+      }
+
+    return 0;
+  }
+
+public: // attributes
+  int lines;
+  int generated_lines;
+
+public:
+  pp_macro_expander (pp_environment &__env, pp_frame *__frame = 0):
+    env (__env), frame (__frame), lines (0), generated_lines (0) {}
+
+  template <typename _InputIterator, typename _OutputIterator>
+  _InputIterator operator () (_InputIterator __first, _InputIterator __last, _OutputIterator __result)
+  {
+    generated_lines = 0;
+    __first = skip_blanks (__first, __last);
+    lines = skip_blanks.lines;
+
+    while (__first != __last)
+      {
+        if (*__first == '\n')
+          {
+            *__result++ = *__first;
+            ++lines;
+
+            __first = skip_blanks (++__first, __last);
+            lines += skip_blanks.lines;
+
+            if (__first != __last && *__first == '#')
+              break;
+          }
+        else if (*__first == '#')
+          {
+            __first = skip_blanks (++__first, __last);
+            lines += skip_blanks.lines;
+
+            _InputIterator end_id = skip_identifier (__first, __last);
+
+            // ### rewrite: not safe
+            char name_buffer[512], *cp = name_buffer;
+            std::copy (__first, end_id, cp);
+            std::size_t name_size = end_id - __first;
+            name_buffer[name_size] = '\0';
+
+            pp_fast_string fast_name (name_buffer, name_size);
+
+            if (std::string const *actual = resolve_formal (&fast_name))
+              {
+                *__result++ = '\"';
+
+                for (std::string::const_iterator it = skip_whitespaces (actual->begin (), actual->end ());
+                    it != actual->end (); ++it)
+                  {
+                    if (*it == '"')
+                      {
+                        *__result++ = '\\';
+                        *__result++ = *it;
+                      }
+
+                    else if (*it == '\n')
+                      {
+                        *__result++ = '"';
+                        *__result++ = '\n';
+                        *__result++ = '"';
+                      }
+
+                    else
+                      *__result++ = *it;
+                  }
+
+                *__result++ = '\"';
+                __first = end_id;
+              }
+            else
+              *__result++ = '#'; // ### warning message?
+          }
+        else if (*__first == '\"')
+          {
+            _InputIterator next_pos = skip_string_literal (__first, __last);
+            lines += skip_string_literal.lines;
+            std::copy (__first, next_pos, __result);
+            __first = next_pos;
+          }
+        else if (*__first == '\'')
+          {
+            _InputIterator next_pos = skip_char_literal (__first, __last);
+            lines += skip_char_literal.lines;
+            std::copy (__first, next_pos, __result);
+            __first = next_pos;
+          }
+        else if (_PP_internal::comment_p (__first, __last))
+          {
+            __first = skip_comment_or_divop (__first, __last);
+            int n = skip_comment_or_divop.lines;
+            lines += n;
+
+            while (n-- > 0)
+              *__result++ = '\n';
+          }
+        else if (pp_isspace (*__first))
+          {
+            for (; __first != __last; ++__first)
+              {
+                if (*__first == '\n' || !pp_isspace (*__first))
+                  break;
+              }
+
+            *__result = ' ';
+          }
+        else if (pp_isdigit (*__first))
+          {
+            _InputIterator next_pos = skip_number (__first, __last);
+            lines += skip_number.lines;
+            std::copy (__first, next_pos, __result);
+            __first = next_pos;
+          }
+        else if (pp_isalpha (*__first) || *__first == '_')
+          {
+            _InputIterator name_begin = __first;
+            _InputIterator name_end = skip_identifier (__first, __last);
+            __first = name_end; // advance
+
+            // search for the paste token
+            _InputIterator next = skip_blanks (__first, __last);
+            if (next != __last && *next == '#')
+              {
+                ++next;
+                if (next != __last && *next == '#')
+                  __first = skip_blanks(++next, __last);
+              }
+
+            // ### rewrite: not safe
+
+            std::ptrdiff_t name_size;
+#if defined(__SUNPRO_CC)
+             std::distance (name_begin, name_end, name_size);
+#else
+            name_size = std::distance (name_begin, name_end);
+#endif
+            assert (name_size >= 0 && name_size < 512);
+
+            char name_buffer[512], *cp = name_buffer;
+            std::size_t __size = name_end - name_begin;
+            std::copy (name_begin, name_end, cp);
+            name_buffer[__size] = '\0';
+
+            pp_fast_string fast_name (name_buffer, name_size);
+
+            if (std::string const *actual = resolve_formal (&fast_name))
+              {
+                std::copy (actual->begin (), actual->end (), __result);
+                continue;
+              }
+
+            static bool hide_next = false; // ### remove me
+
+            pp_macro *macro = env.resolve (name_buffer, name_size);
+            if (! macro || macro->hidden || hide_next)
+              {
+                hide_next = ! strcmp (name_buffer, "defined");
+
+                if (__size == 8 && name_buffer [0] == '_' && name_buffer [1] == '_')
+                  {
+                    if (! strcmp (name_buffer, "__LINE__"))
+                      {
+                        char buf [16];
+                        char *end = buf + pp_snprintf (buf, 16, "%d", env.current_line + lines);
+
+                        std::copy (&buf [0], end, __result);
+                        continue;
+                      }
+
+                    else if (! strcmp (name_buffer, "__FILE__"))
+                      {
+                        __result++ = '"';
+                        std::copy (env.current_file.begin (), env.current_file.end (), __result); // ### quote
+                        __result++ = '"';
+                        continue;
+                      }
+                  }
+
+                std::copy (name_begin, name_end, __result);
+                continue;
+              }
+
+            if (! macro->function_like)
+              {
+                pp_macro *m = 0;
+
+                if (macro->definition)
+                  {
+                    macro->hidden = true;
+
+                    std::string __tmp;
+                    __tmp.reserve (256);
+
+                    pp_macro_expander expand_macro (env);
+                    expand_macro (macro->definition->begin (), macro->definition->end (), std::back_inserter (__tmp));
+                    generated_lines += expand_macro.lines;
+
+                    if (! __tmp.empty ())
+                      {
+                        std::string::iterator __begin_id = skip_whitespaces (__tmp.begin (), __tmp.end ());
+                        std::string::iterator __end_id = skip_identifier (__begin_id, __tmp.end ());
+
+                        if (__end_id == __tmp.end ())
+                          {
+                            std::string __id;
+                            __id.assign (__begin_id, __end_id);
+
+                            std::size_t x;
+#if defined(__SUNPRO_CC)
+                            std::distance (__begin_id, __end_id, x);
+#else
+                            x = std::distance (__begin_id, __end_id);
+#endif
+                            m = env.resolve (__id.c_str (), x);
+                          }
+
+                        if (! m)
+                          std::copy (__tmp.begin (), __tmp.end (), __result);
+                      }
+
+                    macro->hidden = false;
+                  }
+
+                if (! m)
+                  continue;
+
+                macro = m;
+              }
+
+            // function like macro
+            _InputIterator arg_it = skip_whitespaces (__first, __last);
+
+            if (arg_it == __last || *arg_it != '(')
+              {
+                std::copy (name_begin, name_end, __result);
+                lines += skip_whitespaces.lines;
+                __first = arg_it;
+                continue;
+              }
+
+            std::vector<std::string> actuals;
+            actuals.reserve (5);
+            ++arg_it; // skip '('
+
+            pp_macro_expander expand_actual (env, frame);
+
+            _InputIterator arg_end = skip_argument_variadics (actuals, macro, arg_it, __last);
+            if (arg_it != arg_end)
+              {
+                std::string actual (arg_it, arg_end);
+                actuals.resize (actuals.size() + 1);
+                actuals.back ().reserve (255);
+                expand_actual (actual.begin (), actual.end(), std::back_inserter (actuals.back()));
+                arg_it = arg_end;
+              }
+
+            while (arg_it != __last && *arg_end == ',')
+              {
+                ++arg_it; // skip ','
+
+                arg_end = skip_argument_variadics (actuals, macro, arg_it, __last);
+                std::string actual (arg_it, arg_end);
+                actuals.resize (actuals.size() + 1);
+                actuals.back ().reserve (255);
+                expand_actual (actual.begin (), actual.end(), std::back_inserter (actuals.back()));
+                arg_it = arg_end;
+              }
+
+              assert (arg_it != __last && *arg_it == ')');
+
+              ++arg_it; // skip ')'
+              __first = arg_it;
+
+#if 0 // ### enable me
+              assert ((macro->variadics && macro->formals.size () >= actuals.size ())
+                          || macro->formals.size() == actuals.size());
+#endif
+
+              pp_frame frame (macro, &actuals);
+              pp_macro_expander expand_macro (env, &frame);
+              macro->hidden = true;
+              expand_macro (macro->definition->begin (), macro->definition->end (), __result);
+              macro->hidden = false;
+              generated_lines += expand_macro.lines;
+          }
+        else
+          *__result++ = *__first++;
+      }
+
+    return __first;
+  }
+
+  template <typename _InputIterator>
+  _InputIterator skip_argument_variadics (std::vector<std::string> const &__actuals, pp_macro *__macro,
+                                          _InputIterator __first, _InputIterator __last)
+  {
+    _InputIterator arg_end = skip_argument (__first, __last);
+
+    while (__macro->variadics && __first != arg_end && arg_end != __last && *arg_end == ','
+        && (__actuals.size () + 1) == __macro->formals.size ())
+      {
+        arg_end = skip_argument (++arg_end, __last);
+      }
+
+    return arg_end;
+  }
+};
+
+} // namespace rpp
+
+#endif // PP_MACRO_EXPANDER_H
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/rpp/pp-macro.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,90 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+** Copyright 2005 Roberto Raggi <roberto@kdevelop.org>
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#ifndef PP_MACRO_H
+#define PP_MACRO_H
+
+namespace rpp {
+
+struct pp_macro
+{
+#if defined (PP_WITH_MACRO_POSITION)
+  pp_fast_string const *file;
+#endif
+  pp_fast_string const *name;
+  pp_fast_string const *definition;
+  std::vector<pp_fast_string const *> formals;
+
+  union
+  {
+    int unsigned state;
+
+    struct
+    {
+      int unsigned hidden: 1;
+      int unsigned function_like: 1;
+      int unsigned variadics: 1;
+    };
+  };
+
+  int lines;
+  pp_macro *next;
+  std::size_t hash_code;
+
+  inline pp_macro():
+#if defined (PP_WITH_MACRO_POSITION)
+    file (0),
+#endif
+    name (0),
+    definition (0),
+    state (0),
+    lines (0),
+    next (0),
+    hash_code (0)
+    {}
+};
+
+} // namespace rpp
+
+#endif // PP_MACRO_H
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/rpp/pp-main.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,341 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+** Copyright 2005 Roberto Raggi <roberto@kdevelop.org>
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#include <fstream>
+#include "pp.h"
+
+using namespace rpp;
+
+#ifndef GCC_MACHINE
+#  define GCC_MACHINE "i386-redhat-linux"
+#endif
+
+#ifndef GCC_VERSION
+#  define GCC_VERSION "4.1.1"
+#endif
+
+void usage ()
+{
+  std::cerr << "usage: rpp file.cpp" << std::endl;
+  ::exit (EXIT_FAILURE);
+}
+
+void dump_macros (pp_environment &env, pp &, std::ostream &__out)
+{
+  for (pp_environment::const_iterator it = env.first_macro (); it != env.last_macro (); ++it)
+    {
+      pp_macro const *m = *it;
+
+      if (m->hidden)
+        continue;
+
+      std::string id (m->name->begin (), m->name->end ());
+      __out << "#define " << id;
+
+      if (m->function_like)
+        {
+          __out << "(";
+
+          for (std::size_t i = 0; i < m->formals.size (); ++i)
+            {
+              if (i != 0)
+                __out << ", ";
+
+              pp_fast_string const *f = m->formals [i];
+              std::string name (f->begin (), f->end ());
+              __out << name;
+            }
+
+          if (m->variadics)
+            __out << "...";
+
+          __out << ")";
+        }
+
+      __out << "\t";
+      if (m->definition)
+        {
+          std::string def (m->definition->begin (), m->definition->end ());
+          __out << def;
+        }
+
+      __out << std::endl;
+    }
+}
+
+int main (int, char *argv [])
+{
+  char const *input_file = 0;
+  char const *output_file = 0;
+  char const *include_pch_file = 0;
+  bool opt_help = false;
+  bool opt_dump_macros = false;
+  bool opt_pch = false;
+
+  pp_environment env;
+  pp preprocess(env);
+
+  std::string result;
+  result.reserve (20 * 1024); // 20K
+
+  pp_output_iterator<std::string> out (result);
+  pp_null_output_iterator null_out;
+
+  preprocess.push_include_path ("/usr/include");
+  preprocess.push_include_path ("/usr/lib/gcc/" GCC_MACHINE "/" GCC_VERSION "/include");
+
+  preprocess.push_include_path ("/usr/include/c++/" GCC_VERSION);
+  preprocess.push_include_path ("/usr/include/c++/" GCC_VERSION "/" GCC_MACHINE);
+
+  std::string extra_args;
+
+  while (const char *arg = *++argv)
+    {
+      if (arg [0] != '-')
+        input_file = arg;
+
+      else if (! strcmp (arg, "-help"))
+        opt_help = true;
+
+      else if (! strcmp (arg, "-dM"))
+        opt_dump_macros = true;
+
+      else if (! strcmp (arg, "-pch"))
+        opt_pch = true;
+
+      else if (! strcmp (arg, "-msse"))
+    {
+      pp_macro __macro;
+      __macro.name = pp_symbol::get ("__SSE__", 7);
+      env.bind (__macro.name, __macro);
+
+      __macro.name = pp_symbol::get ("__MMX__", 7);
+      env.bind (__macro.name, __macro);
+    }
+
+      else if (! strcmp (arg, "-include"))
+        {
+          if (argv [1])
+        include_pch_file = *++argv;
+        }
+
+      else if (! strncmp (arg, "-o", 2))
+        {
+          arg += 2;
+
+          if (! arg [0] && argv [1])
+            arg = *++argv;
+
+          if (arg)
+            output_file = arg;
+        }
+
+      else if (! strncmp (arg, "-conf", 8))
+        {
+          if (argv [1])
+            preprocess.file (*++argv, null_out);
+        }
+
+      else if (! strncmp (arg, "-I", 2))
+        {
+          arg += 2;
+
+          if (! arg [0] && argv [1])
+            arg = *++argv;
+
+          if (arg)
+            preprocess.push_include_path (arg);
+        }
+
+      else if (! strncmp (arg, "-U", 2))
+        {
+          arg += 2;
+
+          if (! arg [0] && argv [1])
+            arg = *++argv;
+
+          if (arg)
+            {
+              env.unbind (arg, strlen (arg));
+            }
+        }
+
+      else if (! strncmp (arg, "-D", 2))
+        {
+          arg += 2;
+
+          if (! arg [0] && argv [1])
+            arg = *++argv;
+
+          if (arg)
+            {
+              pp_macro __macro;
+
+              char const *end = arg;
+              char const *eq = 0;
+
+              for (; *end; ++end)
+                {
+                  if (*end == '=')
+                    eq = end;
+                }
+
+              if (eq != 0)
+                {
+                  __macro.name = pp_symbol::get (arg, eq - arg);
+                  __macro.definition = pp_symbol::get (eq + 1, end - (eq + 1));
+                }
+
+              else
+                {
+                  __macro.name = pp_symbol::get (arg, end - arg);
+                  __macro.definition = 0;
+                }
+
+              env.bind (__macro.name, __macro);
+            }
+        }
+      else
+        {
+          extra_args += " ";
+          extra_args += arg;
+        }
+    }
+
+  if (! input_file || opt_help)
+    {
+      usage ();
+      return EXIT_FAILURE;
+    }
+
+  std::string __ifile (input_file);
+  bool is_c_file = false;
+  if (__ifile.size () > 2 && __ifile [__ifile.size () - 1] == 'c' && __ifile [__ifile.size () - 2] == '.')
+    {
+      is_c_file = true;
+      env.unbind ("__cplusplus", 11);
+
+      pp_macro __macro;
+      __macro.name = pp_symbol::get ("__null");
+      __macro.definition = pp_symbol::get ("((void*) 0)");
+      env.bind (__macro.name, __macro);
+
+      // turn off the pch
+      include_pch_file = 0;
+    }
+  else if (include_pch_file)
+    {
+      std::string __pch (include_pch_file);
+      __pch += ".gch/c++.conf";
+
+      //std::cerr << "*** pch file " << __pch << std::endl;
+      preprocess.file (__pch, null_out);
+    }
+
+  if (opt_dump_macros)
+    {
+      preprocess.file (input_file, null_out);
+      dump_macros (env, preprocess, std::cout);
+      return EXIT_SUCCESS;
+    }
+
+  preprocess.file (input_file, out);
+
+  if (opt_pch)
+    {
+      if (! output_file)
+        {
+          std::cerr << "*** WARNING expected a file name" << std::endl;
+          return EXIT_FAILURE;
+        }
+
+      std::string __conf_file (output_file);
+      __conf_file += ".conf";
+
+      std::ofstream __out;
+      __out.open (__conf_file.c_str ());
+      dump_macros (env, preprocess, __out);
+      __out.close ();
+
+      std::string __pp_file (output_file);
+      __pp_file += ".i";
+
+      __out.open (__pp_file.c_str ());
+      __out.write (result.c_str (), result.size ());
+      __out.close ();
+      return EXIT_SUCCESS;
+    }
+
+  std::ostream *__out = &std::cout;
+  std::ofstream __ofile;
+
+  if (output_file)
+    {
+      std::string __output_file_name (output_file);
+      __ofile.open (output_file);
+      __out = &__ofile;
+    }
+
+  if (include_pch_file)
+    {
+      std::string __pch (include_pch_file);
+      __pch += ".gch/c++.i";
+
+      std::ifstream __in (__pch.c_str ());
+
+      char buffer [1024];
+      while (__in.read (buffer, 1024))
+        __out->write (buffer, 1024);
+
+      __in.close ();
+    }
+
+  __out->write (result.c_str (), result.size ());
+
+  if (output_file)
+    __ofile.close ();
+
+  return EXIT_SUCCESS;
+}
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/rpp/pp-qt-configuration	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,25 @@
+#define __cplusplus 1
+
+#define __STDC__
+
+// Qt
+#define QOBJECTDEFS_H
+
+// not yet supported
+#define Q_SLOTS slots
+#define Q_SIGNALS signals
+#define Q_FLAGS(a)
+#define Q_PRIVATE_SLOT(a, b)
+#define Q_DECLARE_INTERFACE(a,b)
+#define Q_INTERFACES(a)
+#define Q_GADGET
+#define Q_OVERRIDE(a)
+#define Q_OS_OS2
+#define ULONG_MAX Integer.MAX_VALUE
+#define Q_NO_USING_KEYWORD
+
+// There are symbols in Qt that exist in Debug but
+// not in release
+#define QT_NO_DEBUG
+
+#define QT_JAMBI_RUN
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/rpp/pp-scanner.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,368 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+** Copyright 2005 Roberto Raggi <roberto@kdevelop.org>
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#ifndef PP_SCANNER_H
+#define PP_SCANNER_H
+
+namespace rpp {
+
+struct pp_skip_blanks
+{
+  int lines;
+
+  template <typename _InputIterator>
+  _InputIterator operator () (_InputIterator __first, _InputIterator __last)
+  {
+    lines = 0;
+
+    for (; __first != __last; lines += (*__first != '\n' ? 0 : 1), ++__first)
+      {
+        if (*__first == '\\')
+          {
+            _InputIterator __begin = __first;
+            ++__begin;
+
+            if (__begin != __last && *__begin == '\n')
+                ++__first;
+            else
+              break;
+          }
+        else if (*__first == '\n' || !pp_isspace (*__first))
+          break;
+      }
+
+    return __first;
+  }
+};
+
+struct pp_skip_whitespaces
+{
+  int lines;
+
+  template <typename _InputIterator>
+  _InputIterator operator () (_InputIterator __first, _InputIterator __last)
+  {
+    lines = 0;
+
+    for (; __first != __last; lines += (*__first != '\n' ? 0 : 1), ++__first)
+      {
+        if (! pp_isspace (*__first))
+          break;
+      }
+
+    return __first;
+  }
+};
+
+struct pp_skip_comment_or_divop
+{
+  int lines;
+
+  template <typename _InputIterator>
+  _InputIterator operator () (_InputIterator __first, _InputIterator __last)
+  {
+    enum {
+      MAYBE_BEGIN,
+      BEGIN,
+      MAYBE_END,
+      END,
+      IN_COMMENT,
+      IN_CXX_COMMENT
+    } state (MAYBE_BEGIN);
+
+    lines = 0;
+
+    for (; __first != __last; lines += (*__first != '\n' ? 0 : 1), ++__first)
+      {
+        switch (state)
+          {
+            default:
+              assert (0);
+              break;
+
+            case MAYBE_BEGIN:
+              if (*__first != '/')
+                return __first;
+
+              state = BEGIN;
+              break;
+
+            case BEGIN:
+              if (*__first == '*')
+                state = IN_COMMENT;
+              else if (*__first == '/')
+                state = IN_CXX_COMMENT;
+              else
+                return __first;
+              break;
+
+            case IN_COMMENT:
+              if (*__first == '*')
+                state = MAYBE_END;
+              break;
+
+            case IN_CXX_COMMENT:
+              if (*__first == '\n')
+                return __first;
+              break;
+
+            case MAYBE_END:
+              if (*__first == '/')
+                state = END;
+              else if (*__first != '*')
+                state = IN_COMMENT;
+              break;
+
+            case END:
+              return __first;
+          }
+      }
+
+    return __first;
+  }
+};
+
+struct pp_skip_identifier
+{
+  int lines;
+
+  template <typename _InputIterator>
+  _InputIterator operator () (_InputIterator __first, _InputIterator __last)
+  {
+    lines = 0;
+
+    for (; __first != __last; lines += (*__first != '\n' ? 0 : 1), ++__first)
+      {
+        if (! pp_isalnum (*__first) && *__first != '_')
+          break;
+      }
+
+    return __first;
+  }
+};
+
+struct pp_skip_number
+{
+  int lines;
+
+  template <typename _InputIterator>
+  _InputIterator operator () (_InputIterator __first, _InputIterator __last)
+  {
+    lines = 0;
+
+    for (; __first != __last; lines += (*__first != '\n' ? 0 : 1), ++__first)
+      {
+        if (! pp_isalnum (*__first) && *__first != '.')
+          break;
+      }
+
+    return __first;
+  }
+};
+
+struct pp_skip_string_literal
+{
+  int lines;
+
+  template <typename _InputIterator>
+  _InputIterator operator () (_InputIterator __first, _InputIterator __last)
+  {
+    enum {
+      BEGIN,
+      IN_STRING,
+      QUOTE,
+      END
+    } state (BEGIN);
+
+    lines = 0;
+
+    for (; __first != __last; lines += (*__first != '\n' ? 0 : 1), ++__first)
+      {
+        switch (state)
+          {
+            default:
+              assert (0);
+              break;
+
+            case BEGIN:
+              if (*__first != '\"')
+                return __first;
+              state = IN_STRING;
+              break;
+
+            case IN_STRING:
+              assert (*__first != '\n');
+
+              if (*__first == '\"')
+                state = END;
+              else if (*__first == '\\')
+                state = QUOTE;
+              break;
+
+            case QUOTE:
+              state = IN_STRING;
+              break;
+
+            case END:
+              return __first;
+          }
+      }
+
+    return __first;
+  }
+};
+
+struct pp_skip_char_literal
+{
+  int lines;
+
+  template <typename _InputIterator>
+  _InputIterator operator () (_InputIterator __first, _InputIterator __last)
+  {
+    enum {
+      BEGIN,
+      IN_STRING,
+      QUOTE,
+      END
+    } state (BEGIN);
+
+    lines = 0;
+
+    for (; state != END && __first != __last; lines += (*__first != '\n' ? 0 : 1), ++__first)
+      {
+        switch (state)
+          {
+            default:
+              assert (0);
+              break;
+
+            case BEGIN:
+              if (*__first != '\'')
+                return __first;
+              state = IN_STRING;
+              break;
+
+            case IN_STRING:
+              assert (*__first != '\n');
+
+              if (*__first == '\'')
+                state = END;
+              else if (*__first == '\\')
+                state = QUOTE;
+              break;
+
+            case QUOTE:
+              state = IN_STRING;
+              break;
+          }
+      }
+
+    return __first;
+  }
+};
+
+struct pp_skip_argument
+{
+  pp_skip_identifier skip_number;
+  pp_skip_identifier skip_identifier;
+  pp_skip_string_literal skip_string_literal;
+  pp_skip_char_literal skip_char_literal;
+  pp_skip_comment_or_divop skip_comment_or_divop;
+  int lines;
+
+  template <typename _InputIterator>
+  _InputIterator operator () (_InputIterator __first, _InputIterator __last)
+  {
+    int depth = 0;
+    lines = 0;
+
+    while (__first != __last)
+      {
+        if (!depth && (*__first == ')' || *__first == ','))
+          break;
+        else if (*__first == '(')
+          ++depth, ++__first;
+        else if (*__first == ')')
+          --depth, ++__first;
+        else if (*__first == '\"')
+          {
+            __first = skip_string_literal (__first, __last);
+            lines += skip_string_literal.lines;
+          }
+        else if (*__first == '\'')
+          {
+            __first = skip_char_literal (__first, __last);
+            lines += skip_char_literal.lines;
+          }
+        else if (*__first == '/')
+          {
+            __first = skip_comment_or_divop (__first, __last);
+            lines += skip_comment_or_divop.lines;
+          }
+        else if (pp_isalpha (*__first) || *__first == '_')
+          {
+            __first = skip_identifier (__first, __last);
+            lines += skip_identifier.lines;
+          }
+        else if (pp_isdigit (*__first))
+          {
+            __first = skip_number (__first, __last);
+            lines += skip_number.lines;
+          }
+        else if (*__first == '\n')
+          {
+            ++__first;
+            ++lines;
+          }
+        else
+          ++__first;
+      }
+
+    return __first;
+  }
+};
+
+} // namespace rpp
+
+#endif // PP_SCANNER_H
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/rpp/pp-string.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,114 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+** Copyright 2005 Roberto Raggi <roberto@kdevelop.org>
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#ifndef PP_STRING_H
+#define PP_STRING_H
+
+namespace rpp {
+
+template <typename _CharT>
+class pp_string
+{
+  typedef std::char_traits<_CharT> traits_type;
+  typedef std::size_t size_type;
+
+  _CharT const *_M_begin;
+  std::size_t _M_size;
+
+public:
+  inline pp_string ():
+    _M_begin (0), _M_size(0) {}
+
+  explicit pp_string (std::string const &__s):
+    _M_begin (__s.c_str ()), _M_size (__s.size ()) {}
+
+  inline pp_string (_CharT const *__begin, std::size_t __size):
+    _M_begin (__begin), _M_size (__size) {}
+
+  inline _CharT const *begin () const { return _M_begin; }
+  inline _CharT const *end () const { return _M_begin + _M_size; }
+
+  inline _CharT at (std::size_t index) const { return _M_begin [index]; }
+
+  inline std::size_t size () const { return _M_size; }
+
+  inline int compare (pp_string const &__other) const
+  {
+    size_type const __size = this->size();
+    size_type const __osize = __other.size();
+    size_type const __len = std::min (__size,  __osize);
+
+    int __r = traits_type::compare (_M_begin, __other._M_begin, __len);
+    if (!__r)
+        __r =  (int) (__size - __osize);
+
+    return __r;
+  }
+
+  inline bool operator == (pp_string const &__other) const
+  { return compare (__other) == 0; }
+
+  inline bool operator != (pp_string const &__other) const
+  { return compare (__other) != 0; }
+
+  inline bool operator < (pp_string const &__other) const
+  { return compare (__other) < 0; }
+
+  inline bool operator == (char const *s) const
+  {
+    std::size_t n = strlen (s);
+
+    if (n != _M_size)
+      return false;
+
+    return ! strncmp (_M_begin, s, n);
+  }
+
+  inline bool operator != (char const *s) const
+  { return ! operator == (s); }
+};
+
+} // namespace rpp
+
+#endif // PP_STRING_H
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/rpp/pp-symbol.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,102 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+** Copyright 2005 Roberto Raggi <roberto@kdevelop.org>
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#ifndef PP_SYMBOL_H
+#define PP_SYMBOL_H
+
+namespace rpp {
+
+class pp_symbol
+{
+  static rxx_allocator<char> &allocator_instance ()
+  {
+    static rxx_allocator<char>__allocator;
+    return __allocator;
+  }
+
+public:
+  static int &N()
+  {
+    static int __N;
+    return __N;
+  }
+
+  static pp_fast_string const *get (char const *__data, std::size_t __size)
+  {
+    ++N();
+    char *data = allocator_instance ().allocate (__size + 1);
+    memcpy(data, __data, __size);
+    data[__size] = '\0';
+
+    char *where = allocator_instance ().allocate (sizeof (pp_fast_string));
+    return new (where) pp_fast_string (data, __size);
+  }
+
+  template <typename _InputIterator>
+  static pp_fast_string const *get (_InputIterator __first, _InputIterator __last)
+  {
+    ++N();
+    std::ptrdiff_t __size;
+#if defined(__SUNPRO_CC)
+    std::distance (__first, __last, __size);
+#else
+    __size = std::distance (__first, __last);
+#endif
+    assert (__size >= 0 && __size < 512);
+
+    char *data = allocator_instance ().allocate (__size + 1);
+    std::copy (__first, __last, data);
+    data[__size] = '\0';
+
+    char *where = allocator_instance ().allocate (sizeof (pp_fast_string));
+    return new (where) pp_fast_string (data, __size);
+  }
+
+  static pp_fast_string const *get(std::string const &__s)
+  { return get (__s.c_str (), __s.size ()); }
+};
+
+} // namespace rpp
+
+#endif // PP_SYMBOL_H
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/rpp/pp.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,108 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+** Copyright 2005 Roberto Raggi <roberto@kdevelop.org>
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#ifndef PP_H
+#define PP_H
+
+#if defined(_WIN64) || defined(WIN64) || defined(__WIN64__) \
+    || defined(_WIN32) || defined(WIN32) || defined(__WIN32__)
+#  define PP_OS_WIN
+#endif
+
+#include <set>
+#include <map>
+#include <vector>
+#include <string>
+#include <iterator>
+#include <iostream>
+#include <cassert>
+#include <cctype>
+
+#include <fcntl.h>
+
+#ifdef HAVE_MMAP
+#  include <sys/mman.h>
+#endif
+
+#include <sys/stat.h>
+#include <sys/types.h>
+
+#if (_MSC_VER >= 1400)
+#  define FILENO _fileno
+#else
+#  define FILENO fileno
+#endif
+
+#if defined (PP_OS_WIN)
+#  define PATH_SEPARATOR '\\'
+#else
+#  define PATH_SEPARATOR '/'
+#endif
+
+#if defined (RPP_JAMBI)
+#  include "rxx_allocator.h"
+#else
+#  include "rpp-allocator.h"
+#endif
+
+#if defined (_MSC_VER)
+#  define pp_snprintf _snprintf
+#else
+#  define pp_snprintf snprintf
+#endif
+
+#include "pp-fwd.h"
+#include "pp-cctype.h"
+#include "pp-string.h"
+#include "pp-symbol.h"
+#include "pp-internal.h"
+#include "pp-iterator.h"
+#include "pp-macro.h"
+#include "pp-environment.h"
+#include "pp-scanner.h"
+#include "pp-macro-expander.h"
+#include "pp-engine.h"
+#include "pp-engine-bits.h"
+
+#endif // PP_H
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/rpp/preprocessor.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,177 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+** Copyright 2005 Harald Fernengel <harry@kdevelop.org>
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#include "preprocessor.h"
+
+#include <string>
+
+// register callback for include hooks
+static void includeFileHook(const std::string &, const std::string &, FILE *);
+
+#define PP_HOOK_ON_FILE_INCLUDED(A, B, C) includeFileHook(A, B, C)
+#include "pp.h"
+
+using namespace rpp;
+
+#include <QtCore/QtCore>
+
+class PreprocessorPrivate
+{
+public:
+    QByteArray result;
+    pp_environment env;
+    QStringList includePaths;
+
+    void initPP(pp &proc)
+    {
+        foreach(QString path, includePaths)
+            proc.push_include_path(path.toStdString());
+    }
+};
+
+QHash<QString, QStringList> includedFiles;
+
+void includeFileHook(const std::string &fileName, const std::string &filePath, FILE *)
+{
+    includedFiles[QString::fromStdString(fileName)].append(QString::fromStdString(filePath));
+}
+
+Preprocessor::Preprocessor()
+{
+    d = new PreprocessorPrivate;
+    includedFiles.clear();
+}
+
+Preprocessor::~Preprocessor()
+{
+    delete d;
+}
+
+void Preprocessor::processFile(const QString &fileName)
+{
+    pp proc(d->env);
+    d->initPP(proc);
+
+    d->result.reserve(d->result.size() + 20 * 1024);
+
+    d->result += "# 1 \"" + fileName.toLatin1() + "\"\n"; // ### REMOVE ME
+    proc.file(fileName.toLocal8Bit().constData(), std::back_inserter(d->result));
+}
+
+void Preprocessor::processString(const QByteArray &str)
+{
+    pp proc(d->env);
+    d->initPP(proc);
+
+    proc(str.begin(), str.end(), std::back_inserter(d->result));
+}
+
+QByteArray Preprocessor::result() const
+{
+    return d->result;
+}
+
+void Preprocessor::addIncludePaths(const QStringList &includePaths)
+{
+    d->includePaths += includePaths;
+}
+
+QStringList Preprocessor::macroNames() const
+{
+    QStringList macros;
+
+    pp_environment::const_iterator it = d->env.first_macro();
+    while (it != d->env.last_macro()) {
+        const pp_macro *m = *it;
+        macros += QString::fromLatin1(m->name->begin(), m->name->size());
+        ++it;
+    }
+
+    return macros;
+}
+
+QList<Preprocessor::MacroItem> Preprocessor::macros() const
+{
+    QList<MacroItem> items;
+
+    pp_environment::const_iterator it = d->env.first_macro();
+    while (it != d->env.last_macro()) {
+        const pp_macro *m = *it;
+        MacroItem item;
+        item.name = QString::fromLatin1(m->name->begin(), m->name->size());
+        item.definition = QString::fromLatin1(m->definition->begin(),
+                                              m->definition->size());
+        for (size_t i = 0; i < m->formals.size(); ++i) {
+            item.parameters += QString::fromLatin1(m->formals[i]->begin(),
+                    m->formals[i]->size());
+        }
+        item.isFunctionLike = m->function_like;
+
+#ifdef PP_WITH_MACRO_POSITION
+        item.fileName = QString::fromLatin1(m->file->begin(), m->file->size());
+#endif
+        items += item;
+
+        ++it;
+    }
+
+    return items;
+}
+
+/*
+int main()
+{
+    Preprocessor pp;
+
+    QStringList paths;
+    paths << "/usr/include";
+    pp.addIncludePaths(paths);
+
+    pp.processFile("pp-configuration");
+    pp.processFile("/usr/include/stdio.h");
+
+    qDebug() << pp.result();
+
+    return 0;
+}
+*/
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/rpp/preprocessor.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,85 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+** Copyright 2005 Harald Fernengel <harry@kdevelop.org>
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#ifndef PREPROCESSOR_H
+#define PREPROCESSOR_H
+
+#include <QtCore/qglobal.h>
+#include <QtCore/qstring.h>
+#include <QtCore/qstringlist.h>
+
+class QByteArray;
+class PreprocessorPrivate;
+
+class Preprocessor
+{
+public:
+    Preprocessor();
+    ~Preprocessor();
+
+    void processFile(const QString &fileName);
+    void processString(const QByteArray &str);
+
+    void addIncludePaths(const QStringList &includePaths);
+
+    QByteArray result() const;
+
+    QStringList macroNames() const;
+
+    struct MacroItem
+    {
+        QString name;
+        QStringList parameters;
+        QString definition;
+        bool isFunctionLike;
+#ifdef PP_WITH_MACRO_POSITION
+        QString fileName;
+#endif
+    };
+    QList<MacroItem> macros() const;
+
+private:
+    Q_DISABLE_COPY(Preprocessor)
+    PreprocessorPrivate *d;
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/rpp/rpp.pri	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,20 @@
+SOURCES += \
+    $$RXXPATH/rpp/preprocessor.cpp
+
+HEADERS += \
+    $$RXXPATH/rpp/pp-cctype.h \
+    $$RXXPATH/rpp/pp-engine-bits.h \
+    $$RXXPATH/rpp/pp-engine.h \
+    $$RXXPATH/rpp/pp-environment.h \
+    $$RXXPATH/rpp/pp-fwd.h \
+    $$RXXPATH/rpp/pp-internal.h \
+    $$RXXPATH/rpp/pp-iterator.h \
+    $$RXXPATH/rpp/pp-macro-expander.h \
+    $$RXXPATH/rpp/pp-macro.h \
+    $$RXXPATH/rpp/pp-scanner.h \
+    $$RXXPATH/rpp/pp-string.h \
+    $$RXXPATH/rpp/pp-symbol.h \
+    $$RXXPATH/rpp/pp.h \
+    $$RXXPATH/rpp/preprocessor.h
+
+INCLUDEPATH += $$PWD $$RXXPATH/rpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/rxx.pri	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,48 @@
+
+isEmpty(RXXPATH):RXXPATH = $$PWD
+
+INCLUDEPATH += $$RXXPATH
+
+DEFINES += RXX_ALLOCATOR_INIT_0
+
+HEADERS += $$RXXPATH/ast.h \
+           $$RXXPATH/lexer.h \
+           $$RXXPATH/list.h \
+           $$RXXPATH/parser.h \
+           $$RXXPATH/rxx_allocator.h \
+           $$RXXPATH/rpp-allocator.h \
+           $$RXXPATH/smallobject.h \
+           $$RXXPATH/tokens.h \
+           $$RXXPATH/symbol.h \
+           $$RXXPATH/control.h \
+           $$RXXPATH/visitor.h \
+           $$RXXPATH/default_visitor.h \
+           $$RXXPATH/dumptree.h \
+           $$RXXPATH/binder.h \
+           $$RXXPATH/codemodel.h \
+           $$RXXPATH/codemodel_pointer.h \
+           $$RXXPATH/codemodel_fwd.h \
+           $$RXXPATH/type_compiler.h \
+           $$RXXPATH/name_compiler.h \
+           $$RXXPATH/declarator_compiler.h \
+           $$RXXPATH/class_compiler.h \
+           $$RXXPATH/codemodel_finder.h \
+           $$RXXPATH/compiler_utils.h
+SOURCES += $$RXXPATH/ast.cpp \
+           $$RXXPATH/lexer.cpp \
+           $$RXXPATH/list.cpp \
+           $$RXXPATH/parser.cpp \
+           $$RXXPATH/smallobject.cpp \
+           $$RXXPATH/control.cpp \
+           $$RXXPATH/visitor.cpp \
+           $$RXXPATH/default_visitor.cpp \
+           $$RXXPATH/dumptree.cpp \
+           $$RXXPATH/tokens.cpp \
+           $$RXXPATH/binder.cpp \
+           $$RXXPATH/codemodel.cpp \
+           $$RXXPATH/type_compiler.cpp \
+           $$RXXPATH/name_compiler.cpp \
+           $$RXXPATH/declarator_compiler.cpp \
+           $$RXXPATH/class_compiler.cpp \
+           $$RXXPATH/codemodel_finder.cpp \
+           $$RXXPATH/compiler_utils.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/rxx.pro	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,12 @@
+# File generated by kdevelop's qmake manager.
+# -------------------------------------------
+# Subdir relative project main directory: .
+# Target is an application:  r++0
+
+include(rxx.pri)
+SOURCES += main.cpp
+
+TEMPLATE = app
+QT = core
+TARGET = r++0
+CONFIG += debug_and_release
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/rxx_allocator.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,133 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+** Copyright (C) 2002-2005 Roberto Raggi <roberto@kdevelop.org>
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+
+#ifndef RXX_ALLOCATOR_H
+#define RXX_ALLOCATOR_H
+
+#include <cstddef>
+#include <cstdlib>
+#include <cstring>
+#include <memory>
+
+template <class _Tp> class rxx_allocator {
+public:
+  typedef _Tp value_type;
+  typedef _Tp* pointer;
+  typedef const _Tp* const_pointer;
+  typedef _Tp& reference;
+  typedef const _Tp& const_reference;
+  typedef std::size_t size_type;
+  typedef std::ptrdiff_t difference_type;
+
+  static const size_type max_block_count = size_type(-1);
+  static const size_type _S_block_size = 1 << 16; // 64K
+
+  rxx_allocator() {
+    _M_block_index = max_block_count;
+    _M_current_index = 0;
+    _M_storage = 0;
+    _M_current_block = 0;
+  }
+
+  ~rxx_allocator() {
+    for (size_type index = 0; index < _M_block_index + 1; ++index)
+      delete[] _M_storage[index];
+
+    ::free(_M_storage);
+  }
+
+  pointer address(reference __val) { return &__val; }
+  const_pointer address(const_reference __val) const { return &__val; }
+
+  pointer allocate(size_type __n, const void* = 0) {
+    const size_type bytes = __n * sizeof(_Tp);
+
+    if (_M_current_block == 0
+    || _S_block_size < _M_current_index + bytes)
+      {
+    ++_M_block_index;
+
+    _M_storage = reinterpret_cast<char**>
+      (::realloc(_M_storage, sizeof(char*) * (1 + _M_block_index)));
+
+    _M_current_block = _M_storage[_M_block_index] = reinterpret_cast<char*>
+      (new char[_S_block_size]);
+
+#if defined(RXX_ALLOCATOR_INIT_0) // ### make it a policy
+    ::memset(_M_current_block, 0, _S_block_size);
+#endif
+    _M_current_index = 0;
+      }
+
+    pointer p = reinterpret_cast<pointer>
+      (_M_current_block + _M_current_index);
+
+    _M_current_index += bytes;
+
+    return p;
+  }
+
+  void deallocate(pointer __p, size_type __n) {}
+
+  size_type max_size() const { return size_type(-1) / sizeof(_Tp); }
+
+  void contruct(pointer __p, const_reference __val) { new (__p) _Tp(__val); }
+  void destruct(pointer __p) { __p->~_Tp(); }
+
+private:
+  template <class _Tp1> struct rebind {
+    typedef rxx_allocator<_Tp1> other;
+  };
+
+  template <class _Tp1> rxx_allocator(const rxx_allocator<_Tp1> &__o) {}
+
+private:
+  size_type _M_block_index;
+  size_type _M_current_index;
+  char *_M_current_block;
+  char **_M_storage;
+};
+
+#endif // RXX_ALLOCATOR_H
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/smallobject.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,46 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+** Copyright (C) 2002-2005 Roberto Raggi <roberto@kdevelop.org>
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+
+#include "smallobject.h"
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/smallobject.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+** Copyright (C) 2002-2005 Roberto Raggi <roberto@kdevelop.org>
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+
+#ifndef SMALLOBJECT_H
+#define SMALLOBJECT_H
+
+#include "rxx_allocator.h"
+#include <cstring>
+
+class pool
+{
+  rxx_allocator<char> __alloc;
+
+public:
+  inline void *allocate(std::size_t __size);
+};
+
+inline void *pool::allocate(std::size_t __size)
+{
+  return __alloc.allocate(__size);
+}
+
+#endif
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/symbol.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,143 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+** Copyright (C) 2002-2005 Roberto Raggi <roberto@kdevelop.org>
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+
+#ifndef SYMBOL_H
+#define SYMBOL_H
+
+#include <QtCore/QString>
+#include <cstring>
+
+#include <QtCore/QHash>
+#include <QtCore/QPair>
+
+struct NameSymbol
+{
+  const char *data;
+  std::size_t count;
+
+  inline QString as_string() const
+  {
+    return QString::fromUtf8(data, (int) count);
+  }
+
+  inline bool operator == (const NameSymbol &other) const
+  {
+    return count == other.count
+      && std::strncmp(data, other.data, count) == 0;
+  }
+
+protected:
+  inline NameSymbol() {}
+  inline NameSymbol(const char *d, std::size_t c)
+    : data(d), count(c) {}
+
+private:
+  void operator = (const NameSymbol &);
+
+  friend class NameTable;
+};
+
+inline uint qHash(const NameSymbol &r)
+{
+  uint hash_value = 0;
+
+  for (std::size_t i=0; i<r.count; ++i)
+    hash_value = (hash_value << 5) - hash_value + r.data[i];
+
+  return hash_value;
+}
+
+inline uint qHash(const QPair<const char*, std::size_t> &r)
+{
+  uint hash_value = 0;
+
+  for (std::size_t i=0; i<r.second; ++i)
+    hash_value = (hash_value << 5) - hash_value + r.first[i];
+
+  return hash_value;
+}
+
+class NameTable
+{
+public:
+  typedef QPair<const char *, std::size_t> KeyType;
+  typedef QHash<KeyType, NameSymbol*> ContainerType;
+
+public:
+  NameTable() {}
+
+  ~NameTable()
+  {
+    qDeleteAll(_M_storage);
+  }
+
+  inline const NameSymbol *findOrInsert(const char *str, std::size_t len)
+  {
+    KeyType key(str, len);
+
+    NameSymbol *name = _M_storage.value(key);
+    if (!name)
+      {
+    name = new NameSymbol(str, len);
+    _M_storage.insert(key, name);
+      }
+
+    return name;
+  }
+
+  inline std::size_t count() const
+  {
+    return _M_storage.size();
+  }
+
+private:
+  ContainerType _M_storage;
+
+private:
+  NameTable(const NameTable &other);
+  void operator = (const NameTable &other);
+};
+
+#endif // SYMBOL_H
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/tokens.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,273 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+** Copyright (C) 2002-2005 Roberto Raggi <roberto@kdevelop.org>
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+
+#include <QtCore/qglobal.h>
+
+#include "tokens.h"
+
+static char const * const _S_token_names[] = {
+  "K_DCOP",
+  "Q_OBJECT",
+  "Q_PROPERTY",
+  "__attribute__",
+  "__typeof",
+  "and",
+  "and_eq",
+  "arrow",
+  "asm",
+  "assign",
+  "auto",
+  "bitand",
+  "bitor",
+  "bool",
+  "break",
+  "case",
+  "catch",
+  "char",
+  "char_literal",
+  "class",
+  "comment",
+  "compl",
+  "concat",
+  "const",
+  "const_cast",
+  "continue",
+  "decr",
+  "default",
+  "delete",
+  "do",
+  "double",
+  "dynamic_cast",
+  "ellipsis",
+  "else",
+  "emit",
+  "enum",
+  "eq",
+  "explicit",
+  "export",
+  "extern",
+  "false",
+  "float",
+  "for",
+  "friend",
+  "geq",
+  "goto",
+  "identifier",
+  "if",
+  "incr",
+  "inline",
+  "int",
+  "k_dcop",
+  "k_dcop_signals",
+  "leq",
+  "long",
+  "mutable",
+  "namespace",
+  "new",
+  "not",
+  "not_eq",
+  "number_literal",
+  "operator",
+  "or",
+  "or_eq",
+  "preproc",
+  "private",
+  "protected",
+  "ptrmem",
+  "public",
+  "register",
+  "reinterpret_cast",
+  "return",
+  "scope",
+  "shift",
+  "short",
+  "signals",
+  "signed",
+  "sizeof",
+  "slots",
+  "static",
+  "static_cast",
+  "string_literal",
+  "struct",
+  "switch",
+  "template",
+  "this",
+  "throw",
+  "true",
+  "try",
+  "typedef",
+  "typeid",
+  "typename",
+  "union",
+  "unsigned",
+  "using",
+  "virtual",
+  "void",
+  "volatile",
+  "wchar_t",
+  "while",
+  "whitespaces",
+  "xor",
+  "xor_eq",
+  "Q_ENUMS"
+};
+
+static char _S_printable[][2] = {
+  { char(32), '\0' },
+  { char(33), '\0' },
+  { char(34), '\0' },
+  { char(35), '\0' },
+  { char(36), '\0' },
+  { char(37), '\0' },
+  { char(38), '\0' },
+  { char(39), '\0' },
+  { char(40), '\0' },
+  { char(41), '\0' },
+  { char(42), '\0' },
+  { char(43), '\0' },
+  { char(44), '\0' },
+  { char(45), '\0' },
+  { char(46), '\0' },
+  { char(47), '\0' },
+  { char(48), '\0' },
+  { char(49), '\0' },
+  { char(50), '\0' },
+  { char(51), '\0' },
+  { char(52), '\0' },
+  { char(53), '\0' },
+  { char(54), '\0' },
+  { char(55), '\0' },
+  { char(56), '\0' },
+  { char(57), '\0' },
+  { char(58), '\0' },
+  { char(59), '\0' },
+  { char(60), '\0' },
+  { char(61), '\0' },
+  { char(62), '\0' },
+  { char(63), '\0' },
+  { char(64), '\0' },
+  { char(65), '\0' },
+  { char(66), '\0' },
+  { char(67), '\0' },
+  { char(68), '\0' },
+  { char(69), '\0' },
+  { char(70), '\0' },
+  { char(71), '\0' },
+  { char(72), '\0' },
+  { char(73), '\0' },
+  { char(74), '\0' },
+  { char(75), '\0' },
+  { char(76), '\0' },
+  { char(77), '\0' },
+  { char(78), '\0' },
+  { char(79), '\0' },
+  { char(80), '\0' },
+  { char(81), '\0' },
+  { char(82), '\0' },
+  { char(83), '\0' },
+  { char(84), '\0' },
+  { char(85), '\0' },
+  { char(86), '\0' },
+  { char(87), '\0' },
+  { char(88), '\0' },
+  { char(89), '\0' },
+  { char(90), '\0' },
+  { char(91), '\0' },
+  { char(92), '\0' },
+  { char(93), '\0' },
+  { char(94), '\0' },
+  { char(95), '\0' },
+  { char(96), '\0' },
+  { char(97), '\0' },
+  { char(98), '\0' },
+  { char(99), '\0' },
+  { char(100), '\0' },
+  { char(101), '\0' },
+  { char(102), '\0' },
+  { char(103), '\0' },
+  { char(104), '\0' },
+  { char(105), '\0' },
+  { char(106), '\0' },
+  { char(107), '\0' },
+  { char(108), '\0' },
+  { char(109), '\0' },
+  { char(110), '\0' },
+  { char(111), '\0' },
+  { char(112), '\0' },
+  { char(113), '\0' },
+  { char(114), '\0' },
+  { char(115), '\0' },
+  { char(116), '\0' },
+  { char(117), '\0' },
+  { char(118), '\0' },
+  { char(119), '\0' },
+  { char(120), '\0' },
+  { char(121), '\0' },
+  { char(122), '\0' },
+  { char(123), '\0' },
+  { char(124), '\0' },
+  { char(125), '\0' },
+  { char(126), '\0' },
+  { char(127), '\0' },
+};
+
+char const *token_name(int token)
+{
+  if (token == 0)
+    {
+      return "eof";
+    }
+  else if (token >= 32 && token <= 127)
+    {
+      return _S_printable[token - 32];
+    }
+  else if (token >= 1000)
+    {
+      return _S_token_names[token - 1000];
+    }
+
+  Q_ASSERT(0);
+  return 0;
+}
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/tokens.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,164 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+** Copyright (C) 2002-2005 Roberto Raggi <roberto@kdevelop.org>
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+
+#ifndef TOKENS_H
+#define TOKENS_H
+
+enum TOKEN_KIND
+{
+    Token_EOF = 0,
+
+    Token_K_DCOP = 1000,
+    Token_Q_OBJECT,
+    Token_Q_PROPERTY,
+    Token___attribute__,
+    Token___typeof,
+    Token_and,
+    Token_and_eq,
+    Token_arrow,
+    Token_asm,
+    Token_assign,
+    Token_auto,
+    Token_bitand,
+    Token_bitor,
+    Token_bool,
+    Token_break,
+    Token_case,
+    Token_catch,
+    Token_char,
+    Token_char_literal,
+    Token_class,
+    Token_comment,
+    Token_compl,
+    Token_concat,
+    Token_const,
+    Token_const_cast,
+    Token_continue,
+    Token_decr,
+    Token_default,
+    Token_delete,
+    Token_do,
+    Token_double,
+    Token_dynamic_cast,
+    Token_ellipsis,
+    Token_else,
+    Token_emit,
+    Token_enum,
+    Token_eq,
+    Token_explicit,
+    Token_export,
+    Token_extern,
+    Token_false,
+    Token_float,
+    Token_for,
+    Token_friend,
+    Token_geq,
+    Token_goto,
+    Token_identifier,
+    Token_if,
+    Token_incr,
+    Token_inline,
+    Token_int,
+    Token_k_dcop,
+    Token_k_dcop_signals,
+    Token_leq,
+    Token_long,
+    Token_mutable,
+    Token_namespace,
+    Token_new,
+    Token_not,
+    Token_not_eq,
+    Token_number_literal,
+    Token_operator,
+    Token_or,
+    Token_or_eq,
+    Token_preproc,
+    Token_private,
+    Token_protected,
+    Token_ptrmem,
+    Token_public,
+    Token_register,
+    Token_reinterpret_cast,
+    Token_return,
+    Token_scope,
+    Token_shift,
+    Token_short,
+    Token_signals,
+    Token_signed,
+    Token_sizeof,
+    Token_slots,
+    Token_static,
+    Token_static_cast,
+    Token_string_literal,
+    Token_struct,
+    Token_switch,
+    Token_template,
+    Token_this,
+    Token_throw,
+    Token_true,
+    Token_try,
+    Token_typedef,
+    Token_typeid,
+    Token_typename,
+    Token_union,
+    Token_unsigned,
+    Token_using,
+    Token_virtual,
+    Token_void,
+    Token_volatile,
+    Token_wchar_t,
+    Token_while,
+    Token_whitespaces,
+    Token_xor,
+    Token_xor_eq,
+    Token_Q_ENUMS,
+    Token_Q_INVOKABLE,
+
+    TOKEN_KIND_COUNT
+};
+
+char const *token_name(int token);
+
+#endif
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/type_compiler.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,156 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+** Copyright (C) 2002-2005 Roberto Raggi <roberto@kdevelop.org>
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+
+
+#include "type_compiler.h"
+#include "name_compiler.h"
+#include "lexer.h"
+#include "symbol.h"
+#include "tokens.h"
+#include "binder.h"
+
+#include <QtCore/QString>
+
+TypeCompiler::TypeCompiler(Binder *binder)
+  : _M_binder (binder), _M_token_stream(binder->tokenStream ())
+{
+}
+
+void TypeCompiler::run(TypeSpecifierAST *node)
+{
+  _M_type.clear();
+  _M_cv.clear();
+
+  visit(node);
+
+  if (node && node->cv)
+    {
+      const ListNode<std::size_t> *it = node->cv->toFront();
+      const ListNode<std::size_t> *end = it;
+      do
+        {
+          int kind = _M_token_stream->kind(it->element);
+          if (! _M_cv.contains(kind))
+            _M_cv.append(kind);
+
+          it = it->next;
+        }
+      while (it != end);
+    }
+}
+
+void TypeCompiler::visitClassSpecifier(ClassSpecifierAST *node)
+{
+  visit(node->name);
+}
+
+void TypeCompiler::visitEnumSpecifier(EnumSpecifierAST *node)
+{
+  visit(node->name);
+}
+
+void TypeCompiler::visitElaboratedTypeSpecifier(ElaboratedTypeSpecifierAST *node)
+{
+  visit(node->name);
+}
+
+void TypeCompiler::visitSimpleTypeSpecifier(SimpleTypeSpecifierAST *node)
+{
+  if (const ListNode<std::size_t> *it = node->integrals)
+    {
+      it = it->toFront();
+      const ListNode<std::size_t> *end = it;
+      QString current_item;
+      do
+        {
+          std::size_t token = it->element;
+          current_item += token_name(_M_token_stream->kind(token));
+          current_item += " ";
+          it = it->next;
+        }
+      while (it != end);
+      _M_type += current_item.trimmed();
+    }
+  else if (node->type_of)
+    {
+      // ### implement me
+      _M_type += QLatin1String("typeof<...>");
+    }
+
+  visit(node->name);
+}
+
+void TypeCompiler::visitName(NameAST *node)
+{
+  NameCompiler name_cc(_M_binder);
+  name_cc.run(node);
+  _M_type = name_cc.qualifiedName();
+}
+
+QStringList TypeCompiler::cvString() const
+{
+  QStringList lst;
+
+  foreach (int q, cv())
+    {
+      if (q == Token_const)
+        lst.append(QLatin1String("const"));
+      else if (q == Token_volatile)
+        lst.append(QLatin1String("volatile"));
+    }
+
+  return lst;
+}
+
+bool TypeCompiler::isConstant() const
+{
+  return _M_cv.contains(Token_const);
+}
+
+bool TypeCompiler::isVolatile() const
+{
+  return _M_cv.contains(Token_volatile);
+}
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/type_compiler.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,88 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+** Copyright (C) 2002-2005 Roberto Raggi <roberto@kdevelop.org>
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+
+#ifndef TYPE_COMPILER_H
+#define TYPE_COMPILER_H
+
+#include "default_visitor.h"
+
+#include <QtCore/QString>
+#include <QtCore/QStringList>
+#include <QtCore/QList>
+
+class TokenStream;
+class Binder;
+
+class TypeCompiler: protected DefaultVisitor
+{
+public:
+  TypeCompiler(Binder *binder);
+
+  inline QStringList qualifiedName() const { return _M_type; }
+  inline QList<int> cv() const { return _M_cv; }
+
+  bool isConstant() const;
+  bool isVolatile() const;
+
+  QStringList cvString() const;
+
+  void run(TypeSpecifierAST *node);
+
+protected:
+  virtual void visitClassSpecifier(ClassSpecifierAST *node);
+  virtual void visitEnumSpecifier(EnumSpecifierAST *node);
+  virtual void visitElaboratedTypeSpecifier(ElaboratedTypeSpecifierAST *node);
+  virtual void visitSimpleTypeSpecifier(SimpleTypeSpecifierAST *node);
+
+  virtual void visitName(NameAST *node);
+
+private:
+  Binder *_M_binder;
+  TokenStream *_M_token_stream;
+  QStringList _M_type;
+  QList<int> _M_cv;
+};
+
+#endif // TYPE_COMPILER_H
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/visitor.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,140 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+** Copyright (C) 2002-2005 Roberto Raggi <roberto@kdevelop.org>
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+
+#include "visitor.h"
+
+Visitor::visitor_fun_ptr Visitor::_S_table[AST::NODE_KIND_COUNT] = {
+  0,
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitAccessSpecifier),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitAsmDefinition),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitBaseClause),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitBaseSpecifier),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitBinaryExpression),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitCastExpression),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitClassMemberAccess),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitClassSpecifier),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitCompoundStatement),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitCondition),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitConditionalExpression),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitCppCastExpression),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitCtorInitializer),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitDeclarationStatement),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitDeclarator),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitDeleteExpression),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitDoStatement),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitElaboratedTypeSpecifier),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitEnumSpecifier),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitEnumerator),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitExceptionSpecification),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitExpressionOrDeclarationStatement),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitExpressionStatement),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitForStatement),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitFunctionCall),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitFunctionDefinition),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitIfStatement),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitIncrDecrExpression),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitInitDeclarator),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitInitializer),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitInitializerClause),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitLabeledStatement),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitLinkageBody),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitLinkageSpecification),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitMemInitializer),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitName),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitNamespace),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitNamespaceAliasDefinition),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitNewDeclarator),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitNewExpression),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitNewInitializer),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitNewTypeId),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitOperator),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitOperatorFunctionId),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitParameterDeclaration),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitParameterDeclarationClause),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitPostfixExpression),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitPrimaryExpression),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitPtrOperator),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitPtrToMember),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitReturnStatement),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitSimpleDeclaration),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitSimpleTypeSpecifier),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitSizeofExpression),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitStringLiteral),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitSubscriptExpression),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitSwitchStatement),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitTemplateArgument),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitTemplateDeclaration),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitTemplateParameter),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitThrowExpression),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitTranslationUnit),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitTryBlockStatement),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitTypeId),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitTypeIdentification),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitTypeParameter),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitTypedef),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitUnaryExpression),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitUnqualifiedName),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitUsing),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitUsingDirective),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitWhileStatement),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitWinDeclSpec),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitQProperty),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitForwardDeclarationSpecifier),
+  reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitQEnums)
+};
+
+Visitor::Visitor()
+{
+}
+
+Visitor::~Visitor()
+{
+}
+
+void Visitor::visit(AST *node)
+{
+  if (node)
+    (this->*_S_table[node->kind])(node);
+}
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/parser/visitor.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,160 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+** Copyright (C) 2002-2005 Roberto Raggi <roberto@kdevelop.org>
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+
+#ifndef VISITOR_H
+#define VISITOR_H
+
+#include "ast.h"
+
+class Visitor
+{
+public:
+  Visitor();
+  virtual ~Visitor();
+
+  virtual void visit(AST *node);
+
+protected:
+  virtual void visitAccessSpecifier(AccessSpecifierAST *) {}
+  virtual void visitAsmDefinition(AsmDefinitionAST *) {}
+  virtual void visitBaseClause(BaseClauseAST *) {}
+  virtual void visitBaseSpecifier(BaseSpecifierAST *) {}
+  virtual void visitBinaryExpression(BinaryExpressionAST *) {}
+  virtual void visitCastExpression(CastExpressionAST *) {}
+  virtual void visitClassMemberAccess(ClassMemberAccessAST *) {}
+  virtual void visitClassSpecifier(ClassSpecifierAST *) {}
+  virtual void visitCompoundStatement(CompoundStatementAST *) {}
+  virtual void visitCondition(ConditionAST *) {}
+  virtual void visitConditionalExpression(ConditionalExpressionAST *) {}
+  virtual void visitCppCastExpression(CppCastExpressionAST *) {}
+  virtual void visitCtorInitializer(CtorInitializerAST *) {}
+  virtual void visitDeclarationStatement(DeclarationStatementAST *) {}
+  virtual void visitDeclarator(DeclaratorAST *) {}
+  virtual void visitDeleteExpression(DeleteExpressionAST *) {}
+  virtual void visitDoStatement(DoStatementAST *) {}
+  virtual void visitElaboratedTypeSpecifier(ElaboratedTypeSpecifierAST *) {}
+  virtual void visitEnumSpecifier(EnumSpecifierAST *) {}
+  virtual void visitEnumerator(EnumeratorAST *) {}
+  virtual void visitExceptionSpecification(ExceptionSpecificationAST *) {}
+  virtual void visitExpressionOrDeclarationStatement(ExpressionOrDeclarationStatementAST *) {}
+  virtual void visitExpressionStatement(ExpressionStatementAST *) {}
+  virtual void visitForStatement(ForStatementAST *) {}
+  virtual void visitFunctionCall(FunctionCallAST *) {}
+  virtual void visitFunctionDefinition(FunctionDefinitionAST *) {}
+  virtual void visitIfStatement(IfStatementAST *) {}
+  virtual void visitIncrDecrExpression(IncrDecrExpressionAST *) {}
+  virtual void visitInitDeclarator(InitDeclaratorAST *) {}
+  virtual void visitInitializer(InitializerAST *) {}
+  virtual void visitInitializerClause(InitializerClauseAST *) {}
+  virtual void visitLabeledStatement(LabeledStatementAST *) {}
+  virtual void visitLinkageBody(LinkageBodyAST *) {}
+  virtual void visitLinkageSpecification(LinkageSpecificationAST *) {}
+  virtual void visitMemInitializer(MemInitializerAST *) {}
+  virtual void visitName(NameAST *) {}
+  virtual void visitNamespace(NamespaceAST *) {}
+  virtual void visitNamespaceAliasDefinition(NamespaceAliasDefinitionAST *) {}
+  virtual void visitNewDeclarator(NewDeclaratorAST *) {}
+  virtual void visitNewExpression(NewExpressionAST *) {}
+  virtual void visitNewInitializer(NewInitializerAST *) {}
+  virtual void visitNewTypeId(NewTypeIdAST *) {}
+  virtual void visitOperator(OperatorAST *) {}
+  virtual void visitOperatorFunctionId(OperatorFunctionIdAST *) {}
+  virtual void visitParameterDeclaration(ParameterDeclarationAST *) {}
+  virtual void visitParameterDeclarationClause(ParameterDeclarationClauseAST *) {}
+  virtual void visitPostfixExpression(PostfixExpressionAST *) {}
+  virtual void visitPrimaryExpression(PrimaryExpressionAST *) {}
+  virtual void visitPtrOperator(PtrOperatorAST *) {}
+  virtual void visitPtrToMember(PtrToMemberAST *) {}
+  virtual void visitReturnStatement(ReturnStatementAST *) {}
+  virtual void visitSimpleDeclaration(SimpleDeclarationAST *) {}
+  virtual void visitSimpleTypeSpecifier(SimpleTypeSpecifierAST *) {}
+  virtual void visitSizeofExpression(SizeofExpressionAST *) {}
+  virtual void visitStringLiteral(StringLiteralAST *) {}
+  virtual void visitSubscriptExpression(SubscriptExpressionAST *) {}
+  virtual void visitSwitchStatement(SwitchStatementAST *) {}
+  virtual void visitTemplateArgument(TemplateArgumentAST *) {}
+  virtual void visitTemplateDeclaration(TemplateDeclarationAST *) {}
+  virtual void visitTemplateParameter(TemplateParameterAST *) {}
+  virtual void visitThrowExpression(ThrowExpressionAST *) {}
+  virtual void visitTranslationUnit(TranslationUnitAST *) {}
+  virtual void visitTryBlockStatement(TryBlockStatementAST *) {}
+  virtual void visitTypeId(TypeIdAST *) {}
+  virtual void visitTypeIdentification(TypeIdentificationAST *) {}
+  virtual void visitTypeParameter(TypeParameterAST *) {}
+  virtual void visitTypedef(TypedefAST *) {}
+  virtual void visitUnaryExpression(UnaryExpressionAST *) {}
+  virtual void visitUnqualifiedName(UnqualifiedNameAST *) {}
+  virtual void visitUsing(UsingAST *) {}
+  virtual void visitUsingDirective(UsingDirectiveAST *) {}
+  virtual void visitWhileStatement(WhileStatementAST *) {}
+  virtual void visitWinDeclSpec(WinDeclSpecAST *) {}
+  virtual void visitQProperty(QPropertyAST *) {}
+  virtual void visitForwardDeclarationSpecifier(ForwardDeclarationSpecifierAST *) {}
+  virtual void visitQEnums(QEnumsAST *) {}
+
+private:
+  typedef void (Visitor::*visitor_fun_ptr)(AST *);
+  static visitor_fun_ptr _S_table[];
+};
+
+template <class _Tp>
+  void visitNodes(Visitor *v, const ListNode<_Tp> *nodes)
+  {
+    if (!nodes)
+      return;
+
+    const ListNode<_Tp>
+      *it = nodes->toFront(),
+      *end = it;
+
+    do
+      {
+        v->visit(it->element);
+        it = it->next;
+      }
+    while (it != end);
+  }
+
+#endif // VISITOR_H
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/prigenerator.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,83 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#include "prigenerator.h"
+#include "reporthandler.h"
+#include "fileout.h"
+
+void PriGenerator::addHeader(const QString &folder, const QString &header)
+{
+    priHash[folder].headers << header;
+}
+
+void PriGenerator::addSource(const QString &folder, const QString &source)
+{
+    priHash[folder].sources << source;
+}
+
+void PriGenerator::generate()
+{
+    QHashIterator<QString, Pri> pri(priHash);
+    while (pri.hasNext()) {
+        pri.next();
+
+        FileOut file(m_out_dir + "/cpp/" + pri.key());
+        file.stream << "HEADERS += \\\n";
+        QStringList list = pri.value().headers;
+        qSort(list.begin(), list.end());
+        foreach (const QString &entry, list) {
+            file.stream << "           $$PWD/" << entry << " \\\n";
+        }
+
+        file.stream << "\n";
+        file.stream << "SOURCES += \\\n";
+        list = pri.value().sources;
+        qSort(list.begin(), list.end());
+        foreach (const QString &entry, list) {
+            file.stream << "           $$PWD/" << entry << " \\\n";
+        }
+        file.stream << "\n\n";
+
+        if (file.done())
+            ++m_num_generated_written;
+        ++m_num_generated;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/prigenerator.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#ifndef PRIGENERATOR_H
+#define PRIGENERATOR_H
+
+#include "generator.h"
+
+#include <QStringList>
+#include <QHash>
+
+struct Pri
+{
+    QStringList headers;
+    QStringList sources;
+};
+
+class PriGenerator : public Generator
+{
+    Q_OBJECT
+
+ public:
+    virtual void generate();
+
+    void addHeader(const QString &folder, const QString &header);
+    void addSource(const QString &folder, const QString &source);
+
+ private:
+    QHash<QString, Pri> priHash;
+
+};
+#endif // PRIGENERATOR_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/qdocgenerator.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,338 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#include "qdocgenerator.h"
+
+#include "reporthandler.h"
+#include "typesystem.h"
+
+#include <QtCore/QDir>
+
+QDocGenerator::QDocGenerator() { }
+
+QString QDocGenerator::subDirectoryForClass(const AbstractMetaClass *) const
+{
+    return "doc/japi";
+}
+
+QString QDocGenerator::fileNameForClass(const AbstractMetaClass *) const
+{
+    return "qdoc.japi";
+}
+
+void QDocGenerator::generate()
+{
+    QDir dir(outputDirectory() + "/" + subDirectoryForClass(0));
+    dir.mkpath(dir.absolutePath());
+
+    QFile f(dir.absoluteFilePath(fileNameForClass(0)));
+    if (!f.open(QIODevice::WriteOnly)) {
+        ReportHandler::warning(QString("failed to open file '%1' for writing")
+            .arg(f.fileName()));
+        return;
+    }
+
+    {
+        QTextStream s(&f);
+        s << "<japi>" << endl;
+
+        AbstractMetaClassList clazzes = classes();
+        foreach (AbstractMetaClass *cls, clazzes) {
+            if (shouldGenerate(cls)) {
+                write(s, cls);
+            }
+        }
+
+        s << "</japi>" << endl;
+    }
+}
+
+// copy-paste from linguist/shared/metatranslator.cpp
+static QString numericEntity( int ch )
+{
+    return QString( ch <= 0x20 ? "<byte value=\"x%1\"/>" : "&#x%1;" )
+           .arg( ch, 0, 16 );
+}
+
+static QString protect( const QByteArray& str )
+{
+    QString result;
+    int len = (int) str.length();
+    for ( int k = 0; k < len; k++ ) {
+        switch( str[k] ) {
+        case '\"':
+            result += QString( "&quot;" );
+            break;
+        case '&':
+            result += QString( "&amp;" );
+            break;
+        case '>':
+            result += QString( "&gt;" );
+            break;
+        case '<':
+            result += QString( "&lt;" );
+            break;
+        case '\'':
+            result += QString( "&apos;" );
+            break;
+        default:
+            if ( (uchar) str[k] < 0x20 && str[k] != '\n' )
+                result += numericEntity( (uchar) str[k] );
+            else
+                result += str[k];
+        }
+    }
+    return result;
+}
+
+
+void QDocGenerator::write(QTextStream &s, const AbstractMetaFunction *java_function)
+{
+    AbstractMetaArgumentList arguments = java_function->arguments();
+    int argument_count = arguments.size();
+
+    int overload_count = 0;
+
+    for (int i=0; i<argument_count; ++i) {
+        if (!arguments.at(i)->defaultValueExpression().isEmpty())
+            ++overload_count;
+    }
+
+    for (int i=0; i<=overload_count; ++i) {
+        writeOverload(s, java_function, argument_count - i);
+    }
+}
+
+void QDocGenerator::writeOverload(QTextStream &s,
+                                  const AbstractMetaFunction *java_function,
+                                  int arg_count)
+{
+    if (java_function->isModifiedRemoved(TypeSystem::TargetLangCode))
+        return;
+
+    uint included_attributes = NoBlockedSlot;
+    uint excluded_attributes = 0;
+    setupForFunction(java_function, &included_attributes, &excluded_attributes);
+
+    if (arg_count < java_function->arguments().size()) {
+        // see DGenerator::writeFunctionOverloads()
+        if (!java_function->isConstructor())
+            included_attributes |= AbstractMetaAttributes::Final;
+        excluded_attributes |= AbstractMetaAttributes::Abstract | AbstractMetaAttributes::Native;
+    }
+
+    QString signature = functionSignature(java_function,
+                                          included_attributes,
+                                          excluded_attributes,
+                                          NoOption,
+                                          arg_count);
+
+    s << "<method java=\"" << protect(signature.toUtf8()) << "\"" << endl
+      << "        cpp=\"" << protect(java_function->signature().toUtf8()) << "\"" << endl;
+
+    FunctionModificationList mods = java_function->modifications(java_function->implementingClass());
+    QList<ArgumentModification> argumentMods;
+    foreach (const FunctionModification &m, mods) {
+        if (!m.association.isEmpty())
+            s << "        association=\"" << m.association << "\"" << endl;
+        if (m.modifiers & Modification::AccessModifierMask)
+            s << "        access-change=\"" << m.accessModifierString() << "\"" << endl;
+        if (m.modifiers & Modification::Rename)
+            s << "        renamed=\"" << m.renamedToName << "\"" << endl;
+        if (m.modifiers & (Modification::FinalMask)) {
+            s << "        final=\"" << ((m.modifiers & Modification::Final) ? "final" : "non-final")
+              << "\"" << endl;
+        }
+        if (m.modifiers & Modification::Deprecated)
+            s << "        deprecated=\"yes\"" << endl;
+        if (m.removal)
+            s << "        removal=\"" << m.removal << "\"" << endl;
+
+        argumentMods << m.argument_mods;
+    }
+
+    AbstractMetaArgumentList arguments = java_function->arguments();
+    bool wroteOwnershipStolen = false;
+    foreach (AbstractMetaArgument *argument, arguments) {
+        if (java_function->disabledGarbageCollection(java_function->implementingClass(),
+                                                     argument->argumentIndex() + 1)) {
+            if (!wroteOwnershipStolen) {
+                s << endl << "    steals-ownership-of=\"";
+                wroteOwnershipStolen = true;
+            } else {
+                s << ",";
+            }
+            s << protect(argument->argumentName().toUtf8());
+        }
+    }
+    if (wroteOwnershipStolen)
+        s << "\"";
+
+    s << ">" << endl;
+
+    if (argumentMods.size()) {
+
+        foreach (const ArgumentModification &m, argumentMods) {
+            s << "    <argument index=\"" << m.index << "\"" << endl;
+            if (m.removed_default_expression)
+                s << "              remove-default-expression=\"yes\"" << endl;
+            if (m.removed)
+                s << "              removed=\"yes\"" << endl;
+            if (m.no_null_pointers)
+                s << "              no-null=\"yes\"" << endl;
+            if (!m.modified_type.isEmpty())
+          s << "              modified-type=\"" << protect(m.modified_type.toLatin1()) << "\"" << endl;
+            if (!m.replaced_default_expression.isEmpty()) {
+                s << "              default-expression=\"" << m.replaced_default_expression
+                  << "\"" << endl;
+            }
+            if (!m.referenceCounts.isEmpty())
+                s << "              reference-counted=\"...\"" << endl;
+        s << "/>" << endl;
+        }
+    }
+
+    s << "</method>" << endl;
+}
+
+void QDocGenerator::write(QTextStream &s, const AbstractMetaEnumValue *java_enum_value)
+{
+    s << "<enum-value java=\"" << protect(java_enum_value->name().toUtf8()) << "\"" << endl
+      << "            cpp=\"" << protect(java_enum_value->name().toUtf8()) << "\"" << endl
+      << "            value=\"" << java_enum_value->value() << "\"/>" << endl;
+}
+
+void QDocGenerator::write(QTextStream &s, const AbstractMetaEnum *java_enum)
+{
+    s << "<enum java=\"" << protect(java_enum->name().toUtf8()) << "\"" << endl
+      << "      cpp=\"" << protect(java_enum->name().toUtf8()) << "\"" << endl;
+
+    if (java_enum->typeEntry()->flags()) {
+        s << "      flags=\"" << protect(java_enum->typeEntry()->flags()->targetLangName().toUtf8())
+          << "\"" << endl;
+    }
+
+    s << "      >" << endl;
+    AbstractMetaEnumValueList values = java_enum->values();
+    foreach (AbstractMetaEnumValue *value, values) {
+        write(s, value);
+    }
+    s << "</enum>" << endl;
+}
+
+void QDocGenerator::writeSignal(QTextStream &s, const AbstractMetaFunction *java_function)
+{
+    s << "<signal java=\""
+      << protect(java_function->targetLangSignature().toUtf8()) << "\" cpp=\""
+      << protect(java_function->signature().toUtf8()) << "\"/>" << endl;
+}
+
+void QDocGenerator::write(QTextStream &s, const AbstractMetaField *java_field)
+{
+    uint included_attributes = NoBlockedSlot;
+    uint excluded_attributes = 0;
+    setupForFunction(java_field->getter(), &included_attributes, &excluded_attributes);
+    s << "<variablegetter java=\"" << protect(functionSignature(java_field->getter(), included_attributes, excluded_attributes).toUtf8())
+      << "\"" << endl
+      << "    cpp=\"" << protect(java_field->name().toUtf8()) << "\" />" << endl;
+
+    included_attributes = NoBlockedSlot;
+    excluded_attributes = 0;
+    setupForFunction(java_field->setter(), &included_attributes, &excluded_attributes);
+    s << "<variablesetter java=\"" << protect(functionSignature(java_field->setter(), included_attributes, excluded_attributes).toUtf8())
+      << "\"" << endl
+      << "    cpp=\"" << protect(java_field->name().toUtf8()) << "\" />" << endl;
+}
+
+void QDocGenerator::write(QTextStream &s, const AbstractMetaClass *java_class)
+{
+    s << "<class" << endl
+      << "   java=\"" << protect(java_class->name().toUtf8()) << "\"" << endl
+      << "   cpp=\"" << protect(java_class->typeEntry()->qualifiedCppName().toUtf8()) << "\"" << endl
+      << "   java-extends=\"" << protect(java_class->baseClass() ? java_class->baseClass()->name().toUtf8() : "") << "\"" << endl
+      << "   package=\"" << protect(java_class->package().toUtf8()) << "\"" << endl;
+
+    AbstractMetaClassList interfaces = java_class->interfaces();
+    if (interfaces.count() > 0) {
+        s << "   javaimplements=\"";
+        for (int i=0; i<interfaces.count(); ++i) {
+            const AbstractMetaClass *interfaze = interfaces.at(i);
+            if (i > 0)
+                s << ",";
+            s << protect(interfaze->name().toUtf8());
+        }
+        s << "\"" << endl;
+    }
+
+    s << "   type=\"";
+    if (java_class->isInterface())
+        s << "interface";
+    else if (java_class->typeEntry()->isValue())
+        s << "value";
+    else
+        s << "object";
+    s << "\">" << endl;
+
+    // Write signals
+    AbstractMetaFunctionList sigs = java_class->queryFunctions(AbstractMetaClass::Signals);
+    foreach (AbstractMetaFunction *f, sigs)
+        writeSignal(s, f);
+
+    // Write functions
+    AbstractMetaFunctionList functions = java_class->functionsInTargetLang();
+    foreach (AbstractMetaFunction *f, functions) {
+        write(s, f);
+    }
+
+    // Write enums
+    AbstractMetaEnumList enums = java_class->enums();
+    foreach (AbstractMetaEnum *e, enums) {
+        write(s, e);
+    }
+
+    // Write setters and getters
+    AbstractMetaFieldList fields = java_class->fields();
+    foreach (AbstractMetaField *f, fields) {
+        write(s, f);
+    }
+
+    s << "</class>" << endl;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/qdocgenerator.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+*
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#ifndef QDOC_GENERATOR
+#define QDOC_GENERATOR
+
+#include "dgenerator.h"
+#include "metajava.h"
+
+class QDocGenerator: public DGenerator
+{
+public:
+    QDocGenerator();
+
+    virtual void generate();
+    virtual QString subDirectoryForClass(const AbstractMetaClass *java_class) const;
+    virtual QString fileNameForClass(const AbstractMetaClass *java_class) const;
+    virtual void write(QTextStream &s, const AbstractMetaClass *java_class);
+    virtual void write(QTextStream &s, const AbstractMetaEnumValue *java_enum_value);
+    virtual void write(QTextStream &s, const AbstractMetaEnum *java_enum);
+    virtual void writeOverload(QTextStream &s, const AbstractMetaFunction *java_function, int arg_count);
+    virtual void write(QTextStream &s, const AbstractMetaFunction *java_function);
+    virtual void write(QTextStream &s, const AbstractMetaField *java_field);
+    virtual void writeSignal(QTextStream &s, const AbstractMetaFunction *java_function);
+};
+
+#endif // QDOC_GENERATOR
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/qtjambi_masterinclude.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,1155 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#define QT_NO_STL
+#include <QtCore/QtCore>
+#include <QtGui/QtGui>
+#include <QtNetwork/QtNetwork>
+#include <QtSql/QtSql>
+#include <QtSvg/QtSvg>
+#include <QtXml/QtXml>
+
+#ifndef QT_NO_XMLPATTERNS
+#  include <QtXmlPatterns/QtXmlPatterns>
+#endif
+
+#ifndef QT_NO_WEBKIT
+#  include <QtWebKit/QtWebKit>
+#endif
+
+#ifndef QT_NO_PHONON
+#  include <phonon/phonon>
+#endif
+
+#include <../qtjambi_designer/designer.h>
+
+#include <../qtjambi_gui/qtreemodel.h>
+#include <../qtjambi_gui/qguisignalmapper.h>
+
+#include <../qtjambi_core/qtjambiconcurrent.h>
+
+#ifndef QT_NO_OPENGL
+#define GL_ACCUM                          0x0100
+#define GL_LOAD                           0x0101
+#define GL_RETURN                         0x0102
+#define GL_MULT                           0x0103
+#define GL_ADD                            0x0104
+
+/* AlphaFunction */
+#define GL_NEVER                          0x0200
+#define GL_LESS                           0x0201
+#define GL_EQUAL                          0x0202
+#define GL_LEQUAL                         0x0203
+#define GL_GREATER                        0x0204
+#define GL_NOTEQUAL                       0x0205
+#define GL_GEQUAL                         0x0206
+#define GL_ALWAYS                         0x0207
+
+/* AttribMask */
+#define GL_CURRENT_BIT                    0x00000001
+#define GL_POINT_BIT                      0x00000002
+#define GL_LINE_BIT                       0x00000004
+#define GL_POLYGON_BIT                    0x00000008
+#define GL_POLYGON_STIPPLE_BIT            0x00000010
+#define GL_PIXEL_MODE_BIT                 0x00000020
+#define GL_LIGHTING_BIT                   0x00000040
+#define GL_FOG_BIT                        0x00000080
+#define GL_DEPTH_BUFFER_BIT               0x00000100
+#define GL_ACCUM_BUFFER_BIT               0x00000200
+#define GL_STENCIL_BUFFER_BIT             0x00000400
+#define GL_VIEWPORT_BIT                   0x00000800
+#define GL_TRANSFORM_BIT                  0x00001000
+#define GL_ENABLE_BIT                     0x00002000
+#define GL_COLOR_BUFFER_BIT               0x00004000
+#define GL_HINT_BIT                       0x00008000
+#define GL_EVAL_BIT                       0x00010000
+#define GL_LIST_BIT                       0x00020000
+#define GL_TEXTURE_BIT                    0x00040000
+#define GL_SCISSOR_BIT                    0x00080000
+#define GL_ALL_ATTRIB_BITS                0x000fffff
+
+/* BeginMode */
+#define GL_POINTS                         0x0000
+#define GL_LINES                          0x0001
+#define GL_LINE_LOOP                      0x0002
+#define GL_LINE_STRIP                     0x0003
+#define GL_TRIANGLES                      0x0004
+#define GL_TRIANGLE_STRIP                 0x0005
+#define GL_TRIANGLE_FAN                   0x0006
+#define GL_QUADS                          0x0007
+#define GL_QUAD_STRIP                     0x0008
+#define GL_POLYGON                        0x0009
+
+/* BlendingFactorDest */
+#define GL_ZERO                           0
+#define GL_ONE                            1
+#define GL_SRC_COLOR                      0x0300
+#define GL_ONE_MINUS_SRC_COLOR            0x0301
+#define GL_SRC_ALPHA                      0x0302
+#define GL_ONE_MINUS_SRC_ALPHA            0x0303
+#define GL_DST_ALPHA                      0x0304
+#define GL_ONE_MINUS_DST_ALPHA            0x0305
+
+/* BlendingFactorSrc */
+/*      GL_ZERO */
+/*      GL_ONE */
+#define GL_DST_COLOR                      0x0306
+#define GL_ONE_MINUS_DST_COLOR            0x0307
+#define GL_SRC_ALPHA_SATURATE             0x0308
+/*      GL_SRC_ALPHA */
+/*      GL_ONE_MINUS_SRC_ALPHA */
+/*      GL_DST_ALPHA */
+/*      GL_ONE_MINUS_DST_ALPHA */
+
+/* Boolean */
+#define GL_TRUE                           1
+#define GL_FALSE                          0
+
+/* ClearBufferMask */
+/*      GL_COLOR_BUFFER_BIT */
+/*      GL_ACCUM_BUFFER_BIT */
+/*      GL_STENCIL_BUFFER_BIT */
+/*      GL_DEPTH_BUFFER_BIT */
+
+/* ClientArrayType */
+/*      GL_VERTEX_ARRAY */
+/*      GL_NORMAL_ARRAY */
+/*      GL_COLOR_ARRAY */
+/*      GL_INDEX_ARRAY */
+/*      GL_TEXTURE_COORD_ARRAY */
+/*      GL_EDGE_FLAG_ARRAY */
+
+/* ClipPlaneName */
+#define GL_CLIP_PLANE0                    0x3000
+#define GL_CLIP_PLANE1                    0x3001
+#define GL_CLIP_PLANE2                    0x3002
+#define GL_CLIP_PLANE3                    0x3003
+#define GL_CLIP_PLANE4                    0x3004
+#define GL_CLIP_PLANE5                    0x3005
+
+/* ColorMaterialFace */
+/*      GL_FRONT */
+/*      GL_BACK */
+/*      GL_FRONT_AND_BACK */
+
+/* ColorMaterialParameter */
+/*      GL_AMBIENT */
+/*      GL_DIFFUSE */
+/*      GL_SPECULAR */
+/*      GL_EMISSION */
+/*      GL_AMBIENT_AND_DIFFUSE */
+
+/* ColorPointerType */
+/*      GL_BYTE */
+/*      GL_UNSIGNED_BYTE */
+/*      GL_SHORT */
+/*      GL_UNSIGNED_SHORT */
+/*      GL_INT */
+/*      GL_UNSIGNED_INT */
+/*      GL_FLOAT */
+/*      GL_DOUBLE */
+
+/* CullFaceMode */
+/*      GL_FRONT */
+/*      GL_BACK */
+/*      GL_FRONT_AND_BACK */
+
+/* DataType */
+#define GL_BYTE                           0x1400
+#define GL_UNSIGNED_BYTE                  0x1401
+#define GL_SHORT                          0x1402
+#define GL_UNSIGNED_SHORT                 0x1403
+#define GL_INT                            0x1404
+#define GL_UNSIGNED_INT                   0x1405
+#define GL_FLOAT                          0x1406
+#define GL_2_BYTES                        0x1407
+#define GL_3_BYTES                        0x1408
+#define GL_4_BYTES                        0x1409
+#define GL_DOUBLE                         0x140A
+
+/* DepthFunction */
+/*      GL_NEVER */
+/*      GL_LESS */
+/*      GL_EQUAL */
+/*      GL_LEQUAL */
+/*      GL_GREATER */
+/*      GL_NOTEQUAL */
+/*      GL_GEQUAL */
+/*      GL_ALWAYS */
+
+/* DrawBufferMode */
+#define GL_NONE                           0
+#define GL_FRONT_LEFT                     0x0400
+#define GL_FRONT_RIGHT                    0x0401
+#define GL_BACK_LEFT                      0x0402
+#define GL_BACK_RIGHT                     0x0403
+#define GL_FRONT                          0x0404
+#define GL_BACK                           0x0405
+#define GL_LEFT                           0x0406
+#define GL_RIGHT                          0x0407
+#define GL_FRONT_AND_BACK                 0x0408
+#define GL_AUX0                           0x0409
+#define GL_AUX1                           0x040A
+#define GL_AUX2                           0x040B
+#define GL_AUX3                           0x040C
+
+/* Enable */
+/*      GL_FOG */
+/*      GL_LIGHTING */
+/*      GL_TEXTURE_1D */
+/*      GL_TEXTURE_2D */
+/*      GL_LINE_STIPPLE */
+/*      GL_POLYGON_STIPPLE */
+/*      GL_CULL_FACE */
+/*      GL_ALPHA_TEST */
+/*      GL_BLEND */
+/*      GL_INDEX_LOGIC_OP */
+/*      GL_COLOR_LOGIC_OP */
+/*      GL_DITHER */
+/*      GL_STENCIL_TEST */
+/*      GL_DEPTH_TEST */
+/*      GL_CLIP_PLANE0 */
+/*      GL_CLIP_PLANE1 */
+/*      GL_CLIP_PLANE2 */
+/*      GL_CLIP_PLANE3 */
+/*      GL_CLIP_PLANE4 */
+/*      GL_CLIP_PLANE5 */
+/*      GL_LIGHT0 */
+/*      GL_LIGHT1 */
+/*      GL_LIGHT2 */
+/*      GL_LIGHT3 */
+/*      GL_LIGHT4 */
+/*      GL_LIGHT5 */
+/*      GL_LIGHT6 */
+/*      GL_LIGHT7 */
+/*      GL_TEXTURE_GEN_S */
+/*      GL_TEXTURE_GEN_T */
+/*      GL_TEXTURE_GEN_R */
+/*      GL_TEXTURE_GEN_Q */
+/*      GL_MAP1_VERTEX_3 */
+/*      GL_MAP1_VERTEX_4 */
+/*      GL_MAP1_COLOR_4 */
+/*      GL_MAP1_INDEX */
+/*      GL_MAP1_NORMAL */
+/*      GL_MAP1_TEXTURE_COORD_1 */
+/*      GL_MAP1_TEXTURE_COORD_2 */
+/*      GL_MAP1_TEXTURE_COORD_3 */
+/*      GL_MAP1_TEXTURE_COORD_4 */
+/*      GL_MAP2_VERTEX_3 */
+/*      GL_MAP2_VERTEX_4 */
+/*      GL_MAP2_COLOR_4 */
+/*      GL_MAP2_INDEX */
+/*      GL_MAP2_NORMAL */
+/*      GL_MAP2_TEXTURE_COORD_1 */
+/*      GL_MAP2_TEXTURE_COORD_2 */
+/*      GL_MAP2_TEXTURE_COORD_3 */
+/*      GL_MAP2_TEXTURE_COORD_4 */
+/*      GL_POINT_SMOOTH */
+/*      GL_LINE_SMOOTH */
+/*      GL_POLYGON_SMOOTH */
+/*      GL_SCISSOR_TEST */
+/*      GL_COLOR_MATERIAL */
+/*      GL_NORMALIZE */
+/*      GL_AUTO_NORMAL */
+/*      GL_VERTEX_ARRAY */
+/*      GL_NORMAL_ARRAY */
+/*      GL_COLOR_ARRAY */
+/*      GL_INDEX_ARRAY */
+/*      GL_TEXTURE_COORD_ARRAY */
+/*      GL_EDGE_FLAG_ARRAY */
+/*      GL_POLYGON_OFFSET_POINT */
+/*      GL_POLYGON_OFFSET_LINE */
+/*      GL_POLYGON_OFFSET_FILL */
+
+/* ErrorCode */
+#define GL_NO_ERROR                       0
+#define GL_INVALID_ENUM                   0x0500
+#define GL_INVALID_VALUE                  0x0501
+#define GL_INVALID_OPERATION              0x0502
+#define GL_STACK_OVERFLOW                 0x0503
+#define GL_STACK_UNDERFLOW                0x0504
+#define GL_OUT_OF_MEMORY                  0x0505
+
+/* FeedBackMode */
+#define GL_2D                             0x0600
+#define GL_3D                             0x0601
+#define GL_3D_COLOR                       0x0602
+#define GL_3D_COLOR_TEXTURE               0x0603
+#define GL_4D_COLOR_TEXTURE               0x0604
+
+/* FeedBackToken */
+#define GL_PASS_THROUGH_TOKEN             0x0700
+#define GL_POINT_TOKEN                    0x0701
+#define GL_LINE_TOKEN                     0x0702
+#define GL_POLYGON_TOKEN                  0x0703
+#define GL_BITMAP_TOKEN                   0x0704
+#define GL_DRAW_PIXEL_TOKEN               0x0705
+#define GL_COPY_PIXEL_TOKEN               0x0706
+#define GL_LINE_RESET_TOKEN               0x0707
+
+/* FogMode */
+/*      GL_LINEAR */
+#define GL_EXP                            0x0800
+#define GL_EXP2                           0x0801
+
+
+/* FogParameter */
+/*      GL_FOG_COLOR */
+/*      GL_FOG_DENSITY */
+/*      GL_FOG_END */
+/*      GL_FOG_INDEX */
+/*      GL_FOG_MODE */
+/*      GL_FOG_START */
+
+/* FrontFaceDirection */
+#define GL_CW                             0x0900
+#define GL_CCW                            0x0901
+
+/* GetMapTarget */
+#define GL_COEFF                          0x0A00
+#define GL_ORDER                          0x0A01
+#define GL_DOMAIN                         0x0A02
+
+/* GetPixelMap */
+/*      GL_PIXEL_MAP_I_TO_I */
+/*      GL_PIXEL_MAP_S_TO_S */
+/*      GL_PIXEL_MAP_I_TO_R */
+/*      GL_PIXEL_MAP_I_TO_G */
+/*      GL_PIXEL_MAP_I_TO_B */
+/*      GL_PIXEL_MAP_I_TO_A */
+/*      GL_PIXEL_MAP_R_TO_R */
+/*      GL_PIXEL_MAP_G_TO_G */
+/*      GL_PIXEL_MAP_B_TO_B */
+/*      GL_PIXEL_MAP_A_TO_A */
+
+/* GetPointerTarget */
+/*      GL_VERTEX_ARRAY_POINTER */
+/*      GL_NORMAL_ARRAY_POINTER */
+/*      GL_COLOR_ARRAY_POINTER */
+/*      GL_INDEX_ARRAY_POINTER */
+/*      GL_TEXTURE_COORD_ARRAY_POINTER */
+/*      GL_EDGE_FLAG_ARRAY_POINTER */
+
+/* GetTarget */
+#define GL_CURRENT_COLOR                  0x0B00
+#define GL_CURRENT_INDEX                  0x0B01
+#define GL_CURRENT_NORMAL                 0x0B02
+#define GL_CURRENT_TEXTURE_COORDS         0x0B03
+#define GL_CURRENT_RASTER_COLOR           0x0B04
+#define GL_CURRENT_RASTER_INDEX           0x0B05
+#define GL_CURRENT_RASTER_TEXTURE_COORDS  0x0B06
+#define GL_CURRENT_RASTER_POSITION        0x0B07
+#define GL_CURRENT_RASTER_POSITION_VALID  0x0B08
+#define GL_CURRENT_RASTER_DISTANCE        0x0B09
+#define GL_POINT_SMOOTH                   0x0B10
+#define GL_POINT_SIZE                     0x0B11
+#define GL_POINT_SIZE_RANGE               0x0B12
+#define GL_POINT_SIZE_GRANULARITY         0x0B13
+#define GL_LINE_SMOOTH                    0x0B20
+#define GL_LINE_WIDTH                     0x0B21
+#define GL_LINE_WIDTH_RANGE               0x0B22
+#define GL_LINE_WIDTH_GRANULARITY         0x0B23
+#define GL_LINE_STIPPLE                   0x0B24
+#define GL_LINE_STIPPLE_PATTERN           0x0B25
+#define GL_LINE_STIPPLE_REPEAT            0x0B26
+#define GL_LIST_MODE                      0x0B30
+#define GL_MAX_LIST_NESTING               0x0B31
+#define GL_LIST_BASE                      0x0B32
+#define GL_LIST_INDEX                     0x0B33
+#define GL_POLYGON_MODE                   0x0B40
+#define GL_POLYGON_SMOOTH                 0x0B41
+#define GL_POLYGON_STIPPLE                0x0B42
+#define GL_EDGE_FLAG                      0x0B43
+#define GL_CULL_FACE                      0x0B44
+#define GL_CULL_FACE_MODE                 0x0B45
+#define GL_FRONT_FACE                     0x0B46
+#define GL_LIGHTING                       0x0B50
+#define GL_LIGHT_MODEL_LOCAL_VIEWER       0x0B51
+#define GL_LIGHT_MODEL_TWO_SIDE           0x0B52
+#define GL_LIGHT_MODEL_AMBIENT            0x0B53
+#define GL_SHADE_MODEL                    0x0B54
+#define GL_COLOR_MATERIAL_FACE            0x0B55
+#define GL_COLOR_MATERIAL_PARAMETER       0x0B56
+#define GL_COLOR_MATERIAL                 0x0B57
+#define GL_FOG                            0x0B60
+#define GL_FOG_INDEX                      0x0B61
+#define GL_FOG_DENSITY                    0x0B62
+#define GL_FOG_START                      0x0B63
+#define GL_FOG_END                        0x0B64
+#define GL_FOG_MODE                       0x0B65
+#define GL_FOG_COLOR                      0x0B66
+#define GL_DEPTH_RANGE                    0x0B70
+#define GL_DEPTH_TEST                     0x0B71
+#define GL_DEPTH_WRITEMASK                0x0B72
+#define GL_DEPTH_CLEAR_VALUE              0x0B73
+#define GL_DEPTH_FUNC                     0x0B74
+#define GL_ACCUM_CLEAR_VALUE              0x0B80
+#define GL_STENCIL_TEST                   0x0B90
+#define GL_STENCIL_CLEAR_VALUE            0x0B91
+#define GL_STENCIL_FUNC                   0x0B92
+#define GL_STENCIL_VALUE_MASK             0x0B93
+#define GL_STENCIL_FAIL                   0x0B94
+#define GL_STENCIL_PASS_DEPTH_FAIL        0x0B95
+#define GL_STENCIL_PASS_DEPTH_PASS        0x0B96
+#define GL_STENCIL_REF                    0x0B97
+#define GL_STENCIL_WRITEMASK              0x0B98
+#define GL_MATRIX_MODE                    0x0BA0
+#define GL_NORMALIZE                      0x0BA1
+#define GL_VIEWPORT                       0x0BA2
+#define GL_MODELVIEW_STACK_DEPTH          0x0BA3
+#define GL_PROJECTION_STACK_DEPTH         0x0BA4
+#define GL_TEXTURE_STACK_DEPTH            0x0BA5
+#define GL_MODELVIEW_MATRIX               0x0BA6
+#define GL_PROJECTION_MATRIX              0x0BA7
+#define GL_TEXTURE_MATRIX                 0x0BA8
+#define GL_ATTRIB_STACK_DEPTH             0x0BB0
+#define GL_CLIENT_ATTRIB_STACK_DEPTH      0x0BB1
+#define GL_ALPHA_TEST                     0x0BC0
+#define GL_ALPHA_TEST_FUNC                0x0BC1
+#define GL_ALPHA_TEST_REF                 0x0BC2
+#define GL_DITHER                         0x0BD0
+#define GL_BLEND_DST                      0x0BE0
+#define GL_BLEND_SRC                      0x0BE1
+#define GL_BLEND                          0x0BE2
+#define GL_LOGIC_OP_MODE                  0x0BF0
+#define GL_INDEX_LOGIC_OP                 0x0BF1
+#define GL_COLOR_LOGIC_OP                 0x0BF2
+#define GL_AUX_BUFFERS                    0x0C00
+#define GL_DRAW_BUFFER                    0x0C01
+#define GL_READ_BUFFER                    0x0C02
+#define GL_SCISSOR_BOX                    0x0C10
+#define GL_SCISSOR_TEST                   0x0C11
+#define GL_INDEX_CLEAR_VALUE              0x0C20
+#define GL_INDEX_WRITEMASK                0x0C21
+#define GL_COLOR_CLEAR_VALUE              0x0C22
+#define GL_COLOR_WRITEMASK                0x0C23
+#define GL_INDEX_MODE                     0x0C30
+#define GL_RGBA_MODE                      0x0C31
+#define GL_DOUBLEBUFFER                   0x0C32
+#define GL_STEREO                         0x0C33
+#define GL_RENDER_MODE                    0x0C40
+#define GL_PERSPECTIVE_CORRECTION_HINT    0x0C50
+#define GL_POINT_SMOOTH_HINT              0x0C51
+#define GL_LINE_SMOOTH_HINT               0x0C52
+#define GL_POLYGON_SMOOTH_HINT            0x0C53
+#define GL_FOG_HINT                       0x0C54
+#define GL_TEXTURE_GEN_S                  0x0C60
+#define GL_TEXTURE_GEN_T                  0x0C61
+#define GL_TEXTURE_GEN_R                  0x0C62
+#define GL_TEXTURE_GEN_Q                  0x0C63
+#define GL_PIXEL_MAP_I_TO_I               0x0C70
+#define GL_PIXEL_MAP_S_TO_S               0x0C71
+#define GL_PIXEL_MAP_I_TO_R               0x0C72
+#define GL_PIXEL_MAP_I_TO_G               0x0C73
+#define GL_PIXEL_MAP_I_TO_B               0x0C74
+#define GL_PIXEL_MAP_I_TO_A               0x0C75
+#define GL_PIXEL_MAP_R_TO_R               0x0C76
+#define GL_PIXEL_MAP_G_TO_G               0x0C77
+#define GL_PIXEL_MAP_B_TO_B               0x0C78
+#define GL_PIXEL_MAP_A_TO_A               0x0C79
+#define GL_PIXEL_MAP_I_TO_I_SIZE          0x0CB0
+#define GL_PIXEL_MAP_S_TO_S_SIZE          0x0CB1
+#define GL_PIXEL_MAP_I_TO_R_SIZE          0x0CB2
+#define GL_PIXEL_MAP_I_TO_G_SIZE          0x0CB3
+#define GL_PIXEL_MAP_I_TO_B_SIZE          0x0CB4
+#define GL_PIXEL_MAP_I_TO_A_SIZE          0x0CB5
+#define GL_PIXEL_MAP_R_TO_R_SIZE          0x0CB6
+#define GL_PIXEL_MAP_G_TO_G_SIZE          0x0CB7
+#define GL_PIXEL_MAP_B_TO_B_SIZE          0x0CB8
+#define GL_PIXEL_MAP_A_TO_A_SIZE          0x0CB9
+#define GL_UNPACK_SWAP_BYTES              0x0CF0
+#define GL_UNPACK_LSB_FIRST               0x0CF1
+#define GL_UNPACK_ROW_LENGTH              0x0CF2
+#define GL_UNPACK_SKIP_ROWS               0x0CF3
+#define GL_UNPACK_SKIP_PIXELS             0x0CF4
+#define GL_UNPACK_ALIGNMENT               0x0CF5
+#define GL_PACK_SWAP_BYTES                0x0D00
+#define GL_PACK_LSB_FIRST                 0x0D01
+#define GL_PACK_ROW_LENGTH                0x0D02
+#define GL_PACK_SKIP_ROWS                 0x0D03
+#define GL_PACK_SKIP_PIXELS               0x0D04
+#define GL_PACK_ALIGNMENT                 0x0D05
+#define GL_MAP_COLOR                      0x0D10
+#define GL_MAP_STENCIL                    0x0D11
+#define GL_INDEX_SHIFT                    0x0D12
+#define GL_INDEX_OFFSET                   0x0D13
+#define GL_RED_SCALE                      0x0D14
+#define GL_RED_BIAS                       0x0D15
+#define GL_ZOOM_X                         0x0D16
+#define GL_ZOOM_Y                         0x0D17
+#define GL_GREEN_SCALE                    0x0D18
+#define GL_GREEN_BIAS                     0x0D19
+#define GL_BLUE_SCALE                     0x0D1A
+#define GL_BLUE_BIAS                      0x0D1B
+#define GL_ALPHA_SCALE                    0x0D1C
+#define GL_ALPHA_BIAS                     0x0D1D
+#define GL_DEPTH_SCALE                    0x0D1E
+#define GL_DEPTH_BIAS                     0x0D1F
+#define GL_MAX_EVAL_ORDER                 0x0D30
+#define GL_MAX_LIGHTS                     0x0D31
+#define GL_MAX_CLIP_PLANES                0x0D32
+#define GL_MAX_TEXTURE_SIZE               0x0D33
+#define GL_MAX_PIXEL_MAP_TABLE            0x0D34
+#define GL_MAX_ATTRIB_STACK_DEPTH         0x0D35
+#define GL_MAX_MODELVIEW_STACK_DEPTH      0x0D36
+#define GL_MAX_NAME_STACK_DEPTH           0x0D37
+#define GL_MAX_PROJECTION_STACK_DEPTH     0x0D38
+#define GL_MAX_TEXTURE_STACK_DEPTH        0x0D39
+#define GL_MAX_VIEWPORT_DIMS              0x0D3A
+#define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH  0x0D3B
+#define GL_SUBPIXEL_BITS                  0x0D50
+#define GL_INDEX_BITS                     0x0D51
+#define GL_RED_BITS                       0x0D52
+#define GL_GREEN_BITS                     0x0D53
+#define GL_BLUE_BITS                      0x0D54
+#define GL_ALPHA_BITS                     0x0D55
+#define GL_DEPTH_BITS                     0x0D56
+#define GL_STENCIL_BITS                   0x0D57
+#define GL_ACCUM_RED_BITS                 0x0D58
+#define GL_ACCUM_GREEN_BITS               0x0D59
+#define GL_ACCUM_BLUE_BITS                0x0D5A
+#define GL_ACCUM_ALPHA_BITS               0x0D5B
+#define GL_NAME_STACK_DEPTH               0x0D70
+#define GL_AUTO_NORMAL                    0x0D80
+#define GL_MAP1_COLOR_4                   0x0D90
+#define GL_MAP1_INDEX                     0x0D91
+#define GL_MAP1_NORMAL                    0x0D92
+#define GL_MAP1_TEXTURE_COORD_1           0x0D93
+#define GL_MAP1_TEXTURE_COORD_2           0x0D94
+#define GL_MAP1_TEXTURE_COORD_3           0x0D95
+#define GL_MAP1_TEXTURE_COORD_4           0x0D96
+#define GL_MAP1_VERTEX_3                  0x0D97
+#define GL_MAP1_VERTEX_4                  0x0D98
+#define GL_MAP2_COLOR_4                   0x0DB0
+#define GL_MAP2_INDEX                     0x0DB1
+#define GL_MAP2_NORMAL                    0x0DB2
+#define GL_MAP2_TEXTURE_COORD_1           0x0DB3
+#define GL_MAP2_TEXTURE_COORD_2           0x0DB4
+#define GL_MAP2_TEXTURE_COORD_3           0x0DB5
+#define GL_MAP2_TEXTURE_COORD_4           0x0DB6
+#define GL_MAP2_VERTEX_3                  0x0DB7
+#define GL_MAP2_VERTEX_4                  0x0DB8
+#define GL_MAP1_GRID_DOMAIN               0x0DD0
+#define GL_MAP1_GRID_SEGMENTS             0x0DD1
+#define GL_MAP2_GRID_DOMAIN               0x0DD2
+#define GL_MAP2_GRID_SEGMENTS             0x0DD3
+#define GL_TEXTURE_1D                     0x0DE0
+#define GL_TEXTURE_2D                     0x0DE1
+#define GL_FEEDBACK_BUFFER_POINTER        0x0DF0
+#define GL_FEEDBACK_BUFFER_SIZE           0x0DF1
+#define GL_FEEDBACK_BUFFER_TYPE           0x0DF2
+#define GL_SELECTION_BUFFER_POINTER       0x0DF3
+#define GL_SELECTION_BUFFER_SIZE          0x0DF4
+/*      GL_TEXTURE_BINDING_1D */
+/*      GL_TEXTURE_BINDING_2D */
+/*      GL_VERTEX_ARRAY */
+/*      GL_NORMAL_ARRAY */
+/*      GL_COLOR_ARRAY */
+/*      GL_INDEX_ARRAY */
+/*      GL_TEXTURE_COORD_ARRAY */
+/*      GL_EDGE_FLAG_ARRAY */
+/*      GL_VERTEX_ARRAY_SIZE */
+/*      GL_VERTEX_ARRAY_TYPE */
+/*      GL_VERTEX_ARRAY_STRIDE */
+/*      GL_NORMAL_ARRAY_TYPE */
+/*      GL_NORMAL_ARRAY_STRIDE */
+/*      GL_COLOR_ARRAY_SIZE */
+/*      GL_COLOR_ARRAY_TYPE */
+/*      GL_COLOR_ARRAY_STRIDE */
+/*      GL_INDEX_ARRAY_TYPE */
+/*      GL_INDEX_ARRAY_STRIDE */
+/*      GL_TEXTURE_COORD_ARRAY_SIZE */
+/*      GL_TEXTURE_COORD_ARRAY_TYPE */
+/*      GL_TEXTURE_COORD_ARRAY_STRIDE */
+/*      GL_EDGE_FLAG_ARRAY_STRIDE */
+/*      GL_POLYGON_OFFSET_FACTOR */
+/*      GL_POLYGON_OFFSET_UNITS */
+
+/* GetTextureParameter */
+/*      GL_TEXTURE_MAG_FILTER */
+/*      GL_TEXTURE_MIN_FILTER */
+/*      GL_TEXTURE_WRAP_S */
+/*      GL_TEXTURE_WRAP_T */
+#define GL_TEXTURE_WIDTH                  0x1000
+#define GL_TEXTURE_HEIGHT                 0x1001
+#define GL_TEXTURE_INTERNAL_FORMAT        0x1003
+#define GL_TEXTURE_BORDER_COLOR           0x1004
+#define GL_TEXTURE_BORDER                 0x1005
+/*      GL_TEXTURE_RED_SIZE */
+/*      GL_TEXTURE_GREEN_SIZE */
+/*      GL_TEXTURE_BLUE_SIZE */
+/*      GL_TEXTURE_ALPHA_SIZE */
+/*      GL_TEXTURE_LUMINANCE_SIZE */
+/*      GL_TEXTURE_INTENSITY_SIZE */
+/*      GL_TEXTURE_PRIORITY */
+/*      GL_TEXTURE_RESIDENT */
+
+/* HintMode */
+#define GL_DONT_CARE                      0x1100
+#define GL_FASTEST                        0x1101
+#define GL_NICEST                         0x1102
+
+/* HintTarget */
+/*      GL_PERSPECTIVE_CORRECTION_HINT */
+/*      GL_POINT_SMOOTH_HINT */
+/*      GL_LINE_SMOOTH_HINT */
+/*      GL_POLYGON_SMOOTH_HINT */
+/*      GL_FOG_HINT */
+/*      GL_PHONG_HINT */
+
+/* IndexPointerType */
+/*      GL_SHORT */
+/*      GL_INT */
+/*      GL_FLOAT */
+/*      GL_DOUBLE */
+
+/* LightModelParameter */
+/*      GL_LIGHT_MODEL_AMBIENT */
+/*      GL_LIGHT_MODEL_LOCAL_VIEWER */
+/*      GL_LIGHT_MODEL_TWO_SIDE */
+
+/* LightName */
+#define GL_LIGHT0                         0x4000
+#define GL_LIGHT1                         0x4001
+#define GL_LIGHT2                         0x4002
+#define GL_LIGHT3                         0x4003
+#define GL_LIGHT4                         0x4004
+#define GL_LIGHT5                         0x4005
+#define GL_LIGHT6                         0x4006
+#define GL_LIGHT7                         0x4007
+
+/* LightParameter */
+#define GL_AMBIENT                        0x1200
+#define GL_DIFFUSE                        0x1201
+#define GL_SPECULAR                       0x1202
+#define GL_POSITION                       0x1203
+#define GL_SPOT_DIRECTION                 0x1204
+#define GL_SPOT_EXPONENT                  0x1205
+#define GL_SPOT_CUTOFF                    0x1206
+#define GL_CONSTANT_ATTENUATION           0x1207
+#define GL_LINEAR_ATTENUATION             0x1208
+#define GL_QUADRATIC_ATTENUATION          0x1209
+
+/* InterleavedArrays */
+/*      GL_V2F */
+/*      GL_V3F */
+/*      GL_C4UB_V2F */
+/*      GL_C4UB_V3F */
+/*      GL_C3F_V3F */
+/*      GL_N3F_V3F */
+/*      GL_C4F_N3F_V3F */
+/*      GL_T2F_V3F */
+/*      GL_T4F_V4F */
+/*      GL_T2F_C4UB_V3F */
+/*      GL_T2F_C3F_V3F */
+/*      GL_T2F_N3F_V3F */
+/*      GL_T2F_C4F_N3F_V3F */
+/*      GL_T4F_C4F_N3F_V4F */
+
+/* ListMode */
+#define GL_COMPILE                        0x1300
+#define GL_COMPILE_AND_EXECUTE            0x1301
+
+/* ListNameType */
+/*      GL_BYTE */
+/*      GL_UNSIGNED_BYTE */
+/*      GL_SHORT */
+/*      GL_UNSIGNED_SHORT */
+/*      GL_INT */
+/*      GL_UNSIGNED_INT */
+/*      GL_FLOAT */
+/*      GL_2_BYTES */
+/*      GL_3_BYTES */
+/*      GL_4_BYTES */
+
+/* LogicOp */
+#define GL_CLEAR                          0x1500
+#define GL_AND                            0x1501
+#define GL_AND_REVERSE                    0x1502
+#define GL_COPY                           0x1503
+#define GL_AND_INVERTED                   0x1504
+#define GL_NOOP                           0x1505
+#define GL_XOR                            0x1506
+#define GL_OR                             0x1507
+#define GL_NOR                            0x1508
+#define GL_EQUIV                          0x1509
+#define GL_INVERT                         0x150A
+#define GL_OR_REVERSE                     0x150B
+#define GL_COPY_INVERTED                  0x150C
+#define GL_OR_INVERTED                    0x150D
+#define GL_NAND                           0x150E
+#define GL_SET                            0x150F
+
+/* MapTarget */
+/*      GL_MAP1_COLOR_4 */
+/*      GL_MAP1_INDEX */
+/*      GL_MAP1_NORMAL */
+/*      GL_MAP1_TEXTURE_COORD_1 */
+/*      GL_MAP1_TEXTURE_COORD_2 */
+/*      GL_MAP1_TEXTURE_COORD_3 */
+/*      GL_MAP1_TEXTURE_COORD_4 */
+/*      GL_MAP1_VERTEX_3 */
+/*      GL_MAP1_VERTEX_4 */
+/*      GL_MAP2_COLOR_4 */
+/*      GL_MAP2_INDEX */
+/*      GL_MAP2_NORMAL */
+/*      GL_MAP2_TEXTURE_COORD_1 */
+/*      GL_MAP2_TEXTURE_COORD_2 */
+/*      GL_MAP2_TEXTURE_COORD_3 */
+/*      GL_MAP2_TEXTURE_COORD_4 */
+/*      GL_MAP2_VERTEX_3 */
+/*      GL_MAP2_VERTEX_4 */
+
+/* MaterialFace */
+/*      GL_FRONT */
+/*      GL_BACK */
+/*      GL_FRONT_AND_BACK */
+
+/* MaterialParameter */
+#define GL_EMISSION                       0x1600
+#define GL_SHININESS                      0x1601
+#define GL_AMBIENT_AND_DIFFUSE            0x1602
+#define GL_COLOR_INDEXES                  0x1603
+/*      GL_AMBIENT */
+/*      GL_DIFFUSE */
+/*      GL_SPECULAR */
+
+/* MatrixMode */
+#define GL_MODELVIEW                      0x1700
+#define GL_PROJECTION                     0x1701
+#define GL_TEXTURE                        0x1702
+
+/* MeshMode1 */
+/*      GL_POINT */
+/*      GL_LINE */
+
+/* MeshMode2 */
+/*      GL_POINT */
+/*      GL_LINE */
+/*      GL_FILL */
+
+/* NormalPointerType */
+/*      GL_BYTE */
+/*      GL_SHORT */
+/*      GL_INT */
+/*      GL_FLOAT */
+/*      GL_DOUBLE */
+
+/* PixelCopyType */
+#define GL_COLOR                          0x1800
+#define GL_DEPTH                          0x1801
+#define GL_STENCIL                        0x1802
+
+/* PixelFormat */
+#define GL_COLOR_INDEX                    0x1900
+#define GL_STENCIL_INDEX                  0x1901
+#define GL_DEPTH_COMPONENT                0x1902
+#define GL_RED                            0x1903
+#define GL_GREEN                          0x1904
+#define GL_BLUE                           0x1905
+#define GL_ALPHA                          0x1906
+#define GL_RGB                            0x1907
+#define GL_RGBA                           0x1908
+#define GL_LUMINANCE                      0x1909
+#define GL_LUMINANCE_ALPHA                0x190A
+
+/* PixelMap */
+/*      GL_PIXEL_MAP_I_TO_I */
+/*      GL_PIXEL_MAP_S_TO_S */
+/*      GL_PIXEL_MAP_I_TO_R */
+/*      GL_PIXEL_MAP_I_TO_G */
+/*      GL_PIXEL_MAP_I_TO_B */
+/*      GL_PIXEL_MAP_I_TO_A */
+/*      GL_PIXEL_MAP_R_TO_R */
+/*      GL_PIXEL_MAP_G_TO_G */
+/*      GL_PIXEL_MAP_B_TO_B */
+/*      GL_PIXEL_MAP_A_TO_A */
+
+/* PixelStore */
+/*      GL_UNPACK_SWAP_BYTES */
+/*      GL_UNPACK_LSB_FIRST */
+/*      GL_UNPACK_ROW_LENGTH */
+/*      GL_UNPACK_SKIP_ROWS */
+/*      GL_UNPACK_SKIP_PIXELS */
+/*      GL_UNPACK_ALIGNMENT */
+/*      GL_PACK_SWAP_BYTES */
+/*      GL_PACK_LSB_FIRST */
+/*      GL_PACK_ROW_LENGTH */
+/*      GL_PACK_SKIP_ROWS */
+/*      GL_PACK_SKIP_PIXELS */
+/*      GL_PACK_ALIGNMENT */
+
+/* PixelTransfer */
+/*      GL_MAP_COLOR */
+/*      GL_MAP_STENCIL */
+/*      GL_INDEX_SHIFT */
+/*      GL_INDEX_OFFSET */
+/*      GL_RED_SCALE */
+/*      GL_RED_BIAS */
+/*      GL_GREEN_SCALE */
+/*      GL_GREEN_BIAS */
+/*      GL_BLUE_SCALE */
+/*      GL_BLUE_BIAS */
+/*      GL_ALPHA_SCALE */
+/*      GL_ALPHA_BIAS */
+/*      GL_DEPTH_SCALE */
+/*      GL_DEPTH_BIAS */
+
+/* PixelType */
+#define GL_BITMAP                         0x1A00
+/*      GL_BYTE */
+/*      GL_UNSIGNED_BYTE */
+/*      GL_SHORT */
+/*      GL_UNSIGNED_SHORT */
+/*      GL_INT */
+/*      GL_UNSIGNED_INT */
+/*      GL_FLOAT */
+
+/* PolygonMode */
+#define GL_POINT                          0x1B00
+#define GL_LINE                           0x1B01
+#define GL_FILL                           0x1B02
+
+/* ReadBufferMode */
+/*      GL_FRONT_LEFT */
+/*      GL_FRONT_RIGHT */
+/*      GL_BACK_LEFT */
+/*      GL_BACK_RIGHT */
+/*      GL_FRONT */
+/*      GL_BACK */
+/*      GL_LEFT */
+/*      GL_RIGHT */
+/*      GL_AUX0 */
+/*      GL_AUX1 */
+/*      GL_AUX2 */
+/*      GL_AUX3 */
+
+/* RenderingMode */
+#define GL_RENDER                         0x1C00
+#define GL_FEEDBACK                       0x1C01
+#define GL_SELECT                         0x1C02
+
+/* ShadingModel */
+#define GL_FLAT                           0x1D00
+#define GL_SMOOTH                         0x1D01
+
+
+/* StencilFunction */
+/*      GL_NEVER */
+/*      GL_LESS */
+/*      GL_EQUAL */
+/*      GL_LEQUAL */
+/*      GL_GREATER */
+/*      GL_NOTEQUAL */
+/*      GL_GEQUAL */
+/*      GL_ALWAYS */
+
+/* StencilOp */
+/*      GL_ZERO */
+#define GL_KEEP                           0x1E00
+#define GL_REPLACE                        0x1E01
+#define GL_INCR                           0x1E02
+#define GL_DECR                           0x1E03
+/*      GL_INVERT */
+
+/* StringName */
+#define GL_VENDOR                         0x1F00
+#define GL_RENDERER                       0x1F01
+#define GL_VERSION                        0x1F02
+#define GL_EXTENSIONS                     0x1F03
+
+/* TextureCoordName */
+#define GL_S                              0x2000
+#define GL_T                              0x2001
+#define GL_R                              0x2002
+#define GL_Q                              0x2003
+
+/* TexCoordPointerType */
+/*      GL_SHORT */
+/*      GL_INT */
+/*      GL_FLOAT */
+/*      GL_DOUBLE */
+
+/* TextureEnvMode */
+#define GL_MODULATE                       0x2100
+#define GL_DECAL                          0x2101
+/*      GL_BLEND */
+/*      GL_REPLACE */
+
+/* TextureEnvParameter */
+#define GL_TEXTURE_ENV_MODE               0x2200
+#define GL_TEXTURE_ENV_COLOR              0x2201
+
+/* TextureEnvTarget */
+#define GL_TEXTURE_ENV                    0x2300
+
+/* TextureGenMode */
+#define GL_EYE_LINEAR                     0x2400
+#define GL_OBJECT_LINEAR                  0x2401
+#define GL_SPHERE_MAP                     0x2402
+
+/* TextureGenParameter */
+#define GL_TEXTURE_GEN_MODE               0x2500
+#define GL_OBJECT_PLANE                   0x2501
+#define GL_EYE_PLANE                      0x2502
+
+/* TextureMagFilter */
+#define GL_NEAREST                        0x2600
+#define GL_LINEAR                         0x2601
+
+/* TextureMinFilter */
+/*      GL_NEAREST */
+/*      GL_LINEAR */
+#define GL_NEAREST_MIPMAP_NEAREST         0x2700
+#define GL_LINEAR_MIPMAP_NEAREST          0x2701
+#define GL_NEAREST_MIPMAP_LINEAR          0x2702
+#define GL_LINEAR_MIPMAP_LINEAR           0x2703
+
+/* TextureParameterName */
+#define GL_TEXTURE_MAG_FILTER             0x2800
+#define GL_TEXTURE_MIN_FILTER             0x2801
+#define GL_TEXTURE_WRAP_S                 0x2802
+#define GL_TEXTURE_WRAP_T                 0x2803
+/*      GL_TEXTURE_BORDER_COLOR */
+/*      GL_TEXTURE_PRIORITY */
+
+/* TextureTarget */
+/*      GL_TEXTURE_1D */
+/*      GL_TEXTURE_2D */
+/*      GL_PROXY_TEXTURE_1D */
+/*      GL_PROXY_TEXTURE_2D */
+
+/* TextureWrapMode */
+#define GL_CLAMP                          0x2900
+#define GL_REPEAT                         0x2901
+
+/* VertexPointerType */
+/*      GL_SHORT */
+/*      GL_INT */
+/*      GL_FLOAT */
+/*      GL_DOUBLE */
+
+/* ClientAttribMask */
+#define GL_CLIENT_PIXEL_STORE_BIT         0x00000001
+#define GL_CLIENT_VERTEX_ARRAY_BIT        0x00000002
+#define GL_CLIENT_ALL_ATTRIB_BITS         0xffffffff
+
+/* polygon_offset */
+#define GL_POLYGON_OFFSET_FACTOR          0x8038
+#define GL_POLYGON_OFFSET_UNITS           0x2A00
+#define GL_POLYGON_OFFSET_POINT           0x2A01
+#define GL_POLYGON_OFFSET_LINE            0x2A02
+#define GL_POLYGON_OFFSET_FILL            0x8037
+
+/* texture */
+#define GL_ALPHA4                         0x803B
+#define GL_ALPHA8                         0x803C
+#define GL_ALPHA12                        0x803D
+#define GL_ALPHA16                        0x803E
+#define GL_LUMINANCE4                     0x803F
+#define GL_LUMINANCE8                     0x8040
+#define GL_LUMINANCE12                    0x8041
+#define GL_LUMINANCE16                    0x8042
+#define GL_LUMINANCE4_ALPHA4              0x8043
+#define GL_LUMINANCE6_ALPHA2              0x8044
+#define GL_LUMINANCE8_ALPHA8              0x8045
+#define GL_LUMINANCE12_ALPHA4             0x8046
+#define GL_LUMINANCE12_ALPHA12            0x8047
+#define GL_LUMINANCE16_ALPHA16            0x8048
+#define GL_INTENSITY                      0x8049
+#define GL_INTENSITY4                     0x804A
+#define GL_INTENSITY8                     0x804B
+#define GL_INTENSITY12                    0x804C
+#define GL_INTENSITY16                    0x804D
+#define GL_R3_G3_B2                       0x2A10
+#define GL_RGB4                           0x804F
+#define GL_RGB5                           0x8050
+#define GL_RGB8                           0x8051
+#define GL_RGB10                          0x8052
+#define GL_RGB12                          0x8053
+#define GL_RGB16                          0x8054
+#define GL_RGBA2                          0x8055
+#define GL_RGBA4                          0x8056
+#define GL_RGB5_A1                        0x8057
+#define GL_RGBA8                          0x8058
+#define GL_RGB10_A2                       0x8059
+#define GL_RGBA12                         0x805A
+#define GL_RGBA16                         0x805B
+#define GL_TEXTURE_RED_SIZE               0x805C
+#define GL_TEXTURE_GREEN_SIZE             0x805D
+#define GL_TEXTURE_BLUE_SIZE              0x805E
+#define GL_TEXTURE_ALPHA_SIZE             0x805F
+#define GL_TEXTURE_LUMINANCE_SIZE         0x8060
+#define GL_TEXTURE_INTENSITY_SIZE         0x8061
+#define GL_PROXY_TEXTURE_1D               0x8063
+#define GL_PROXY_TEXTURE_2D               0x8064
+
+/* texture_object */
+#define GL_TEXTURE_PRIORITY               0x8066
+#define GL_TEXTURE_RESIDENT               0x8067
+#define GL_TEXTURE_BINDING_1D             0x8068
+#define GL_TEXTURE_BINDING_2D             0x8069
+
+/* vertex_array */
+#define GL_VERTEX_ARRAY                   0x8074
+#define GL_NORMAL_ARRAY                   0x8075
+#define GL_COLOR_ARRAY                    0x8076
+#define GL_INDEX_ARRAY                    0x8077
+#define GL_TEXTURE_COORD_ARRAY            0x8078
+#define GL_EDGE_FLAG_ARRAY                0x8079
+#define GL_VERTEX_ARRAY_SIZE              0x807A
+#define GL_VERTEX_ARRAY_TYPE              0x807B
+#define GL_VERTEX_ARRAY_STRIDE            0x807C
+#define GL_NORMAL_ARRAY_TYPE              0x807E
+#define GL_NORMAL_ARRAY_STRIDE            0x807F
+#define GL_COLOR_ARRAY_SIZE               0x8081
+#define GL_COLOR_ARRAY_TYPE               0x8082
+#define GL_COLOR_ARRAY_STRIDE             0x8083
+#define GL_INDEX_ARRAY_TYPE               0x8085
+#define GL_INDEX_ARRAY_STRIDE             0x8086
+#define GL_TEXTURE_COORD_ARRAY_SIZE       0x8088
+#define GL_TEXTURE_COORD_ARRAY_TYPE       0x8089
+#define GL_TEXTURE_COORD_ARRAY_STRIDE     0x808A
+#define GL_EDGE_FLAG_ARRAY_STRIDE         0x808C
+#define GL_VERTEX_ARRAY_POINTER           0x808E
+#define GL_NORMAL_ARRAY_POINTER           0x808F
+#define GL_COLOR_ARRAY_POINTER            0x8090
+#define GL_INDEX_ARRAY_POINTER            0x8091
+#define GL_TEXTURE_COORD_ARRAY_POINTER    0x8092
+#define GL_EDGE_FLAG_ARRAY_POINTER        0x8093
+#define GL_V2F                            0x2A20
+#define GL_V3F                            0x2A21
+#define GL_C4UB_V2F                       0x2A22
+#define GL_C4UB_V3F                       0x2A23
+#define GL_C3F_V3F                        0x2A24
+#define GL_N3F_V3F                        0x2A25
+#define GL_C4F_N3F_V3F                    0x2A26
+#define GL_T2F_V3F                        0x2A27
+#define GL_T4F_V4F                        0x2A28
+#define GL_T2F_C4UB_V3F                   0x2A29
+#define GL_T2F_C3F_V3F                    0x2A2A
+#define GL_T2F_N3F_V3F                    0x2A2B
+#define GL_T2F_C4F_N3F_V3F                0x2A2C
+#define GL_T4F_C4F_N3F_V4F                0x2A2D
+
+/* Extensions */
+#define GL_EXT_vertex_array               1
+#define GL_EXT_bgra                       1
+#define GL_EXT_paletted_texture           1
+#define GL_WIN_swap_hint                  1
+#define GL_WIN_draw_range_elements        1
+// #define GL_WIN_phong_shading              1
+// #define GL_WIN_specular_fog               1
+
+/* EXT_vertex_array */
+#define GL_VERTEX_ARRAY_EXT               0x8074
+#define GL_NORMAL_ARRAY_EXT               0x8075
+#define GL_COLOR_ARRAY_EXT                0x8076
+#define GL_INDEX_ARRAY_EXT                0x8077
+#define GL_TEXTURE_COORD_ARRAY_EXT        0x8078
+#define GL_EDGE_FLAG_ARRAY_EXT            0x8079
+#define GL_VERTEX_ARRAY_SIZE_EXT          0x807A
+#define GL_VERTEX_ARRAY_TYPE_EXT          0x807B
+#define GL_VERTEX_ARRAY_STRIDE_EXT        0x807C
+#define GL_VERTEX_ARRAY_COUNT_EXT         0x807D
+#define GL_NORMAL_ARRAY_TYPE_EXT          0x807E
+#define GL_NORMAL_ARRAY_STRIDE_EXT        0x807F
+#define GL_NORMAL_ARRAY_COUNT_EXT         0x8080
+#define GL_COLOR_ARRAY_SIZE_EXT           0x8081
+#define GL_COLOR_ARRAY_TYPE_EXT           0x8082
+#define GL_COLOR_ARRAY_STRIDE_EXT         0x8083
+#define GL_COLOR_ARRAY_COUNT_EXT          0x8084
+#define GL_INDEX_ARRAY_TYPE_EXT           0x8085
+#define GL_INDEX_ARRAY_STRIDE_EXT         0x8086
+#define GL_INDEX_ARRAY_COUNT_EXT          0x8087
+#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT   0x8088
+#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT   0x8089
+#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A
+#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT  0x808B
+#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT     0x808C
+#define GL_EDGE_FLAG_ARRAY_COUNT_EXT      0x808D
+#define GL_VERTEX_ARRAY_POINTER_EXT       0x808E
+#define GL_NORMAL_ARRAY_POINTER_EXT       0x808F
+#define GL_COLOR_ARRAY_POINTER_EXT        0x8090
+#define GL_INDEX_ARRAY_POINTER_EXT        0x8091
+#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092
+#define GL_EDGE_FLAG_ARRAY_POINTER_EXT    0x8093
+#define GL_DOUBLE_EXT                     GL_DOUBLE
+
+/* EXT_bgra */
+#define GL_BGR_EXT                        0x80E0
+#define GL_BGRA_EXT                       0x80E1
+
+/* EXT_paletted_texture */
+
+/* These must match the GL_COLOR_TABLE_*_SGI enumerants */
+#define GL_COLOR_TABLE_FORMAT_EXT         0x80D8
+#define GL_COLOR_TABLE_WIDTH_EXT          0x80D9
+#define GL_COLOR_TABLE_RED_SIZE_EXT       0x80DA
+#define GL_COLOR_TABLE_GREEN_SIZE_EXT     0x80DB
+#define GL_COLOR_TABLE_BLUE_SIZE_EXT      0x80DC
+#define GL_COLOR_TABLE_ALPHA_SIZE_EXT     0x80DD
+#define GL_COLOR_TABLE_LUMINANCE_SIZE_EXT 0x80DE
+#define GL_COLOR_TABLE_INTENSITY_SIZE_EXT 0x80DF
+
+#define GL_COLOR_INDEX1_EXT               0x80E2
+#define GL_COLOR_INDEX2_EXT               0x80E3
+#define GL_COLOR_INDEX4_EXT               0x80E4
+#define GL_COLOR_INDEX8_EXT               0x80E5
+#define GL_COLOR_INDEX12_EXT              0x80E6
+#define GL_COLOR_INDEX16_EXT              0x80E7
+
+/* WIN_draw_range_elements */
+#define GL_MAX_ELEMENTS_VERTICES_WIN      0x80E8
+#define GL_MAX_ELEMENTS_INDICES_WIN       0x80E9
+
+/* WIN_phong_shading */
+#define GL_PHONG_WIN                      0x80EA
+#define GL_PHONG_HINT_WIN                 0x80EB
+
+/* WIN_specular_fog */
+#define GL_FOG_SPECULAR_TEXTURE_WIN       0x80EC
+
+/* For compatibility with OpenGL v1.0 */
+#define GL_LOGIC_OP GL_INDEX_LOGIC_OP
+#define GL_TEXTURE_COMPONENTS GL_TEXTURE_INTERNAL_FORMAT
+#include <QtOpenGL/QtOpenGL>
+#endif // QT_NO_OPENGL
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/reporthandler.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#include "reporthandler.h"
+#include "typesystem.h"
+
+int ReportHandler::m_warning_count = 0;
+int ReportHandler::m_suppressed_count = 0;
+QString ReportHandler::m_context;
+ReportHandler::DebugLevel ReportHandler::m_debug_level = NoDebug;
+QSet<QString> ReportHandler::m_reported_warnings;
+
+
+void ReportHandler::warning(const QString &text)
+{
+    QString warningText = QString("WARNING(%1) :: %2").arg(m_context).arg(text);
+
+    TypeDatabase *db = TypeDatabase::instance();
+    if (db && db->isSuppressedWarning(warningText)) {
+        ++m_suppressed_count;
+    } else if (!m_reported_warnings.contains(warningText)) {
+        qDebug(qPrintable(warningText));
+        ++m_warning_count;
+
+        m_reported_warnings.insert(warningText);
+    }
+}
+
+void ReportHandler::debug(DebugLevel level, const QString &text)
+{
+    if (m_debug_level == NoDebug)
+        return;
+
+    if (level <= m_debug_level)
+        qDebug(" - DEBUG(%s) :: %s", qPrintable(m_context), qPrintable(text));
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/reporthandler.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,83 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#ifndef REPORTHANDLER_H
+#define REPORTHANDLER_H
+
+#include <QtCore/QString>
+#include <QtCore/QSet>
+
+class ReportHandler
+{
+public:
+    enum DebugLevel { NoDebug, SparseDebug, MediumDebug, FullDebug };
+
+    static void setContext(const QString &context) { m_context = context; }
+
+    static DebugLevel debugLevel() { return m_debug_level; }
+    static void setDebugLevel(DebugLevel level) { m_debug_level = level; }
+
+    static int warningCount() { return m_warning_count; }
+
+    static int suppressedCount() { return m_suppressed_count; }
+
+    static void warning(const QString &str);
+
+    static void debugSparse(const QString &str) {
+        debug(SparseDebug, str);
+    }
+    static void debugMedium(const QString &str) {
+        debug(MediumDebug, str);
+    }
+    static void debugFull(const QString &str) {
+        debug(FullDebug, str);
+    }
+    static void debug(DebugLevel level, const QString &str);
+
+private:
+    static int m_warning_count;
+    static int m_suppressed_count;
+    static DebugLevel m_debug_level;
+    static QString m_context;
+    static QSet<QString> m_reported_warnings;
+};
+
+#endif // REPORTHANDLER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/typeparser.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,284 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#include "typeparser.h"
+
+#include <qdebug.h>
+#include <QStack>
+
+class Scanner
+{
+public:
+    enum Token {
+        StarToken,
+        AmpersandToken,
+        LessThanToken,
+        ColonToken,
+        CommaToken,
+        OpenParenToken,
+        CloseParenToken,
+        SquareBegin,
+        SquareEnd,
+        GreaterThanToken,
+
+        ConstToken,
+        Identifier,
+        NoToken
+    };
+
+    Scanner(const QString &s)
+        : m_pos(0), m_length(s.length()), m_chars(s.constData())
+    {
+    }
+
+    Token nextToken();
+    QString identifier() const;
+
+private:
+    int m_pos;
+    int m_length;
+    int m_token_start;
+    const QChar *m_chars;
+};
+
+QString Scanner::identifier() const
+{
+    return QString(m_chars + m_token_start, m_pos - m_token_start);
+}
+
+Scanner::Token Scanner::nextToken()
+{
+    Token tok = NoToken;
+
+    // remove whitespace
+    while (m_pos < m_length && m_chars[m_pos] == ' ') {
+        ++m_pos;
+    }
+
+    m_token_start = m_pos;
+
+    while (m_pos < m_length) {
+
+        const QChar &c = m_chars[m_pos];
+
+        if (tok == NoToken) {
+            switch (c.toLatin1()) {
+            case '*': tok = StarToken; break;
+            case '&': tok = AmpersandToken; break;
+            case '<': tok = LessThanToken; break;
+            case '>': tok = GreaterThanToken; break;
+            case ',': tok = CommaToken; break;
+            case '(': tok = OpenParenToken; break;
+            case ')': tok = CloseParenToken; break;
+            case '[': tok = SquareBegin; break;
+            case ']' : tok = SquareEnd; break;
+            case ':':
+                tok = ColonToken;
+                Q_ASSERT(m_pos + 1 < m_length);
+                ++m_pos;
+                break;
+            default:
+                if (c.isLetterOrNumber() || c == '_')
+                    tok = Identifier;
+                else
+                    qFatal("Unrecognized character in lexer: %c", c.toLatin1());
+                break;
+            }
+        }
+
+        if (tok <= GreaterThanToken) {
+            ++m_pos;
+            break;
+        }
+
+        if (tok == Identifier) {
+            if (c.isLetterOrNumber() || c == '_')
+                ++m_pos;
+            else
+                break;
+        }
+    }
+
+    if (tok == Identifier && m_pos - m_token_start == 5) {
+        if (m_chars[m_token_start] == 'c'
+            && m_chars[m_token_start + 1] == 'o'
+            && m_chars[m_token_start + 2] == 'n'
+            && m_chars[m_token_start + 3] == 's'
+            && m_chars[m_token_start + 4] == 't')
+            tok = ConstToken;
+    }
+
+    return tok;
+
+}
+
+TypeParser::Info TypeParser::parse(const QString &str)
+{
+    Scanner scanner(str);
+
+    Info info;
+    QStack<Info *> stack;
+    stack.push(&info);
+
+    bool colon_prefix = false;
+    bool in_array = false;
+    QString array;
+
+    Scanner::Token tok = scanner.nextToken();
+    while (tok != Scanner::NoToken) {
+
+//         switch (tok) {
+//         case Scanner::StarToken: printf(" - *\n"); break;
+//         case Scanner::AmpersandToken: printf(" - &\n"); break;
+//         case Scanner::LessThanToken: printf(" - <\n"); break;
+//         case Scanner::GreaterThanToken: printf(" - >\n"); break;
+//         case Scanner::ColonToken: printf(" - ::\n"); break;
+//         case Scanner::CommaToken: printf(" - ,\n"); break;
+//         case Scanner::ConstToken: printf(" - const\n"); break;
+//         case Scanner::SquareBegin: printf(" - [\n"); break;
+//         case Scanner::SquareEnd: printf(" - ]\n"); break;
+//         case Scanner::Identifier: printf(" - '%s'\n", qPrintable(scanner.identifier())); break;
+//         default:
+//             break;
+//         }
+
+        switch (tok) {
+
+        case Scanner::StarToken:
+            ++stack.top()->indirections;
+            break;
+
+        case Scanner::AmpersandToken:
+            stack.top()->is_reference = true;
+            break;
+
+        case Scanner::LessThanToken:
+            stack.top()->template_instantiations << Info();
+            stack.push(&stack.top()->template_instantiations.last());
+            break;
+
+        case Scanner::CommaToken:
+            stack.pop();
+            stack.top()->template_instantiations << Info();
+            stack.push(&stack.top()->template_instantiations.last());
+            break;
+
+        case Scanner::GreaterThanToken:
+            stack.pop();
+            break;
+
+        case Scanner::ColonToken:
+            colon_prefix = true;
+            break;
+
+        case Scanner::ConstToken:
+            stack.top()->is_constant = true;
+            break;
+
+        case Scanner::OpenParenToken: // function pointers not supported
+        case Scanner::CloseParenToken:
+            {
+                Info i;
+                i.is_busted = true;
+                return i;
+            }
+
+
+        case Scanner::Identifier:
+            if (in_array) {
+                array = scanner.identifier();
+            } else if (colon_prefix || stack.top()->qualified_name.isEmpty()) {
+                stack.top()->qualified_name << scanner.identifier();
+                colon_prefix = false;
+            } else {
+                stack.top()->qualified_name.last().append(" " + scanner.identifier());
+            }
+            break;
+
+        case Scanner::SquareBegin:
+            in_array = true;
+            break;
+
+        case Scanner::SquareEnd:
+            in_array = false;
+            stack.top()->arrays += array;
+            break;
+
+
+        default:
+            break;
+        }
+
+        tok = scanner.nextToken();
+    }
+
+    return info;
+}
+
+QString TypeParser::Info::instantiationName() const
+{
+    QString s(qualified_name.join("::"));
+    if (!template_instantiations.isEmpty()) {
+        s += '<';
+        for (int i=0; i<template_instantiations.size(); ++i) {
+            if (i != 0)
+                s += ",";
+            s += template_instantiations.at(i).toString();
+        }
+        s += '>';
+    }
+
+    return s;
+}
+
+QString TypeParser::Info::toString() const
+{
+    QString s;
+
+    if (is_constant) s += "const ";
+    s += instantiationName();
+    for (int i=0; i<arrays.size(); ++i)
+        s += "[" + arrays.at(i) + "]";
+    s += QString(indirections, '*');
+    if (is_reference)  s += '&';
+
+    return s;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/typeparser.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,70 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#ifndef TYPEPARSER_H
+#define TYPEPARSER_H
+
+#include <QList>
+#include <QString>
+#include <QStringList>
+
+class TypeParser
+{
+public:
+    struct Info
+    {
+        Info() : is_reference(false), is_constant(false), is_busted(false), indirections(0) { }
+        QStringList qualified_name;
+        QStringList arrays;
+        QList<Info> template_instantiations;
+        uint is_reference : 1;
+        uint is_constant : 1;
+        uint is_busted : 1;
+        uint indirections : 5;
+
+        QString toString() const;
+        QString instantiationName() const;
+    };
+
+    static Info parse(const QString &str);
+};
+
+#endif // TYPEPARSER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/typesystem.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,2047 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#include "typesystem.h"
+#include "generator.h"
+
+#include "customtypes.h"
+
+#include <reporthandler.h>
+
+#include <QtXml>
+
+QString strings_Object = QLatin1String("Object");
+QString strings_String = QLatin1String("string");
+QString strings_Thread = QLatin1String("Thread");
+QString strings_char = QLatin1String("char");
+QString strings_java_lang = QLatin1String("java.lang");
+QString strings_jchar = QLatin1String("jchar");
+QString strings_jobject = QLatin1String("jobject");
+
+static void addRemoveFunctionToTemplates(TypeDatabase *db);
+
+class StackElement
+{
+    public:
+    enum ElementType {
+        None = 0x0,
+
+        // Type tags (0x1, ... , 0xff)
+        ObjectTypeEntry      = 0x1,
+        ValueTypeEntry       = 0x2,
+        InterfaceTypeEntry   = 0x3,
+        NamespaceTypeEntry   = 0x4,
+        ComplexTypeEntryMask = 0xf,
+
+        // Non-complex type tags (0x10, 0x20, ... , 0xf0)
+        PrimitiveTypeEntry   = 0x10,
+        EnumTypeEntry        = 0x20,
+        TypeEntryMask        = 0xff,
+
+        // Simple tags (0x100, 0x200, ... , 0xf00)
+        ExtraIncludes               = 0x100,
+        Include                     = 0x200,
+        ModifyFunction              = 0x300,
+        ModifyField                 = 0x400,
+        Root                        = 0x500,
+        CustomMetaConstructor       = 0x600,
+        CustomMetaDestructor        = 0x700,
+        ArgumentMap                 = 0x800,
+        SuppressedWarning           = 0x900,
+        Rejection                   = 0xa00,
+        LoadTypesystem              = 0xb00,
+        RejectEnumValue             = 0xc00,
+        Template                    = 0xd00,
+        TemplateInstanceEnum        = 0xe00,
+        Replace                     = 0xf00,
+        SimpleMask                  = 0xf00,
+        // qtd stuff
+        AddClass                    = 0x1100,
+
+        // Code snip tags (0x1000, 0x2000, ... , 0xf000)
+        InjectCode =           0x1000,
+        InjectCodeInFunction = 0x2000,
+        CodeSnipMask =         0xf000,
+
+        // Function modifier tags (0x010000, 0x020000, ... , 0xf00000)
+        Access                   = 0x010000,
+        Removal                  = 0x020000,
+        Rename                   = 0x040000,
+        ModifyArgument           = 0x080000,
+        FunctionModifiers        = 0xff0000,
+        StoreResult              = 0x110000,
+
+        // Argument modifier tags (0x01000000 ... 0xf0000000)
+        ConversionRule           = 0x01000000,
+        ReplaceType              = 0x02000000,
+        ReplaceDefaultExpression = 0x04000000,
+        RemoveArgument           = 0x08000000,
+        DefineOwnership          = 0x10000000,
+        RemoveDefaultExpression  = 0x20000000,
+        NoNullPointers           = 0x40000000,
+        ReferenceCount           = 0x80000000,
+        ArgumentModifiers        = 0xff000000
+
+    };
+
+    StackElement(StackElement *p) : entry(0), type(None), parent(p){ }
+
+    TypeEntry *entry;
+    ElementType type;
+    StackElement *parent;
+
+    union {
+        TemplateInstance *templateInstance;
+        TemplateEntry *templateEntry;
+        CustomFunction *customFunction;
+    } value;
+};
+
+class Handler : public QXmlDefaultHandler
+{
+public:
+    Handler(TypeDatabase *database, bool generate)
+        : m_database(database), m_generate(generate ? TypeEntry::GenerateAll : TypeEntry::GenerateForSubclass)
+    {
+        m_current_enum = 0;
+        current = 0;
+
+        tagNames["rejection"] = StackElement::Rejection;
+        tagNames["primitive-type"] = StackElement::PrimitiveTypeEntry;
+        tagNames["object-type"] = StackElement::ObjectTypeEntry;
+        tagNames["value-type"] = StackElement::ValueTypeEntry;
+        tagNames["interface-type"] = StackElement::InterfaceTypeEntry;
+        tagNames["namespace-type"] = StackElement::NamespaceTypeEntry;
+        tagNames["enum-type"] = StackElement::EnumTypeEntry;
+        tagNames["extra-includes"] = StackElement::ExtraIncludes;
+        tagNames["include"] = StackElement::Include;
+        tagNames["inject-code"] = StackElement::InjectCode;
+        tagNames["modify-function"] = StackElement::ModifyFunction;
+        tagNames["modify-field"] = StackElement::ModifyField;
+        tagNames["access"] = StackElement::Access;
+        tagNames["remove"] = StackElement::Removal;
+        tagNames["rename"] = StackElement::Rename;
+        tagNames["typesystem"] = StackElement::Root;
+        tagNames["custom-constructor"] = StackElement::CustomMetaConstructor;
+        tagNames["custom-destructor"] = StackElement::CustomMetaDestructor;
+        tagNames["argument-map"] = StackElement::ArgumentMap;
+        tagNames["suppress-warning"] = StackElement::SuppressedWarning;
+        tagNames["load-typesystem"] = StackElement::LoadTypesystem;
+        tagNames["define-ownership"] = StackElement::DefineOwnership;
+        tagNames["replace-default-expression"] = StackElement::ReplaceDefaultExpression;
+        tagNames["reject-enum-value"] = StackElement::RejectEnumValue;
+        tagNames["replace-type"] = StackElement::ReplaceType;
+        tagNames["conversion-rule"] = StackElement::ConversionRule;
+        tagNames["modify-argument"] = StackElement::ModifyArgument;
+        tagNames["remove-argument"] = StackElement::RemoveArgument;
+        tagNames["remove-default-expression"] = StackElement::RemoveDefaultExpression;
+        tagNames["template"] = StackElement::Template;
+        tagNames["insert-template"] = StackElement::TemplateInstanceEnum;
+        tagNames["replace"] = StackElement::Replace;
+        tagNames["no-null-pointer"] = StackElement::NoNullPointers;
+        tagNames["reference-count"] = StackElement::ReferenceCount;
+        // qtd
+        tagNames["add-class"] = StackElement::AddClass;
+        tagNames["store-result"] = StackElement::StoreResult;
+    }
+
+    bool startElement(const QString &namespaceURI, const QString &localName,
+                      const QString &qName, const QXmlAttributes &atts);
+    bool endElement(const QString &namespaceURI, const QString &localName, const QString &qName);
+
+    QString errorString() const { return m_error; }
+    bool error(const QXmlParseException &exception);
+    bool fatalError(const QXmlParseException &exception);
+    bool warning(const QXmlParseException &exception);
+
+    bool characters(const QString &ch);
+
+private:
+    void fetchAttributeValues(const QString &name, const QXmlAttributes &atts,
+                              QHash<QString, QString> *acceptedAttributes);
+
+    bool importFileElement(const QXmlAttributes &atts);
+    bool convertBoolean(const QString &, const QString &, bool);
+
+    TypeDatabase *m_database;
+    StackElement* current;
+    QString m_defaultPackage;
+    QString m_defaultSuperclass;
+    QString m_error;
+    TypeEntry::CodeGeneration m_generate;
+
+    EnumTypeEntry *m_current_enum;
+
+    CodeSnipList m_code_snips;
+    FunctionModificationList m_function_mods;
+    FieldModificationList m_field_mods;
+
+    QHash<QString, StackElement::ElementType> tagNames;
+};
+
+bool Handler::error(const QXmlParseException &e)
+{
+    qWarning("Error: line=%d, column=%d, message=%s\n",
+             e.lineNumber(), e.columnNumber(), qPrintable(e.message()));
+    return false;
+}
+
+bool Handler::fatalError(const QXmlParseException &e)
+{
+    qWarning("Fatal error: line=%d, column=%d, message=%s\n",
+             e.lineNumber(), e.columnNumber(), qPrintable(e.message()));
+
+    return false;
+}
+
+bool Handler::warning(const QXmlParseException &e)
+{
+    qWarning("Warning: line=%d, column=%d, message=%s\n",
+             e.lineNumber(), e.columnNumber(), qPrintable(e.message()));
+
+    return false;
+}
+
+void Handler::fetchAttributeValues(const QString &name, const QXmlAttributes &atts,
+                                   QHash<QString, QString> *acceptedAttributes)
+{
+    Q_ASSERT(acceptedAttributes != 0);
+
+    for (int i=0; i<atts.length(); ++i) {
+        QString key = atts.localName(i).toLower();
+        QString val = atts.value(i);
+
+        if (!acceptedAttributes->contains(key)) {
+            ReportHandler::warning(QString("Unknown attribute for '%1': '%2'").arg(name).arg(key));
+        } else {
+            (*acceptedAttributes)[key] = val;
+        }
+    }
+}
+
+bool Handler::endElement(const QString &, const QString &localName, const QString &)
+{
+    QString tagName = localName.toLower();
+    if(tagName == "import-file")
+        return true;
+
+    if (!current)
+        return true;
+
+    switch (current->type) {
+    case StackElement::ObjectTypeEntry:
+    case StackElement::ValueTypeEntry:
+    case StackElement::InterfaceTypeEntry:
+    case StackElement::NamespaceTypeEntry:
+        {
+            ComplexTypeEntry *centry = static_cast<ComplexTypeEntry *>(current->entry);
+            centry->setFunctionModifications(m_function_mods);
+            centry->setFieldModifications(m_field_mods);
+            centry->setCodeSnips(m_code_snips);
+
+            if (centry->designatedInterface()) {
+                centry->designatedInterface()->setCodeSnips(m_code_snips);
+                centry->designatedInterface()->setFunctionModifications(m_function_mods);
+            }
+            m_code_snips = CodeSnipList();
+            m_function_mods = FunctionModificationList();
+            m_field_mods = FieldModificationList();
+        }
+        break;
+    case StackElement::CustomMetaConstructor:
+        {
+            current->entry->setCustomConstructor(*current->value.customFunction);
+            delete current->value.customFunction;
+        }
+        break;
+    case StackElement::CustomMetaDestructor:
+        {
+            current->entry->setCustomDestructor(*current->value.customFunction);
+            delete current->value.customFunction;
+        }
+        break;
+    case StackElement::EnumTypeEntry:
+        m_current_enum = 0;
+        break;
+    case StackElement::Template:
+        m_database->addTemplate(current->value.templateEntry);
+        break;
+    case StackElement::TemplateInstanceEnum:
+        if(current->parent->type == StackElement::InjectCode){
+            m_code_snips.last().addTemplateInstance(current->value.templateInstance);
+        }else if(current->parent->type == StackElement::Template){
+            current->parent->value.templateEntry->addTemplateInstance(current->value.templateInstance);
+        }else if(current->parent->type == StackElement::CustomMetaConstructor || current->parent->type == StackElement::CustomMetaConstructor){
+            current->parent->value.customFunction->addTemplateInstance(current->value.templateInstance);
+        }else if(current->parent->type == StackElement::ConversionRule){
+            m_function_mods.last().argument_mods.last().conversion_rules.last().addTemplateInstance(current->value.templateInstance);
+        }else if(current->parent->type == StackElement::InjectCodeInFunction){
+            m_function_mods.last().snips.last().addTemplateInstance(current->value.templateInstance);
+        }
+        break;
+    default:
+        break;
+    }
+
+    StackElement *child = current;
+    current=current->parent;
+    delete(child);
+
+    return true;
+}
+
+bool Handler::characters(const QString &ch)
+{
+    if(current->type == StackElement::Template){
+        current->value.templateEntry->addCode(ch);
+        return true;
+    }
+
+    if (current->type == StackElement::CustomMetaConstructor || current->type == StackElement::CustomMetaDestructor){
+        current->value.customFunction->addCode(ch);
+        return true;
+    }
+
+    if (current->type == StackElement::ConversionRule){
+        m_function_mods.last().argument_mods.last().conversion_rules.last().addCode(ch);
+        return true;
+    }
+
+    if  (current->parent){
+        if ((current->type & StackElement::CodeSnipMask) != 0) {
+            switch (current->parent->type) {
+                case StackElement::Root:
+                    ((TypeSystemTypeEntry *) current->parent->entry)->snips.last().addCode(ch);
+                    break;
+                case StackElement::ModifyFunction:
+                    m_function_mods.last().snips.last().addCode(ch);
+                    break;
+                case StackElement::NamespaceTypeEntry:
+                case StackElement::ObjectTypeEntry:
+                case StackElement::ValueTypeEntry:
+                case StackElement::InterfaceTypeEntry:
+                    m_code_snips.last().addCode(ch);
+                    break;
+                default:
+                    Q_ASSERT(false);
+            };
+            return true;
+        }
+    }
+
+    return true;
+}
+
+bool Handler::importFileElement(const QXmlAttributes &atts)
+{
+    QString fileName = atts.value("name");
+    if(fileName.isEmpty()){
+        m_error = "Required attribute 'name' missing for include-file tag.";
+        return false;
+    }
+
+    QFile file(fileName);
+    if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
+        file.setFileName(":/trolltech/generator/" + fileName);
+        if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
+            m_error = QString("Could not open file: '%1'").arg(fileName);
+            return false;
+        }
+    }
+
+    QString quoteFrom = atts.value("quote-after-line");
+    bool foundFromOk = quoteFrom.isEmpty();
+    bool from = quoteFrom.isEmpty();
+
+    QString quoteTo = atts.value("quote-before-line");
+    bool foundToOk = quoteTo.isEmpty();
+    bool to = true;
+
+    QTextStream in(&file);
+    while (!in.atEnd()) {
+        QString line = in.readLine();
+        if(from && to && line.contains(quoteTo)) {
+            to = false;
+            foundToOk = true;
+            break;
+        }
+        if(from && to)
+            characters(line + "\n");
+        if(!from && line.contains(quoteFrom)) {
+            from = true;
+            foundFromOk = true;
+        }
+    }
+    if(!foundFromOk || !foundToOk){
+        QString fromError = QString("Could not find quote-after-line='%1' in file '%2'.").arg(quoteFrom).arg(fileName);
+        QString toError = QString("Could not find quote-before-line='%1' in file '%2'.").arg(quoteTo).arg(fileName);
+
+        if(!foundToOk)
+            m_error = toError;
+        if(!foundFromOk)
+            m_error = fromError;
+        if(!foundFromOk && !foundToOk)
+            m_error = fromError + " " + toError;
+        return false;
+    }
+
+    return true;
+}
+
+bool Handler::convertBoolean(const QString &_value, const QString &attributeName, bool defaultValue)
+{
+    QString value = _value.toLower();
+    if (value == "true" || value == "yes") {
+        return true;
+    } else if (value == "false" || value == "no") {
+        return false;
+    } else {
+        QString warn = QString("Boolean value '%1' not supported in attribute '%2'. Use 'yes' or 'no'. Defaulting to '%3'.")
+            .arg(value).arg(attributeName).arg(defaultValue ? "yes" : "no");
+
+        ReportHandler::warning(warn);
+        return defaultValue;
+    }
+}
+
+bool Handler::startElement(const QString &, const QString &n,
+                           const QString &, const QXmlAttributes &atts)
+{
+    QString tagName = n.toLower();
+    if(tagName == "import-file"){
+        return importFileElement(atts);
+    }
+
+    StackElement *element = new StackElement(current);
+
+    if (!tagNames.contains(tagName)) {
+        m_error = QString("Unknown tag name: '%1'").arg(tagName);
+        return false;
+    }
+
+    element->type = tagNames[tagName];
+    if (element->type & StackElement::TypeEntryMask) {
+        if (current->type != StackElement::Root) {
+            m_error = "Nested types not supported";
+            return false;
+        }
+
+        QHash<QString, QString> attributes;
+        attributes["name"] = QString();
+
+        switch (element->type) {
+        case StackElement::PrimitiveTypeEntry:
+            attributes["java-name"] = QString();
+            attributes["jni-name"] = QString();
+            attributes["preferred-conversion"] = "yes";
+            attributes["preferred-java-type"] = "yes";
+            break;
+        case StackElement::EnumTypeEntry:
+            attributes["flags"] = "no";
+            attributes["upper-bound"] = QString();
+            attributes["lower-bound"] = QString();
+            attributes["force-integer"] = "no";
+            attributes["extensible"] = "no";
+
+            break;
+
+        case StackElement::ObjectTypeEntry:
+        case StackElement::ValueTypeEntry:
+            attributes["force-abstract"] = QString("no");
+            attributes["deprecated"] = QString("no");
+            attributes["wrap"] = QString();
+            // fall throooough
+        case StackElement::InterfaceTypeEntry:
+            attributes["default-superclass"] = m_defaultSuperclass;
+            attributes["polymorphic-id-expression"] = QString();
+            attributes["delete-in-main-thread"] = QString("no");
+            // fall through
+        case StackElement::NamespaceTypeEntry:
+            attributes["java-name"] = QString();
+            attributes["package"] = m_defaultPackage;
+            attributes["expense-cost"] = "1";
+            attributes["expense-limit"] = "none";
+            attributes["polymorphic-base"] = QString("no");
+            attributes["generate"] = QString("yes");
+            attributes["target-type"] = QString();
+            attributes["generic-class"] = QString("no");
+            break;
+        default:
+            ; // nada
+        };
+
+        fetchAttributeValues(tagName, atts, &attributes);
+
+        QString name = attributes["name"];
+
+        // We need to be able to have duplicate primitive type entries, or it's not possible to
+        // cover all primitive java types (which we need to do in order to support fake
+        // meta objects)
+        if (element->type != StackElement::PrimitiveTypeEntry) {
+            TypeEntry *tmp = m_database->findType(name);
+            if (tmp != 0) {
+                ReportHandler::warning(QString("Duplicate type entry: '%1'").arg(name));
+            }
+        }
+
+        if (name.isEmpty()) {
+            m_error = "no 'name' attribute specified";
+            return false;
+        }
+        switch (element->type) {
+        case StackElement::PrimitiveTypeEntry:
+            {
+                QString java_name = attributes["java-name"];
+                QString jni_name = attributes["jni-name"];
+                QString preferred_conversion = attributes["preferred-conversion"].toLower();
+                QString preferred_java_type = attributes["preferred-java-type"].toLower();
+
+                if (java_name.isEmpty())
+                    java_name = name;
+                if (jni_name.isEmpty())
+                    jni_name = name;
+
+                PrimitiveTypeEntry *type = new PrimitiveTypeEntry(name);
+                type->setCodeGeneration(m_generate);
+                type->setTargetLangName(java_name);
+                type->setJniName(jni_name);
+
+                type->setPreferredConversion(convertBoolean(preferred_conversion, "preferred-conversion", true));
+                type->setPreferredTargetLangType(convertBoolean(preferred_java_type, "preferred-java-type", true));
+
+                element->entry = type;
+            }
+            break;
+        case StackElement::EnumTypeEntry: {
+            QStringList names = name.split(QLatin1String("::"));
+
+            if (names.size() == 1) {
+                m_current_enum = new EnumTypeEntry(QString(), name);
+            }
+            else
+                m_current_enum =
+                    new EnumTypeEntry(QStringList(names.mid(0, names.size() - 1)).join("::"),
+                                      names.last());
+            element->entry = m_current_enum;
+            m_current_enum->setCodeGeneration(m_generate);
+            m_current_enum->setTargetLangPackage(m_defaultPackage);
+            m_current_enum->setUpperBound(attributes["upper-bound"]);
+            m_current_enum->setLowerBound(attributes["lower-bound"]);
+            m_current_enum->setForceInteger(convertBoolean(attributes["force-integer"], "force-integer", false));
+            m_current_enum->setExtensible(convertBoolean(attributes["extensible"], "extensible", false));
+
+            // put in the flags parallel...
+            if (!attributes["flags"].isEmpty() && attributes["flags"].toLower() != "no") {
+                FlagsTypeEntry *ftype = new FlagsTypeEntry("QFlags<" + name + ">");
+                ftype->setOriginator(m_current_enum);
+                ftype->setOriginalName(attributes["flags"]);
+                ftype->setCodeGeneration(m_generate);
+                QString n = ftype->originalName();
+
+                QStringList lst = n.split("::");
+                if (QStringList(lst.mid(0, lst.size() - 1)).join("::") != m_current_enum->javaQualifier()) {
+                    ReportHandler::warning(QString("enum %1 and flags %2 differ in qualifiers")
+                                           .arg(m_current_enum->javaQualifier())
+                                           .arg(lst.at(0)));
+                }
+
+                ftype->setFlagsName(lst.last());
+                m_current_enum->setFlags(ftype);
+
+                m_database->addFlagsType(ftype);
+                m_database->addType(ftype);
+            }
+            }
+            break;
+
+        case StackElement::InterfaceTypeEntry:
+            {
+                ObjectTypeEntry *otype = new ObjectTypeEntry(name);
+                QString javaName = attributes["java-name"];
+                if (javaName.isEmpty())
+                    javaName = name;
+                InterfaceTypeEntry *itype =
+                    new InterfaceTypeEntry(InterfaceTypeEntry::interfaceName(javaName));
+
+                if (!convertBoolean(attributes["generate"], "generate", true))
+                    itype->setCodeGeneration(TypeEntry::GenerateForSubclass);
+                else
+                    itype->setCodeGeneration(m_generate);
+                otype->setDesignatedInterface(itype);
+                itype->setOrigin(otype);
+                element->entry = otype;
+            }
+            // fall through
+        case StackElement::NamespaceTypeEntry:
+            if (element->entry == 0) {
+                element->entry = new NamespaceTypeEntry(name);
+            }
+            // fall through
+        case StackElement::ObjectTypeEntry:
+            if (element->entry == 0) {
+                element->entry = new ObjectTypeEntry(name);
+            }
+            // fall through
+        case StackElement::ValueTypeEntry:
+            {
+                if (element->entry == 0) {
+                    if(name == "QVariant")
+                        element->entry = new VariantTypeEntry(name);
+                    else
+                        element->entry = new ValueTypeEntry(name);
+                }
+
+                ComplexTypeEntry *ctype = static_cast<ComplexTypeEntry *>(element->entry);
+                ctype->setTargetLangPackage(attributes["package"]);
+                ctype->setDefaultSuperclass(attributes["default-superclass"]);
+                ctype->setGenericClass(convertBoolean(attributes["generic-class"], "generic-class", false));
+
+                // qtd
+                QString wrap = attributes["wrap"];
+                ctype->setStructInD(wrap == "struct" ? true : false);
+                //
+
+                if (!convertBoolean(attributes["generate"], "generate", true))
+                    element->entry->setCodeGeneration(TypeEntry::GenerateForSubclass);
+                else
+                    element->entry->setCodeGeneration(m_generate);
+
+                QString javaName = attributes["java-name"];
+                if (!javaName.isEmpty())
+                    ctype->setTargetLangName(javaName);
+
+                // The expense policy
+                QString limit = attributes["expense-limit"];
+                if (!limit.isEmpty() && limit != "none") {
+                    ExpensePolicy ep;
+                    ep.limit = limit.toInt();
+                    ep.cost = attributes["expense-cost"];
+                    ctype->setExpensePolicy(ep);
+                }
+
+                ctype->setIsPolymorphicBase(convertBoolean(attributes["polymorphic-base"], "polymorphic-base", false));
+                ctype->setPolymorphicIdValue(attributes["polymorphic-id-expression"]);
+
+                if (element->type == StackElement::ObjectTypeEntry || element->type == StackElement::ValueTypeEntry) {
+                    if (convertBoolean(attributes["force-abstract"], "force-abstract", false))
+                        ctype->setTypeFlags(ctype->typeFlags() | ComplexTypeEntry::ForceAbstract);
+                    if (convertBoolean(attributes["deprecated"], "deprecated", false))
+                        ctype->setTypeFlags(ctype->typeFlags() | ComplexTypeEntry::Deprecated);
+                }
+
+                if (element->type == StackElement::InterfaceTypeEntry ||
+                    element->type == StackElement::ValueTypeEntry ||
+                    element->type == StackElement::ObjectTypeEntry) {
+                    if (convertBoolean(attributes["delete-in-main-thread"], "delete-in-main-thread", false))
+                        ctype->setTypeFlags(ctype->typeFlags() | ComplexTypeEntry::DeleteInMainThread);
+                }
+
+                QString targetType = attributes["target-type"];
+                if (!targetType.isEmpty() && element->entry->isComplex())
+                    static_cast<ComplexTypeEntry *>(element->entry)->setTargetType(targetType);
+
+                // ctype->setInclude(Include(Include::IncludePath, ctype->name()));
+                ctype = ctype->designatedInterface();
+                if (ctype != 0)
+                    ctype->setTargetLangPackage(attributes["package"]);
+            }
+            break;
+        default:
+            Q_ASSERT(false);
+        };
+
+        if (element->entry)
+            m_database->addType(element->entry);
+        else
+            ReportHandler::warning(QString("Type: %1 was rejected by typesystem").arg(name));
+
+    } else if (element->type != StackElement::None) {
+        bool topLevel = element->type == StackElement::Root
+      || element->type == StackElement::SuppressedWarning
+      || element->type == StackElement::Rejection
+      || element->type == StackElement::LoadTypesystem
+      || element->type == StackElement::InjectCode
+      || element->type == StackElement::Template;
+
+        if (!topLevel && current->type == StackElement::Root) {
+            m_error = QString("Tag requires parent: '%1'").arg(tagName);
+            return false;
+        }
+
+        StackElement topElement = current==0 ? StackElement(0) : *current;
+        element->entry = topElement.entry;
+
+        QHash<QString, QString> attributes;
+        switch (element->type) {
+        case StackElement::Root:
+            attributes["package"] = QString();
+            attributes["default-superclass"] = QString();
+            break;
+        case StackElement::LoadTypesystem:
+            attributes["name"] = QString();
+            attributes["generate"] = "yes";
+            break;
+        case StackElement::NoNullPointers:
+            attributes["default-value"] = QString();
+            break;
+        case StackElement::SuppressedWarning:
+            attributes["text"] = QString();
+            break;
+        case StackElement::ReplaceDefaultExpression:
+            attributes["with"] = QString();
+            break;
+        case StackElement::DefineOwnership:
+            attributes["class"] = "java";
+            attributes["owner"] = "";
+            break;
+        case StackElement::ModifyFunction:
+            attributes["signature"] = QString();
+            attributes["access"] = QString();
+            attributes["remove"] = QString();
+            attributes["rename"] = QString();
+            attributes["deprecated"] = QString("no");
+            attributes["associated-to"] = QString();
+            attributes["virtual-slot"] = QString("no");
+            break;
+        case StackElement::ModifyArgument:
+            attributes["index"] = QString();
+            attributes["replace-value"] = QString();
+            attributes["invalidate-after-use"] = QString("no");
+            break;
+        case StackElement::ModifyField:
+            attributes["name"] = QString();
+            attributes["write"] = "true";
+            attributes["read"] = "true";
+            break;
+        case StackElement::Access:
+            attributes["modifier"] = QString();
+            break;
+        case StackElement::Include:
+            attributes["file-name"] = QString();
+            attributes["location"] = QString();
+            break;
+        case StackElement::CustomMetaConstructor:
+            attributes["name"] = topElement.entry->name().toLower() + "_create";
+            attributes["param-name"] = "copy";
+            break;
+        case StackElement::CustomMetaDestructor:
+            attributes["name"] = topElement.entry->name().toLower() + "_delete";
+            attributes["param-name"] = "copy";
+            break;
+        case StackElement::ReplaceType:
+            attributes["modified-type"] = QString();
+            break;
+        case StackElement::InjectCode:
+            attributes["class"] = "java";
+            attributes["position"] = "beginning";
+            break;
+        case StackElement::ConversionRule:
+            attributes["class"] = "";
+            break;
+        case StackElement::RejectEnumValue:
+            attributes["name"] = "";
+            break;
+        case StackElement::ArgumentMap:
+            attributes["index"] = "1";
+            attributes["meta-name"] = QString();
+            break;
+        case StackElement::Rename:
+            attributes["to"] = QString();
+            break;
+        case StackElement::Rejection:
+            attributes["class"] = "*";
+            attributes["function-name"] = "*";
+            attributes["field-name"] = "*";
+            attributes["enum-name"] = "*";
+            break;
+        case StackElement::Removal:
+            attributes["class"] = "all";
+            break;
+        case StackElement::Template:
+            attributes["name"] = QString();
+            break;
+        case StackElement::TemplateInstanceEnum:
+            attributes["name"] = QString();
+            break;
+        case StackElement::Replace:
+            attributes["from"] = QString();
+            attributes["to"] = QString();
+            break;
+        case StackElement::ReferenceCount:
+            attributes["action"] = QString();
+            attributes["variable-name"] = QString();
+            attributes["thread-safe"] = QString("no");
+            attributes["declare-variable"] = QString();
+            attributes["access"] = QString("private");
+            attributes["conditional"] = QString("");
+            break;
+            // qtd
+        case StackElement::AddClass:
+            attributes["name"] = QString();
+            break;
+        default:
+            ; // nada
+        };
+
+        if (attributes.count() > 0)
+            fetchAttributeValues(tagName, atts, &attributes);
+
+        switch (element->type) {
+        case StackElement::Root:
+            m_defaultPackage = attributes["package"];
+            m_defaultSuperclass = attributes["default-superclass"];
+            element->type = StackElement::Root;
+            element->entry = new TypeSystemTypeEntry(m_defaultPackage);
+            TypeDatabase::instance()->addType(element->entry);
+            break;
+        case StackElement::LoadTypesystem:
+            {
+                QString name = attributes["name"];
+                if (name.isEmpty()) {
+                    m_error = "No typesystem name specified";
+                    return false;
+                }
+
+                if (!m_database->parseFile(name, convertBoolean(attributes["generate"], "generate", true))) {
+                    m_error = QString("Failed to parse: '%1'").arg(name);
+                    return false;
+                }
+            }
+            break;
+        case StackElement::RejectEnumValue: {
+            if (!m_current_enum) {
+                m_error = "<reject-enum-value> node must be used inside a <enum-type> node";
+                return false;
+            }
+            QString name = attributes["name"];
+
+            bool added = false;
+            if (!name.isEmpty()) {
+                added = true;
+                m_current_enum->addEnumValueRejection(name);
+            }
+
+            } break;
+        case StackElement::ReplaceType:
+            {
+                if (topElement.type != StackElement::ModifyArgument) {
+                    m_error = "Type replacement can only be specified for argument modifications";
+                    return false;
+                }
+
+                if (attributes["modified-type"].isEmpty()) {
+                    m_error = "Type replacement requires 'modified-type' attribute";
+                    return false;
+                }
+
+                m_function_mods.last().argument_mods.last().modified_type = attributes["modified-type"];
+            }
+            break;
+        case StackElement::ConversionRule:
+            {
+                if (topElement.type != StackElement::ModifyArgument) {
+                    m_error = "Conversion rules can only be specified for argument modification";
+                    return false;
+                }
+
+                static QHash<QString, TypeSystem::Language> languageNames;
+                if (languageNames.isEmpty()) {
+                    languageNames["native"] = TypeSystem::NativeCode;
+                    languageNames["shell"] = TypeSystem::ShellCode;
+                }
+
+                CodeSnip snip;
+                QString languageAttribute = attributes["class"].toLower();
+                TypeSystem::Language lang = languageNames.value(languageAttribute, TypeSystem::NoLanguage);
+                if (lang == TypeSystem::NoLanguage) {
+                    m_error = QString("unsupported class attribute: '%1'").arg(languageAttribute);
+                    return false;
+                }
+
+                snip.language = lang;
+                m_function_mods.last().argument_mods.last().conversion_rules.append(snip);
+            }
+
+            break;
+        case StackElement::StoreResult:
+            {
+                if (topElement.type != StackElement::ModifyFunction) {
+                    m_error = QString::fromLatin1("result storage requires function"
+                                                  " modification as parent, was %1")
+                              .arg(topElement.type, 0, 16);
+                    return false;
+                }
+
+                m_function_mods.last().store_result = true;
+            }
+            break;
+        case StackElement::ModifyArgument:
+            {
+                if (topElement.type != StackElement::ModifyFunction) {
+                    m_error = QString::fromLatin1("argument modification requires function"
+                                                  " modification as parent, was %1")
+                              .arg(topElement.type, 0, 16);
+                    return false;
+                }
+
+                QString index = attributes["index"];
+                if (index == "return")
+                    index = "0";
+                else if (index == "this")
+                    index = "-1";
+
+                bool ok = false;
+                int idx = index.toInt(&ok);
+                if (!ok) {
+                    m_error = QString("Cannot convert '%1' to integer").arg(index);
+                    return false;
+                }
+
+                QString replace_value = attributes["replace-value"];
+
+                if (!replace_value.isEmpty() && idx != 0) {
+                    m_error = QString("replace-value is only supported for return values (index=0).");
+                    return false;
+                }
+
+                ArgumentModification argumentModification = ArgumentModification(idx);
+                argumentModification.replace_value = replace_value;
+                argumentModification.reset_after_use = convertBoolean(attributes["invalidate-after-use"], "invalidate-after-use", false);
+                m_function_mods.last().argument_mods.append(argumentModification);
+            }
+            break;
+        case StackElement::NoNullPointers:
+            {
+                if (topElement.type != StackElement::ModifyArgument) {
+                    m_error = "no-null-pointer requires argument modification as parent";
+                    return false;
+                }
+
+                m_function_mods.last().argument_mods.last().no_null_pointers = true;
+                if (m_function_mods.last().argument_mods.last().index == 0) {
+                    m_function_mods.last().argument_mods.last().null_pointer_default_value = attributes["default-value"];
+                } else if (!attributes["default-value"].isEmpty()) {
+                    ReportHandler::warning("default values for null pointer guards are only effective for return values");
+                }
+            }
+            break;
+        case StackElement::DefineOwnership:
+            {
+                if (topElement.type != StackElement::ModifyArgument) {
+                    m_error = "define-ownership requires argument modification as parent";
+                    return false;
+                }
+
+                static QHash<QString, TypeSystem::Language> languageNames;
+                if (languageNames.isEmpty()) {
+                    languageNames["java"] = TypeSystem::TargetLangCode;
+                    languageNames["shell"] = TypeSystem::ShellCode;
+                }
+
+                QString classAttribute = attributes["class"].toLower();
+                TypeSystem::Language lang = languageNames.value(classAttribute, TypeSystem::NoLanguage);
+                if (lang == TypeSystem::NoLanguage) {
+                    m_error = QString("unsupported class attribute: '%1'").arg(classAttribute);
+                    return false;
+                }
+
+                static QHash<QString, TypeSystem::Ownership> ownershipNames;
+                if (ownershipNames.isEmpty()) {
+                    ownershipNames["java"] = TypeSystem::TargetLangOwnership;
+                    ownershipNames["c++"] = TypeSystem::CppOwnership;
+                    ownershipNames["default"] = TypeSystem::DefaultOwnership;
+                }
+
+                QString ownershipAttribute = attributes["owner"].toLower();
+                TypeSystem::Ownership owner = ownershipNames.value(ownershipAttribute, TypeSystem::InvalidOwnership);
+                if (owner == TypeSystem::InvalidOwnership) {
+                    m_error = QString("unsupported owner attribute: '%1'").arg(ownershipAttribute);
+                    return false;
+                }
+
+                m_function_mods.last().argument_mods.last().ownerships[lang] = owner;
+            }
+            break;
+        case StackElement::SuppressedWarning:
+            if (attributes["text"].isEmpty())
+                ReportHandler::warning("Suppressed warning with no text specified");
+            else
+                m_database->addSuppressedWarning(attributes["text"]);
+            break;
+        case StackElement::ArgumentMap:
+            {
+                if (!(topElement.type & StackElement::CodeSnipMask)) {
+                    m_error = "Argument maps requires code injection as parent";
+                    return false;
+                }
+
+                bool ok;
+                int pos = attributes["index"].toInt(&ok);
+                if (!ok) {
+                    m_error = QString("Can't convert position '%1' to integer")
+                              .arg(attributes["position"]);
+                    return false;
+                }
+
+                if (pos <= 0) {
+                    m_error = QString("Argument position %1 must be a positive number").arg(pos);
+                    return false;
+                }
+
+                QString meta_name = attributes["meta-name"];
+                if (meta_name.isEmpty()) {
+                    ReportHandler::warning("Empty meta name in argument map");
+                }
+
+                if (topElement.type == StackElement::InjectCodeInFunction) {
+                    m_function_mods.last().snips.last().argumentMap[pos] = meta_name;
+                } else {
+                    ReportHandler::warning("Argument maps are only useful for injection of code "
+                                           "into functions.");
+                }
+            }
+            break;
+        case StackElement::Removal:
+            {
+                if (topElement.type != StackElement::ModifyFunction) {
+                    m_error = "Function modification parent required";
+                    return false;
+                }
+
+                static QHash<QString, TypeSystem::Language> languageNames;
+                if (languageNames.isEmpty()) {
+                    languageNames["java"] = TypeSystem::TargetLangAndNativeCode;
+                    languageNames["all"] = TypeSystem::All;
+                }
+
+                QString languageAttribute = attributes["class"].toLower();
+                TypeSystem::Language lang = languageNames.value(languageAttribute, TypeSystem::NoLanguage);
+                if (lang == TypeSystem::NoLanguage) {
+                    m_error = QString("unsupported class attribute: '%1'").arg(languageAttribute);
+                    return false;
+                }
+
+                m_function_mods.last().removal = lang;
+            }
+            break;
+        case StackElement::Rename:
+        case StackElement::Access:
+            {
+                if (topElement.type != StackElement::ModifyField
+                    && topElement.type != StackElement::ModifyFunction) {
+                    m_error = "Function or field modification parent required";
+                    return false;
+                }
+
+                Modification *mod = 0;
+                if (topElement.type == StackElement::ModifyFunction)
+                    mod = &m_function_mods.last();
+                else
+                    mod = &m_field_mods.last();
+
+                QString modifier;
+                if (element->type == StackElement::Rename) {
+                    modifier = "rename";
+                    QString renamed_to = attributes["to"];
+                    if (renamed_to.isEmpty()) {
+                        m_error = "Rename modifier requires 'to' attribute";
+                        return false;
+                    }
+
+                    if (topElement.type == StackElement::ModifyFunction)
+                        mod->setRenamedTo(renamed_to);
+                    else
+                        mod->setRenamedTo(renamed_to);
+                } else {
+                    modifier = attributes["modifier"].toLower();
+                }
+
+                if (modifier.isEmpty()) {
+                    m_error = "No access modification specified";
+                    return false;
+                }
+
+                static QHash<QString, FunctionModification::Modifiers> modifierNames;
+                if (modifierNames.isEmpty()) {
+                    modifierNames["private"] = Modification::Private;
+                    modifierNames["public"] = Modification::Public;
+                    modifierNames["protected"] = Modification::Protected;
+                    modifierNames["friendly"] = Modification::Friendly;
+                    modifierNames["rename"] = Modification::Rename;
+                    modifierNames["final"] = Modification::Final;
+                    modifierNames["non-final"] = Modification::NonFinal;
+                }
+
+                if (!modifierNames.contains(modifier)) {
+                    m_error = QString("Unknown access modifier: '%1'").arg(modifier);
+                    return false;
+                }
+
+                mod->modifiers |= modifierNames[modifier];
+            }
+            break;
+        case StackElement::RemoveArgument:
+            if (topElement.type != StackElement::ModifyArgument) {
+                m_error = "Removing argument requires argument modification as parent";
+                return false;
+            }
+
+            m_function_mods.last().argument_mods.last().removed = true;
+
+            break;
+
+        case StackElement::ModifyField:
+            {
+                QString name = attributes["name"];
+                if (name.isEmpty())
+                    break;
+                FieldModification fm;
+                fm.name = name;
+                fm.modifiers = 0;
+
+                QString read = attributes["read"];
+                QString write = attributes["write"];
+
+                if (read == "true") fm.modifiers |= FieldModification::Readable;
+                if (write == "true") fm.modifiers |= FieldModification::Writable;
+
+                m_field_mods << fm;
+            }
+            break;
+        case StackElement::AddClass: // qtd - fully :)
+            {
+                if (!(topElement.type & StackElement::ComplexTypeEntryMask)) {
+                    m_error = QString::fromLatin1("Add class to module requires complex type as parent"
+                                                  ", was=%1").arg(topElement.type, 0, 16);
+                    return false;
+                }
+                QString class_name = attributes["name"];
+                ComplexTypeEntry *ctype = static_cast<ComplexTypeEntry *>(topElement.entry);
+                if(!class_name.isEmpty())
+                    ctype->includedClasses << class_name;
+            }
+            break;
+        case StackElement::ModifyFunction:
+            {
+                if (!(topElement.type & StackElement::ComplexTypeEntryMask)) {
+                    m_error = QString::fromLatin1("Modify function requires complex type as parent"
+                                                  ", was=%1").arg(topElement.type, 0, 16);
+                    return false;
+                }
+                QString signature = attributes["signature"];
+
+                signature = QMetaObject::normalizedSignature(signature.toLocal8Bit().constData());
+                if (signature.isEmpty()) {
+                    m_error = "No signature for modified function";
+                    return false;
+                }
+
+                FunctionModification mod;
+                mod.signature = signature;
+
+                QString access = attributes["access"].toLower();
+                if (!access.isEmpty()) {
+                    if (access == QLatin1String("private"))
+                        mod.modifiers |= Modification::Private;
+                    else if (access == QLatin1String("protected"))
+                        mod.modifiers |= Modification::Protected;
+                    else if (access == QLatin1String("public"))
+                        mod.modifiers |= Modification::Public;
+                    else if (access == QLatin1String("final"))
+                        mod.modifiers |= Modification::Final;
+                    else if (access == QLatin1String("non-final"))
+                        mod.modifiers |= Modification::NonFinal;
+                    else {
+                        m_error = QString::fromLatin1("Bad access type '%1'").arg(access);
+                        return false;
+                    }
+                }
+
+                if (convertBoolean(attributes["deprecated"], "deprecated", false)) {
+                    mod.modifiers |= Modification::Deprecated;
+                }
+
+                QString remove = attributes["remove"].toLower();
+                if (!remove.isEmpty()) {
+                    if (remove == QLatin1String("all"))
+                        mod.removal = TypeSystem::All;
+                    else if (remove == QLatin1String("java"))
+                        mod.removal = TypeSystem::TargetLangAndNativeCode;
+                    else {
+                        m_error = QString::fromLatin1("Bad removal type '%1'").arg(remove);
+                        return false;
+                    }
+                }
+
+                QString rename = attributes["rename"];
+                if (!rename.isEmpty()) {
+                    mod.renamedToName = rename;
+                    mod.modifiers |= Modification::Rename;
+                }
+
+                QString association = attributes["associated-to"];
+                if (!association.isEmpty())
+                    mod.association = association;
+
+                mod.modifiers |= (convertBoolean(attributes["virtual-slot"], "virtual-slot", false) ? Modification::VirtualSlot : 0);
+
+                m_function_mods << mod;
+            }
+            break;
+        case StackElement::ReplaceDefaultExpression:
+            if (!(topElement.type & StackElement::ModifyArgument)) {
+                m_error = "Replace default expression only allowed as child of argument modification";
+                return false;
+            }
+
+            if (attributes["with"].isEmpty()) {
+               m_error = "Default expression replaced with empty string. Use remove-default-expression instead.";
+               return false;
+            }
+
+            m_function_mods.last().argument_mods.last().replaced_default_expression = attributes["with"];
+            break;
+        case StackElement::RemoveDefaultExpression:
+            m_function_mods.last().argument_mods.last().removed_default_expression = true;
+            break;
+        case StackElement::CustomMetaConstructor:
+        case StackElement::CustomMetaDestructor:
+            {
+                CustomFunction *func = new CustomFunction(attributes["name"]);
+                func->param_name = attributes["param-name"];
+                element->value.customFunction = func;
+            }
+            break;
+        case StackElement::ReferenceCount:
+            {
+                if (topElement.type != StackElement::ModifyArgument) {
+                    m_error = "reference-count must be child of modify-argument";
+                    return false;
+                }
+
+                ReferenceCount rc;
+                rc.threadSafe = convertBoolean(attributes["thread-safe"], "thread-safe", false);
+
+                static QHash<QString, ReferenceCount::Action> actions;
+                if (actions.isEmpty()) {
+                    actions["add"] = ReferenceCount::Add;
+                    actions["add-all"] = ReferenceCount::AddAll;
+                    actions["remove"] = ReferenceCount::Remove;
+                    actions["set"] = ReferenceCount::Set;
+                    actions["ignore"] = ReferenceCount::Ignore;
+                }
+                rc.action = actions.value(attributes["action"].toLower(), ReferenceCount::Invalid);
+
+                rc.variableName = attributes["variable-name"];
+                if (rc.action != ReferenceCount::Ignore && rc.variableName.isEmpty()) {
+                    m_error = "variable-name attribute must be specified";
+                    return false;
+                }
+
+                rc.declareVariable = attributes["declare-variable"];
+                rc.conditional = attributes["conditional"];
+
+                static QHash<QString, int> accessRights;
+                if (accessRights.isEmpty()) {
+                    accessRights["private"] = ReferenceCount::Private;
+                    accessRights["public"] = ReferenceCount::Public;
+                    accessRights["protected"] = ReferenceCount::Protected;
+                    accessRights["friendly"] = ReferenceCount::Friendly;
+                }
+                rc.access = accessRights.value(attributes["access"].toLower(), 0);
+                if (rc.access == 0) {
+                    m_error = "unrecognized access value: " + attributes["access"];
+                    return false;
+                }
+
+                if (rc.action == ReferenceCount::Invalid) {
+                    m_error = "unrecognized value for action attribute. supported actions:";
+                    foreach (QString action, actions.keys())
+                        m_error += " " + action;
+                }
+
+                m_function_mods.last().argument_mods.last().referenceCounts.append(rc);
+            }
+            break;
+        case StackElement::InjectCode:
+            {
+                if (((topElement.type & StackElement::ComplexTypeEntryMask) == 0)
+                    && (topElement.type != StackElement::ModifyFunction)
+                    && (topElement.type != StackElement::Root)) {
+                    m_error = "wrong parent type for code injection";
+                    return false;
+                }
+
+                static QHash<QString, TypeSystem::Language> languageNames;
+                if (languageNames.isEmpty()) {
+                    languageNames["java"] = TypeSystem::TargetLangCode;
+                    languageNames["native"] = TypeSystem::NativeCode;
+                    languageNames["shell"] = TypeSystem::ShellCode;
+                    languageNames["shell-declaration"] = TypeSystem::ShellDeclaration;
+                    languageNames["library-initializer"] = TypeSystem::PackageInitializer;
+                    languageNames["destructor-function"] = TypeSystem::DestructorFunction;
+                    languageNames["constructors"] = TypeSystem::Constructors;
+                    languageNames["interface"] = TypeSystem::Interface;
+                }
+
+                QString className = attributes["class"].toLower();
+                if (!languageNames.contains(className)) {
+                    m_error = QString("Invalid class specifier: '%1'").arg(className);
+                    return false;
+                }
+
+
+                static QHash<QString, CodeSnip::Position> positionNames;
+                if (positionNames.isEmpty()) {
+                    positionNames["beginning"] = CodeSnip::Beginning;
+                    positionNames["end"] = CodeSnip::End;
+                }
+
+                QString position = attributes["position"].toLower();
+                if (!positionNames.contains(position)) {
+                    m_error = QString("Invalid position: '%1'").arg(position);
+                    return false;
+                }
+
+                CodeSnip snip;
+                snip.language = languageNames[className];
+                snip.position = positionNames[position];
+
+                if (snip.language == TypeSystem::Interface && topElement.type != StackElement::InterfaceTypeEntry) {
+                    m_error = "Interface code injections must be direct child of an interface type entry";
+                    return false;
+                }
+
+                if (topElement.type == StackElement::ModifyFunction) {
+                    FunctionModification mod = m_function_mods.last();
+                    if (snip.language == TypeSystem::ShellDeclaration) {
+                        m_error = "no function implementation in shell declaration in which to inject code";
+                        return false;
+                    }
+
+                    m_function_mods.last().snips << snip;
+                    element->type = StackElement::InjectCodeInFunction;
+                } else if (topElement.type == StackElement::Root) {
+                    ((TypeSystemTypeEntry *) element->entry)->snips << snip;
+
+                } else if (topElement.type != StackElement::Root) {
+                    m_code_snips << snip;
+                }
+            }
+            break;
+        case StackElement::Include:
+            {
+                QString location = attributes["location"].toLower();
+
+                static QHash<QString, Include::IncludeType> locationNames;
+                if (locationNames.isEmpty()) {
+                    locationNames["global"] = Include::IncludePath;
+                    locationNames["local"] = Include::LocalPath;
+                    locationNames["java"] = Include::TargetLangImport;
+                }
+
+                if (!locationNames.contains(location)) {
+                    m_error = QString("Location not recognized: '%1'").arg(location);
+                    return false;
+                }
+
+                Include::IncludeType loc = locationNames[location];
+                Include inc(loc, attributes["file-name"]);
+
+                ComplexTypeEntry *ctype = static_cast<ComplexTypeEntry *>(element->entry);
+                if (topElement.type & StackElement::ComplexTypeEntryMask) {
+                    ctype->setInclude(inc);
+                } else if (topElement.type == StackElement::ExtraIncludes) {
+                    ctype->addExtraInclude(inc);
+                } else {
+                    m_error = "Only supported parents are complex types and extra-includes";
+                    return false;
+                }
+
+                inc = ctype->include();
+                IncludeList lst = ctype->extraIncludes();
+                ctype = ctype->designatedInterface();
+                if (ctype != 0) {
+                    ctype->setExtraIncludes(lst);
+                    ctype->setInclude(inc);
+                }
+            }
+            break;
+        case StackElement::Rejection:
+            {
+                QString cls = attributes["class"];
+                QString function = attributes["function-name"];
+                QString field = attributes["field-name"];
+                QString enum_ = attributes["enum-name"];
+                if (cls == "*" && function == "*" && field == "*" && enum_ == "*") {
+                    m_error = "bad reject entry, neither 'class', 'function-name' nor "
+                              "'field' specified";
+                    return false;
+                }
+                m_database->addRejection(cls, function, field, enum_);
+            }
+            break;
+        case StackElement::Template:
+            element->value.templateEntry = new TemplateEntry(attributes["name"]);
+            break;
+        case StackElement::TemplateInstanceEnum:
+            if (!(topElement.type & StackElement::CodeSnipMask) &&
+                  (topElement.type != StackElement::Template) &&
+                  (topElement.type != StackElement::CustomMetaConstructor) &&
+                  (topElement.type != StackElement::CustomMetaDestructor) &&
+                  (topElement.type != StackElement::ConversionRule))
+            {
+                m_error = "Can only insert templates into code snippets, templates, custom-constructors, custom-destructors or conversion-rule.";
+                return false;
+            }
+            element->value.templateInstance = new TemplateInstance(attributes["name"]);
+            break;
+        case StackElement::Replace:
+            if (topElement.type != StackElement::TemplateInstanceEnum) {
+                m_error = "Can only insert replace rules into insert-template.";
+                return false;
+            }
+            element->parent->value.templateInstance->addReplaceRule(attributes["from"],attributes["to"]);
+            break;
+        default:
+            break; // nada
+        };
+    }
+
+    current = element;
+    return true;
+}
+
+TypeDatabase *TypeDatabase::instance()
+{
+    static TypeDatabase *db = new TypeDatabase();
+    return db;
+}
+
+TypeDatabase::TypeDatabase() : m_suppressWarnings(true), m_includeEclipseWarnings(false)
+{
+    addType(new StringTypeEntry("QString"));
+
+    StringTypeEntry *e = new StringTypeEntry("QLatin1String");
+    e->setPreferredConversion(false);
+    addType(e);
+
+    e = new StringTypeEntry("QStringRef");
+    e->setPreferredConversion(false);
+    addType(e);
+
+    e = new StringTypeEntry("QXmlStreamStringRef");
+    e->setPreferredConversion(false);
+    addType(e);
+
+    addType(new CharTypeEntry("QChar"));
+
+    CharTypeEntry *c = new CharTypeEntry("QLatin1Char");
+    c->setPreferredConversion(false);
+    addType(c);
+
+    {
+        VariantTypeEntry *qvariant = new VariantTypeEntry("QVariant");
+        qvariant->setCodeGeneration(TypeEntry::GenerateAll);
+        addType(qvariant);
+    }
+
+    {
+        JObjectWrapperTypeEntry *wrapper = new JObjectWrapperTypeEntry("JObjectWrapper");
+        wrapper->setCodeGeneration(TypeEntry::GenerateNothing);
+        addType(wrapper);
+    }
+
+    addType(new ThreadTypeEntry());
+    addType(new VoidTypeEntry());
+
+    // Predefined containers...
+    addType(new ContainerTypeEntry("QList", ContainerTypeEntry::ListContainer));
+    addType(new ContainerTypeEntry("QStringList", ContainerTypeEntry::StringListContainer));
+    addType(new ContainerTypeEntry("QLinkedList", ContainerTypeEntry::LinkedListContainer));
+    addType(new ContainerTypeEntry("QVector", ContainerTypeEntry::VectorContainer));
+    addType(new ContainerTypeEntry("QStack", ContainerTypeEntry::StackContainer));
+    addType(new ContainerTypeEntry("QSet", ContainerTypeEntry::SetContainer));
+    addType(new ContainerTypeEntry("QMap", ContainerTypeEntry::MapContainer));
+    addType(new ContainerTypeEntry("QHash", ContainerTypeEntry::HashContainer));
+    addType(new ContainerTypeEntry("QPair", ContainerTypeEntry::PairContainer));
+    addType(new ContainerTypeEntry("QQueue", ContainerTypeEntry::QueueContainer));
+    addType(new ContainerTypeEntry("QMultiMap", ContainerTypeEntry::MultiMapContainer));
+
+    // Custom types...
+//    addType(new QModelIndexTypeEntry());
+
+    addRemoveFunctionToTemplates(this);
+}
+
+bool TypeDatabase::parseFile(const QString &filename, bool generate)
+{
+    QFile file(filename);
+    Q_ASSERT(file.exists());
+    QXmlInputSource source(&file);
+
+    int count = m_entries.size();
+
+    QXmlSimpleReader reader;
+    Handler handler(this, generate);
+
+    reader.setContentHandler(&handler);
+    reader.setErrorHandler(&handler);
+
+    bool ok = reader.parse(&source, false);
+
+    int newCount = m_entries.size();
+
+    ReportHandler::debugSparse(QString::fromLatin1("Parsed: '%1', %2 new entries")
+                               .arg(filename)
+                               .arg(newCount - count));
+
+    return ok;
+}
+
+QString PrimitiveTypeEntry::javaObjectName() const
+{
+    static QHash<QString, QString> table;
+    if (table.isEmpty()) {
+        table["boolean"] = "Boolean";
+        table["byte"] = "Byte";
+        table["char"] = "Character";
+        table["short"] = "Short";
+        table["int"] = "Integer";
+        table["long"] = "Long";
+        table["float"] = "Float";
+        table["double"] = "Double";
+    }
+    Q_ASSERT(table.contains(targetLangName()));
+    return table[targetLangName()];
+}
+
+ContainerTypeEntry *TypeDatabase::findContainerType(const QString &name)
+{
+    QString template_name = name;
+
+    int pos = name.indexOf('<');
+    if (pos > 0)
+        template_name = name.left(pos);
+
+    TypeEntry *type_entry = findType(template_name);
+    if (type_entry && type_entry->isContainer())
+        return static_cast<ContainerTypeEntry *>(type_entry);
+    return 0;
+}
+
+PrimitiveTypeEntry *TypeDatabase::findTargetLangPrimitiveType(const QString &java_name)
+{
+    foreach (QList<TypeEntry *> entries, m_entries.values()) {
+        foreach (TypeEntry *e, entries) {
+            if (e && e->isPrimitive()) {
+                PrimitiveTypeEntry *pe = static_cast<PrimitiveTypeEntry *>(e);
+                if (pe->targetLangName() == java_name && pe->preferredConversion())
+                    return pe;
+            }
+        }
+    }
+
+    return 0;
+}
+
+IncludeList TypeDatabase::extraIncludes(const QString &className)
+{
+    ComplexTypeEntry *typeEntry = findComplexType(className);
+    if (typeEntry != 0)
+        return typeEntry->extraIncludes();
+    else
+        return IncludeList();
+}
+
+
+
+QString Include::toString() const
+{
+    if (type == IncludePath)
+        return "#include <" + name + '>';
+    else if (type == LocalPath)
+        return "#include \"" + name + "\"";
+    else
+        return "import " + name + ";";
+}
+
+QString Modification::accessModifierString() const
+{
+    if (isPrivate()) return "private";
+    if (isProtected()) return "protected";
+    if (isPublic()) return "public";
+    if (isFriendly()) return "friendly";
+    return QString();
+}
+
+FunctionModificationList ComplexTypeEntry::functionModifications(const QString &signature) const
+{
+    FunctionModificationList lst;
+    for (int i=0; i<m_function_mods.count(); ++i) {
+        FunctionModification mod = m_function_mods.at(i);
+        if (mod.signature == signature) {
+            lst << mod;
+        }
+    }
+
+    return lst;
+}
+
+FieldModification ComplexTypeEntry::fieldModification(const QString &name) const
+{
+    for (int i=0; i<m_field_mods.size(); ++i)
+        if (m_field_mods.at(i).name == name)
+            return m_field_mods.at(i);
+    FieldModification mod;
+    mod.name = name;
+    mod.modifiers = FieldModification::Readable | FieldModification::Writable;
+    return mod;
+}
+
+QString ContainerTypeEntry::javaPackage() const
+{
+    if (m_type == PairContainer)
+        return "qt";
+    return "java.util";
+}
+
+QString ContainerTypeEntry::targetLangName() const
+{
+
+    switch (m_type) {
+    case StringListContainer: return "List";
+    case ListContainer: return "List";
+    case LinkedListContainer: return "LinkedList";
+    case VectorContainer: return "List";
+    case StackContainer: return "Stack";
+    case QueueContainer: return "Queue";
+    case SetContainer: return "Set";
+    case MapContainer: return "SortedMap";
+    case MultiMapContainer: return "SortedMap";
+    case HashContainer: return "HashMap";
+        //     case MultiHashCollectio: return "MultiHash";
+    case PairContainer: return "QPair";
+    default:
+        qWarning("bad type... %d", m_type);
+        break;
+    }
+    return QString();
+}
+
+QString ContainerTypeEntry::qualifiedCppName() const
+{
+    if (m_type == StringListContainer)
+        return "QStringList";
+    return ComplexTypeEntry::qualifiedCppName();
+}
+
+QString EnumTypeEntry::javaQualifier() const
+{
+    TypeEntry *te = TypeDatabase::instance()->findType(m_qualifier);
+    if (te != 0)
+        return te->targetLangName();
+    else
+        return m_qualifier;
+}
+
+QString EnumTypeEntry::jniName() const
+{
+    return "jint";
+}
+
+QString FlagsTypeEntry::jniName() const
+{
+    return "jint";
+}
+
+void EnumTypeEntry::addEnumValueRedirection(const QString &rejected, const QString &usedValue)
+{
+    m_enum_redirections << EnumValueRedirection(rejected, usedValue);
+}
+
+QString EnumTypeEntry::enumValueRedirection(const QString &value) const
+{
+    for (int i=0; i<m_enum_redirections.size(); ++i)
+        if (m_enum_redirections.at(i).rejected == value)
+            return m_enum_redirections.at(i).used;
+    return QString();
+}
+
+QString FlagsTypeEntry::qualifiedTargetLangName() const
+{
+    return m_enum->javaQualifier() + "." + targetLangName();
+}
+
+
+void TypeDatabase::addRejection(const QString &class_name, const QString &function_name,
+                                const QString &field_name, const QString &enum_name)
+{
+    TypeRejection r;
+    r.class_name = class_name;
+    r.function_name = function_name;
+    r.field_name = field_name;
+    r.enum_name = enum_name;
+
+    m_rejections << r;
+}
+
+bool TypeDatabase::isClassRejected(const QString &class_name)
+{
+    if (!m_rebuild_classes.isEmpty())
+        return !m_rebuild_classes.contains(class_name);
+
+    foreach (const TypeRejection &r, m_rejections)
+        if (r.class_name == class_name && r.function_name == "*" && r.field_name == "*" && r.enum_name == "*") {
+            return true;
+        }
+    return false;
+}
+
+bool TypeDatabase::isEnumRejected(const QString &class_name, const QString &enum_name)
+{
+    foreach (const TypeRejection &r, m_rejections) {
+        if (r.enum_name == enum_name
+            && (r.class_name == class_name || r.class_name == "*")) {
+            return true;
+        }
+    }
+
+    return false;
+}
+
+bool TypeDatabase::isFunctionRejected(const QString &class_name, const QString &function_name)
+{
+    foreach (const TypeRejection &r, m_rejections)
+        if (r.function_name == function_name &&
+            (r.class_name == class_name || r.class_name == "*"))
+            return true;
+    return false;
+}
+
+
+bool TypeDatabase::isFieldRejected(const QString &class_name, const QString &field_name)
+{
+    foreach (const TypeRejection &r, m_rejections)
+        if (r.field_name == field_name &&
+            (r.class_name == class_name || r.class_name == "*"))
+            return true;
+    return false;
+}
+
+FlagsTypeEntry *TypeDatabase::findFlagsType(const QString &name) const
+{
+    FlagsTypeEntry *fte = (FlagsTypeEntry *) findType(name);
+    return fte ? fte : (FlagsTypeEntry *) m_flags_entries.value(name);
+}
+
+QString TypeDatabase::globalNamespaceClassName(const TypeEntry * /*entry*/) {
+    return QLatin1String("Global");
+}
+
+
+/*!
+ * The Visual Studio 2002 compiler doesn't support these symbols,
+ * which our typedefs unforntuatly expand to.
+ */
+QString fixCppTypeName(const QString &name)
+{
+    if (name == "long long") return "qint64";
+    else if (name == "unsigned long long") return "quint64";
+    return name;
+}
+
+QString formattedCodeHelper(QTextStream &s, Indentor &indentor, QStringList &lines) {
+    bool multilineComment = false;
+    bool lastEmpty = true;
+    QString lastLine;
+    while (!lines.isEmpty()) {
+        const QString line = lines.takeFirst().trimmed();
+        if (line.isEmpty()) {
+            if (!lastEmpty)
+                s << endl;
+            lastEmpty = true;
+            continue;
+        } else {
+            lastEmpty = false;
+        }
+        if (line.startsWith("/*"))
+            multilineComment = true;
+
+        if (multilineComment) {
+            s << indentor;
+            if (line.startsWith("*"))
+                s << " ";
+            s << line << endl;
+            if (line.endsWith("*/"))
+                multilineComment = false;
+        } else if (line.startsWith("}")) {
+            return line;
+        } else if (line.endsWith("}")) {
+            s << indentor << line << endl;
+            return 0;
+        } else if(line.endsWith("{")) {
+            s << indentor << line << endl;
+            QString tmp;
+            {
+                Indentation indent(indentor);
+                tmp = formattedCodeHelper(s, indentor, lines);
+            }
+            if (!tmp.isNull()) {
+                s << indentor << tmp << endl;
+            }
+            lastLine = tmp;
+            continue;
+        } else {
+            s << indentor;
+            if (!lastLine.isEmpty() &&
+                !lastLine.endsWith(";") &&
+                !line.startsWith("@") &&
+                !line.startsWith("//") &&
+                !lastLine.startsWith("//") &&
+                !lastLine.endsWith("}") &&
+                !line.startsWith("{"))
+                s << "    ";
+            s << line << endl;
+        }
+        lastLine = line;
+    }
+    return 0;
+}
+
+
+QTextStream &CodeSnip::formattedCode(QTextStream &s, Indentor &indentor) const
+{
+    QStringList lst(code().split("\n"));
+    while (!lst.isEmpty()) {
+        QString tmp = formattedCodeHelper(s, indentor, lst);
+        if (!tmp.isNull()) {
+            s << indentor << tmp << endl;
+        }
+    }
+    s.flush();
+    return s;
+}
+
+QString TemplateInstance::expandCode() const{
+    TemplateEntry *templateEntry = TypeDatabase::instance()->findTemplate(m_name);
+    if(templateEntry){
+        QString res = templateEntry->code();
+        foreach(QString key, replaceRules.keys()){
+            res.replace(key, replaceRules[key]);
+        }
+        return "// TEMPLATE - " + m_name + " - START" + res + "// TEMPLATE - " + m_name + " - END";
+    }
+    else{
+        ReportHandler::warning("insert-template referring to non-existing template '" + m_name + "'");
+    }
+    return QString();
+}
+
+
+QString CodeSnipAbstract::code() const{
+    QString res;
+    foreach(CodeSnipFragment *codeFrag, codeList){
+        res.append(codeFrag->code());
+    }
+    return res;
+}
+
+QString CodeSnipFragment::code() const{
+    if(m_instance)
+        return m_instance->expandCode();
+    else
+        return m_code;
+}
+
+QString FunctionModification::toString() const
+{
+    QString str = signature + QLatin1String("->");
+    if (modifiers & AccessModifierMask) {
+        switch (modifiers & AccessModifierMask) {
+        case Private: str += QLatin1String("private"); break;
+        case Protected: str += QLatin1String("protected"); break;
+        case Public: str += QLatin1String("public"); break;
+        case Friendly: str += QLatin1String("friendly"); break;
+        }
+    }
+
+    if (modifiers & Final) str += QLatin1String("final");
+    if (modifiers & NonFinal) str += QLatin1String("non-final");
+
+    if (modifiers & Readable) str += QLatin1String("readable");
+    if (modifiers & Writable) str += QLatin1String("writable");
+
+    if (modifiers & CodeInjection) {
+        foreach (CodeSnip s, snips) {
+            str += QLatin1String("\n//code injection:\n");
+            str += s.code();
+        }
+    }
+
+    if (modifiers & Rename) str += QLatin1String("renamed:") + renamedToName;
+
+    if (modifiers & Deprecated) str += QLatin1String("deprecate");
+
+    if (modifiers & ReplaceExpression) str += QLatin1String("replace-expression");
+
+    return str;
+}
+
+static void removeFunction(ComplexTypeEntry *e, const char *signature)
+{
+    FunctionModification mod;
+    mod.signature = QMetaObject::normalizedSignature(signature);
+    mod.removal = TypeSystem::All;
+
+    e->addFunctionModification(mod);
+}
+
+
+
+
+static void injectCode(ComplexTypeEntry *e,
+                       const char *signature,
+                       const QByteArray &code,
+                       const ArgumentMap &args,
+                       TypeSystem::Language lang = TypeSystem::NativeCode)
+{
+    CodeSnip snip;
+    snip.language = lang;
+    snip.position = CodeSnip::Beginning;
+    snip.addCode(QString::fromLatin1(code));
+    snip.argumentMap = args;
+
+    FunctionModification mod;
+    mod.signature = QMetaObject::normalizedSignature(signature);
+    mod.snips << snip;
+    mod.modifiers = Modification::CodeInjection;
+    e->addFunctionModification(mod);
+}
+
+
+static void addRemoveFunctionToTemplates(TypeDatabase *db)
+{
+    ContainerTypeEntry *qvector = db->findContainerType(QLatin1String("QVector"));
+    removeFunction(qvector, "constData() const");
+    removeFunction(qvector, "data() const");
+    removeFunction(qvector, "data()");
+    removeFunction(qvector, "first()");
+    removeFunction(qvector, "last()");
+    removeFunction(qvector, "operator[](int)");
+    removeFunction(qvector, "operator[](int) const");
+    removeFunction(qvector, "operator=(QVector<T>)");
+
+    ContainerTypeEntry *qlist = db->findContainerType(QLatin1String("QList"));
+    removeFunction(qlist, "constData() const");
+    removeFunction(qlist, "data() const");
+    removeFunction(qlist, "data()");
+    removeFunction(qlist, "back()");
+    removeFunction(qlist, "front()");
+    removeFunction(qlist, "first()");
+    removeFunction(qlist, "last()");
+    removeFunction(qlist, "operator[](int)");
+    removeFunction(qlist, "operator[](int) const");
+    removeFunction(qlist, "operator=(QList<T>)");
+
+    ContainerTypeEntry *qqueue = db->findContainerType(QLatin1String("QQueue"));
+    removeFunction(qqueue, "head() const");
+
+
+    ArgumentMap args1;
+    args1[1] = QLatin1String("$1");
+    ArgumentMap args2 = args1;
+    args2[2] = QLatin1String("$2");
+
+    QByteArray code =
+        "\nif ($1 >= __qt_this->size() || $1 < 0) {"
+        "\n   __jni_env->ThrowNew(__jni_env->FindClass(\"java/lang/IndexOutOfBoundsException\"),"
+        "\n                       QString::fromLatin1(\"Accessing container of size %3 at %4\")"
+        "\n                       .arg(__qt_this->size()).arg($1).toLatin1());"
+        "\n   return;"
+        "\n}";
+
+    QByteArray code_with_return = QByteArray(code).replace("return;", "return 0;");
+
+    QByteArray code_index_length =
+        "\nif ($1 < 0 || $2 < 0 || ($1 + $2) >= __qt_this->size()) {"
+        "\n   __jni_env->ThrowNew(__jni_env->FindClass(\"java/lang/IndexOutOfBoundsException\"),"
+        "\n                       QString::fromLatin1(\"Accessing container of size %3 from %4 to %5\")"
+        "\n                       .arg(__qt_this->size()).arg($1).arg($1+$2).toLatin1());"
+        "\n   return;"
+        "\n}";
+
+    QByteArray code_non_empty =
+        "\nif (__qt_this->isEmpty()) {"
+        "\n   __jni_env->ThrowNew(__jni_env->FindClass(\"java/lang/IndexOutOfBoundsException\"),"
+        "\n                       QString::fromLatin1(\"Accessing empty container...\").toLatin1());"
+        "\n   return;"
+        "\n}";
+
+    QByteArray code_two_indices =
+        "\nif ($1 < 0 || $2 < 0 || $1 >= __qt_this->size() || $2 >= __qt_this->size()) {"
+        "\n   __jni_env->ThrowNew(__jni_env->FindClass(\"java/lang/IndexOutOfBoundsException\"),"
+        "\n                       QString::fromLatin1(\"Accessing container of size %3 from %4 to %5\")"
+        "\n                       .arg(__qt_this->size()).arg($1).arg($1+$2).toLatin1());"
+        "\n   return;"
+        "\n}";
+/* qtd2
+    { // QVector safty...
+        injectCode(qvector, "at(int) const", code_with_return, args1, TypeSystem::TargetLangCode);
+        injectCode(qvector, "replace(int,T)", code, args1, TypeSystem::TargetLangCode);
+        injectCode(qvector, "remove(int)", code, args1, TypeSystem::TargetLangCode);
+        injectCode(qvector, "remove(int, int)", code_index_length, args2, TypeSystem::TargetLangCode);
+        injectCode(qvector, "pop_back()", code_non_empty, ArgumentMap(), TypeSystem::TargetLangCode);
+        injectCode(qvector, "pop_front()", code_non_empty, ArgumentMap(), TypeSystem::TargetLangCode);
+    }
+
+    { // QList safty...
+        injectCode(qlist, "at(int) const", code_with_return, args1);
+        injectCode(qlist, "replace(int, T)", code, args1);
+        injectCode(qlist, "pop_back()", code_non_empty, ArgumentMap());
+        injectCode(qlist, "pop_front()", code_non_empty, ArgumentMap());
+        injectCode(qlist, "swap(int, int)", code_two_indices, args2);
+        injectCode(qlist, "move(int, int)", code_two_indices, args2);
+        injectCode(qlist, "removeAt(int)", code, args1);
+        injectCode(qlist, "takeAt(int)", code_with_return, args1);
+    }
+*/
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/typesystem.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,1246 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#ifndef TYPESYSTEM_H
+#define TYPESYSTEM_H
+
+#include <QtCore/QHash>
+#include <QtCore/QString>
+#include <QtCore/QStringList>
+#include <QtCore/QMap>
+#include <QDebug>
+
+class Indentor;
+
+class AbstractMetaType;
+class QTextStream;
+
+class EnumTypeEntry;
+class FlagsTypeEntry;
+
+extern QString strings_Object;
+extern QString strings_String;
+extern QString strings_Thread;
+extern QString strings_char;
+extern QString strings_java_lang;
+extern QString strings_jchar;
+extern QString strings_jobject;
+
+struct Include
+{
+    enum IncludeType {
+        IncludePath,
+        LocalPath,
+        TargetLangImport
+    };
+
+    Include() : type(IncludePath) { }
+    Include(IncludeType t, const QString &nam) : type(t), name(nam) { };
+
+    bool isValid() { return !name.isEmpty(); }
+
+    IncludeType type;
+    QString name;
+
+    QString toString() const;
+
+    bool operator<(const Include &other) const { return name < other.name; }
+};
+typedef QList<Include> IncludeList;
+
+typedef QMap<int, QString> ArgumentMap;
+
+class TemplateInstance;
+
+namespace TypeSystem {
+    enum Language {
+        NoLanguage          = 0x0000,
+        TargetLangCode      = 0x0001,
+        NativeCode          = 0x0002,
+        ShellCode           = 0x0004,
+        ShellDeclaration    = 0x0008,
+        PackageInitializer  = 0x0010,
+        DestructorFunction  = 0x0020,
+        Constructors        = 0x0040,
+        Interface           = 0x0080,
+
+        // masks
+        All                 = TargetLangCode
+                              | NativeCode
+                              | ShellCode
+                              | ShellDeclaration
+                              | PackageInitializer
+                              | Constructors
+                              | Interface
+                              | DestructorFunction,
+
+        JavaAndNativeCode   = TargetLangCode | NativeCode,
+        TargetLangAndNativeCode   = TargetLangCode | NativeCode
+    };
+
+    enum Ownership {
+        InvalidOwnership,
+        DefaultOwnership,
+        TargetLangOwnership,
+        CppOwnership
+    };
+};
+
+struct ReferenceCount
+{
+    ReferenceCount() : threadSafe(false), access(Public) { }
+    enum Action { // 0x01 - 0xff
+        Invalid     = 0x00,
+        Add         = 0x01,
+        AddAll      = 0x02,
+        Remove      = 0x04,
+        Set         = 0x08,
+        Ignore      = 0x10,
+
+        ActionsMask = 0xff,
+
+        Padding     = 0xffffffff
+    };
+
+    enum Flag { // 0x100 - 0xf00
+        ThreadSafe      = 0x100,
+        Static          = 0x200,
+        DeclareVariable = 0x400,
+
+        FlagsMask       = 0xf00
+    };
+
+    enum Access { // 0x1000 - 0xf000
+        Private     = 0x1000,
+        Protected   = 0x2000,
+        Friendly    = 0x3000,
+        Public      = 0x4000,
+
+        AccessMask  = 0xf000
+    };
+
+    Action action;
+    QString variableName;
+    QString conditional;
+    QString declareVariable;
+
+    uint threadSafe : 1;
+
+    uint access;
+};
+
+class CodeSnipFragment{
+    private:
+        const QString m_code;
+        TemplateInstance *m_instance;
+
+    public:
+        CodeSnipFragment(const QString &code)
+    : m_code(code),
+        m_instance(0)
+        {}
+
+        CodeSnipFragment(TemplateInstance *instance)
+    : m_instance(instance)
+        {}
+
+        QString code() const;
+};
+
+class CodeSnipAbstract{
+public:
+    QString code() const;
+
+    void addCode(const QString &code){
+        codeList.append(new CodeSnipFragment(code));
+    }
+
+    void addTemplateInstance(TemplateInstance *ti){
+        codeList.append(new CodeSnipFragment(ti));
+    }
+
+    QList<CodeSnipFragment*> codeList;
+};
+
+class CustomFunction : public CodeSnipAbstract
+{
+    public:
+        CustomFunction(const QString &n = QString()) : name(n) { }
+
+        QString name;
+        QString param_name;
+};
+
+class TemplateEntry : public CodeSnipAbstract
+{
+public:
+    TemplateEntry(const QString &name)
+        : m_name(name)
+        {
+        };
+
+    QString name() const {
+        return m_name;
+    };
+
+private:
+    QString m_name;
+};
+
+typedef QHash<QString, TemplateEntry *> TemplateEntryHash;
+
+class TemplateInstance
+{
+    public:
+        TemplateInstance(const QString &name)
+           : m_name(name)
+        {}
+
+        void addReplaceRule(const QString &name, const QString &value){
+            replaceRules[name]=value;
+        }
+
+        QString expandCode() const;
+
+        QString name() const {
+            return m_name;
+        }
+
+    private:
+        const QString m_name;
+        QHash<QString, QString> replaceRules;
+};
+
+
+class CodeSnip : public CodeSnipAbstract
+{
+    public:
+        enum Position {
+            Beginning,
+            End,
+            AfterThis
+        };
+
+        CodeSnip() : language(TypeSystem::TargetLangCode) { }
+        CodeSnip(TypeSystem::Language lang) : language(lang) { }
+
+        // Very simple, easy to make code ugly if you try
+        QTextStream &formattedCode(QTextStream &s, Indentor &indentor) const;
+
+        TypeSystem::Language language;
+        Position position;
+        ArgumentMap argumentMap;
+};
+typedef QList<CodeSnip> CodeSnipList;
+
+struct ArgumentModification
+{
+    ArgumentModification(int idx) : removed_default_expression(false), removed(false), no_null_pointers(false), index(idx)
+    {}
+
+    // Should the default expression be removed?
+    uint removed_default_expression : 1;
+    uint removed : 1;
+    uint no_null_pointers : 1;
+    uint reset_after_use : 1;
+
+    // The index of this argument
+    int index;
+
+    // Reference count flags for this argument
+    QList<ReferenceCount> referenceCounts;
+
+    // The text given for the new type of the argument
+    QString modified_type;
+
+    QString replace_value;
+
+    // The code to be used to construct a return value when no_null_pointers is true and
+    // the returned value is null. If no_null_pointers is true and this string is
+    // empty, then the base class implementation will be used (or a default construction
+    // if there is no implementation)
+    QString null_pointer_default_value;
+
+    // The text of the new default expression of the argument
+    QString replaced_default_expression;
+
+    // The new definition of ownership for a specific argument
+    QHash<TypeSystem::Language, TypeSystem::Ownership> ownerships;
+
+    // Different conversion rules
+    CodeSnipList conversion_rules;
+};
+
+struct Modification {
+    enum Modifiers {
+        Private =               0x0001,
+        Protected =             0x0002,
+        Public =                0x0003,
+        Friendly =              0x0004,
+        AccessModifierMask =    0x000f,
+
+        Final =                 0x0010,
+        NonFinal =              0x0020,
+        FinalMask =             Final | NonFinal,
+
+        Readable =              0x0100,
+        Writable =              0x0200,
+
+        CodeInjection =         0x1000,
+        Rename =                0x2000,
+        Deprecated =            0x4000,
+        ReplaceExpression =     0x8000,
+        VirtualSlot =          0x10000 | NonFinal
+    };
+
+    Modification() : modifiers(0) { }
+
+    bool isAccessModifier() const { return modifiers & AccessModifierMask; }
+    Modifiers accessModifier() const { return Modifiers(modifiers & AccessModifierMask); }
+    bool isPrivate() const { return accessModifier() == Private; }
+    bool isProtected() const { return accessModifier() == Protected; }
+    bool isPublic() const { return accessModifier() == Public; }
+    bool isFriendly() const { return accessModifier() == Friendly; }
+    bool isFinal() const { return modifiers & Final; }
+    bool isNonFinal() const { return modifiers & NonFinal; }
+    bool isVirtualSlot() const { return (modifiers & VirtualSlot) == VirtualSlot; }
+    QString accessModifierString() const;
+
+    bool isDeprecated() const { return modifiers & Deprecated; }
+
+    void setRenamedTo(const QString &name) { renamedToName = name; }
+    QString renamedTo() const { return renamedToName; }
+    bool isRenameModifier() const { return modifiers & Rename; }
+
+    uint modifiers;
+    QString renamedToName;
+};
+
+struct FunctionModification: public Modification
+{
+    FunctionModification() : removal(TypeSystem::NoLanguage), store_result(false) { }
+
+    bool isCodeInjection() const { return modifiers & CodeInjection; }
+    bool isRemoveModifier() const { return removal != TypeSystem::NoLanguage; }
+
+    QString toString() const;
+
+    QString signature;
+    QString association;
+    CodeSnipList snips;
+    TypeSystem::Language removal;
+    bool store_result;
+
+    QList<ArgumentModification> argument_mods;
+};
+typedef QList<FunctionModification> FunctionModificationList;
+
+struct FieldModification: public Modification
+{
+    bool isReadable() const { return modifiers & Readable; }
+    bool isWritable() const { return modifiers & Writable; }
+
+    QString name;
+};
+typedef QList<FieldModification> FieldModificationList;
+
+struct ExpensePolicy {
+    ExpensePolicy() : limit(-1) { }
+    int limit;
+    QString cost;
+    bool isValid() const { return limit >= 0; }
+};
+
+class InterfaceTypeEntry;
+class ObjectTypeEntry;
+
+class TypeEntry
+{
+public:
+    enum Type {
+        PrimitiveType,
+        VoidType,
+        FlagsType,
+        EnumType,
+        TemplateArgumentType,
+        ThreadType,
+        BasicValueType,
+        StringType,
+        ContainerType,
+        InterfaceType,
+        ObjectType,
+        NamespaceType,
+        VariantType,
+        JObjectWrapperType,
+        CharType,
+        ArrayType,
+        TypeSystemType,
+        CustomType,
+    };
+
+    enum CodeGeneration {
+        GenerateTargetLang      = 0x0001,
+        GenerateCpp             = 0x0002,
+        GenerateForSubclass     = 0x0004,
+
+        GenerateNothing         = 0,
+        GenerateAll             = 0xffff,
+        GenerateCode            = GenerateTargetLang | GenerateCpp
+    };
+
+    TypeEntry(const QString &name, Type t)
+        : m_name(name),
+          m_type(t),
+          m_code_generation(GenerateAll),
+          m_preferred_conversion(true)
+    {
+    };
+
+    virtual ~TypeEntry() { }
+
+    Type type() const { return m_type; }
+    bool isPrimitive() const { return m_type == PrimitiveType; }
+    bool isEnum() const { return m_type == EnumType; }
+    bool isFlags() const { return m_type == FlagsType; }
+    bool isInterface() const { return m_type == InterfaceType; }
+    bool isObject() const { return m_type == ObjectType; }
+    bool isString() const { return m_type == StringType; }
+    bool isChar() const { return m_type == CharType; }
+    bool isNamespace() const { return m_type == NamespaceType; }
+    bool isContainer() const { return m_type == ContainerType; }
+    bool isVariant() const { return m_type == VariantType; }
+    bool isJObjectWrapper() const { return m_type == JObjectWrapperType; }
+    bool isArray() const { return m_type == ArrayType; }
+    bool isTemplateArgument() const { return m_type == TemplateArgumentType; }
+    bool isVoid() const { return m_type == VoidType; }
+    bool isThread() const { return m_type == ThreadType; }
+    bool isCustom() const { return m_type == CustomType; }
+    bool isBasicValue() const { return m_type == BasicValueType; }
+    bool isTypeSystem() const { return m_type == TypeSystemType; }
+
+    virtual bool preferredConversion() const { return m_preferred_conversion; }
+    virtual void setPreferredConversion(bool b) { m_preferred_conversion = b; }
+
+    virtual QString javaQualifier() const { return QString(); }
+
+    // The type's name in C++, fully qualified
+    QString name() const { return m_name; }
+
+    uint codeGeneration() const { return m_code_generation; }
+    void setCodeGeneration(uint cg) { m_code_generation = cg; }
+
+    virtual QString qualifiedCppName() const { return m_name; }
+
+    // Its type's name in JNI
+    virtual QString jniName() const { return m_name; }
+
+    // The type's name in TargetLang
+    virtual QString targetLangName() const { return m_name; }
+
+    // The type to lookup when converting to TargetLang
+    virtual QString lookupName() const { return targetLangName(); }
+
+    // The package
+    virtual QString javaPackage() const { return QString(); }
+
+    virtual QString qualifiedTargetLangName() const {
+//        QString pkg = javaPackage();
+/*        if (pkg.isEmpty())*/ return targetLangName();
+//        return pkg + '.' + targetLangName();
+    }
+
+    virtual InterfaceTypeEntry *designatedInterface() const { return 0; }
+
+    void setCustomConstructor(const CustomFunction &func) { m_customConstructor = func; }
+    CustomFunction customConstructor() const { return m_customConstructor; }
+
+    void setCustomDestructor(const CustomFunction &func) { m_customDestructor = func; }
+    CustomFunction customDestructor() const { return m_customDestructor; }
+
+    virtual bool isValue() const { return false; }
+    virtual bool isComplex() const { return false; }
+
+    virtual bool isNativeIdBased() const { return false; }
+
+    // qtd
+    virtual bool isStructInD() const { return false; }
+
+private:
+    QString m_name;
+    Type m_type;
+    uint m_code_generation;
+    CustomFunction m_customConstructor;
+    CustomFunction m_customDestructor;
+    bool m_preferred_conversion;
+};
+typedef QHash<QString, QList<TypeEntry *> > TypeEntryHash;
+typedef QHash<QString, TypeEntry *> SingleTypeEntryHash;
+
+
+class TypeSystemTypeEntry : public TypeEntry
+{
+public:
+    TypeSystemTypeEntry(const QString &name)
+        : TypeEntry(name, TypeSystemType)
+    {
+    };
+
+    QList<CodeSnip> snips;
+};
+
+
+class ThreadTypeEntry : public TypeEntry
+{
+public:
+    ThreadTypeEntry() : TypeEntry("QThread", ThreadType) { setCodeGeneration(GenerateNothing); }
+
+    QString jniName() const { return strings_jobject; }
+    QString targetLangName() const { return strings_Thread; }
+    QString javaPackage() const { return strings_java_lang; }
+};
+
+class VoidTypeEntry : public TypeEntry
+{
+public:
+    VoidTypeEntry() : TypeEntry("void", VoidType) { }
+};
+
+class TemplateArgumentEntry : public TypeEntry
+{
+public:
+    TemplateArgumentEntry(const QString &name)
+        : TypeEntry(name, TemplateArgumentType), m_ordinal(0)
+    {
+    }
+
+    int ordinal() const { return m_ordinal; }
+    void setOrdinal(int o) { m_ordinal = o; }
+
+private:
+    int m_ordinal;
+};
+
+class ArrayTypeEntry : public TypeEntry
+{
+public:
+    ArrayTypeEntry(const TypeEntry *nested_type) : TypeEntry("Array", ArrayType), m_nested_type(nested_type)
+    {
+        Q_ASSERT(m_nested_type);
+    }
+
+    void setNestedTypeEntry(TypeEntry *nested) { m_nested_type = nested; }
+    const TypeEntry *nestedTypeEntry() const { return m_nested_type; }
+
+    QString targetLangName() const { return m_nested_type->targetLangName() + "[]"; }
+    QString jniName() const
+    {
+        if (m_nested_type->isPrimitive())
+            return m_nested_type->jniName() + "Array";
+        else
+            return "jobjectArray";
+    }
+
+private:
+    const TypeEntry *m_nested_type;
+};
+
+
+class PrimitiveTypeEntry : public TypeEntry
+{
+public:
+    PrimitiveTypeEntry(const QString &name)
+        : TypeEntry(name, PrimitiveType), m_preferred_conversion(true), m_preferred_java_type(true)
+    {
+    }
+
+    QString targetLangName() const { return m_java_name; }
+    void setTargetLangName(const QString &targetLangName) { m_java_name  = targetLangName; }
+
+    QString jniName() const { return m_jni_name; }
+    void setJniName(const QString &jniName) { m_jni_name = jniName; }
+
+    QString javaObjectFullName() const { return javaObjectPackage() + "." + javaObjectName(); }
+    QString javaObjectName() const;
+    QString javaObjectPackage() const { return strings_java_lang; }
+
+    virtual bool preferredConversion() const { return m_preferred_conversion; }
+    virtual void setPreferredConversion(bool b) { m_preferred_conversion = b; }
+
+    virtual bool preferredTargetLangType() const { return m_preferred_java_type; }
+    virtual void setPreferredTargetLangType(bool b) { m_preferred_java_type = b; }
+
+private:
+    QString m_java_name;
+    QString m_jni_name;
+    uint m_preferred_conversion : 1;
+    uint m_preferred_java_type : 1;
+};
+
+
+
+
+struct EnumValueRedirection
+{
+    EnumValueRedirection(const QString &rej, const QString &us)
+        : rejected(rej),
+          used(us)
+    {
+    }
+    QString rejected;
+    QString used;
+};
+
+class EnumTypeEntry : public TypeEntry
+{
+public:
+    EnumTypeEntry(const QString &nspace, const QString &enumName)
+        : TypeEntry(nspace.isEmpty() ? enumName : nspace + QLatin1String("::") + enumName,
+                    EnumType),
+          m_flags(0),
+          m_extensible(false)
+    {
+        m_qualifier = nspace;
+        m_java_name = enumName;
+    }
+
+    QString javaPackage() const { return m_package_name; }
+    void setTargetLangPackage(const QString &package) { m_package_name = package; }
+
+    QString targetLangName() const { return m_java_name; }
+    QString javaQualifier() const;
+    QString qualifiedTargetLangName() const {
+        return javaQualifier() + '_' + targetLangName();
+//        return targetLangName();
+    }
+
+    QString jniName() const;
+
+    QString qualifier() const { return m_qualifier; }
+    void setQualifier(const QString &q) { m_qualifier = q; }
+
+    virtual bool preferredConversion() const { return false; }
+
+    bool isBoundsChecked() const { return m_lower_bound.isEmpty() && m_upper_bound.isEmpty(); }
+
+    QString upperBound() const { return m_upper_bound; }
+    void setUpperBound(const QString &bound) { m_upper_bound = bound; }
+
+    QString lowerBound() const { return m_lower_bound; }
+    void setLowerBound(const QString &bound) { m_lower_bound = bound; }
+
+    void setFlags(FlagsTypeEntry *flags) { m_flags = flags; }
+    FlagsTypeEntry *flags() const { return m_flags; }
+
+    bool isExtensible() const { return m_extensible; }
+    void setExtensible(bool is) { m_extensible = is; }
+
+    bool isEnumValueRejected(const QString &name) { return m_rejected_enums.contains(name); }
+    void addEnumValueRejection(const QString &name) { m_rejected_enums << name; }
+    QStringList enumValueRejections() const { return m_rejected_enums; }
+
+    void addEnumValueRedirection(const QString &rejected, const QString &usedValue);
+    QString enumValueRedirection(const QString &value) const;
+
+    bool forceInteger() const { return m_force_integer; }
+    void setForceInteger(bool force) { m_force_integer = force; }
+
+private:
+    QString m_package_name;
+    QString m_qualifier;
+    QString m_java_name;
+
+    QString m_lower_bound;
+    QString m_upper_bound;
+
+    QStringList m_rejected_enums;
+    QList<EnumValueRedirection> m_enum_redirections;
+
+    FlagsTypeEntry *m_flags;
+
+    bool m_extensible;
+    bool m_force_integer;
+};
+
+class FlagsTypeEntry : public TypeEntry
+{
+public:
+    FlagsTypeEntry(const QString &name) : TypeEntry(name, FlagsType), m_enum(0)
+    {
+    }
+
+    QString qualifiedTargetLangName() const;
+    QString targetLangName() const { return m_java_name; }
+    QString jniName() const;
+    virtual bool preferredConversion() const { return false; }
+
+    QString originalName() const { return m_original_name; }
+    void setOriginalName(const QString &s) { m_original_name = s; }
+
+    QString flagsName() const { return m_java_name; }
+    void setFlagsName(const QString &name) { m_java_name = name; }
+
+    bool forceInteger() const { return m_enum->forceInteger(); }
+
+    EnumTypeEntry *originator() const { return m_enum; }
+    void setOriginator(EnumTypeEntry *e) { m_enum = e; }
+
+    QString javaPackage() const { return m_enum->javaPackage(); }
+    QString javaQualifier() const { return m_enum->javaQualifier(); }
+    QString qualifier() const { return m_enum->qualifier(); }
+
+private:
+    QString m_original_name;
+    QString m_java_name;
+    EnumTypeEntry *m_enum;
+};
+
+
+class ComplexTypeEntry : public TypeEntry
+{
+public:
+    enum TypeFlag {
+        ForceAbstract      = 0x1,
+        DeleteInMainThread = 0x2,
+        Deprecated         = 0x4
+    };
+    typedef QFlags<TypeFlag> TypeFlags;
+
+    ComplexTypeEntry(const QString &name, Type t)
+        : TypeEntry(QString(name).replace("::", "_"), t),
+          m_qualified_cpp_name(name),
+          m_qobject(false),
+          m_polymorphic_base(false),
+          m_generic_class(false),
+          m_type_flags(0),
+          m_isStructInD(false),
+          m_isAbstract(false)
+    {
+        Include inc;
+        inc.name = "QVariant";
+        inc.type = Include::IncludePath;
+
+        addExtraInclude(inc);
+    }
+
+    bool isComplex() const { return true; }
+
+    IncludeList extraIncludes() const { return m_extra_includes; }
+    void setExtraIncludes(const IncludeList &includes) { m_extra_includes = includes; }
+    void addExtraInclude(const Include &include)
+    {
+        if (!m_includes_used.value(include.name, false)) {
+            m_extra_includes << include;
+            m_includes_used[include.name] = true;
+        }
+    }
+
+    ComplexTypeEntry *copy() const
+    {
+        ComplexTypeEntry *centry = new ComplexTypeEntry(name(), type());
+        centry->setInclude(include());
+        centry->setExtraIncludes(extraIncludes());
+        centry->setFunctionModifications(functionModifications());
+        centry->setFieldModifications(fieldModifications());
+        centry->setQObject(isQObject());
+        centry->setDefaultSuperclass(defaultSuperclass());
+        centry->setCodeSnips(codeSnips());
+        centry->setTargetLangPackage(javaPackage());
+
+        return centry;
+    }
+
+    void setLookupName(const QString &name)
+    {
+        m_lookup_name = name;
+    }
+
+    virtual QString lookupName() const
+    {
+        return m_lookup_name.isEmpty() ? targetLangName() : m_lookup_name;
+    }
+
+    QString jniName() const { return strings_jobject; }
+
+
+    Include include() const { return m_include; }
+    void setInclude(const Include &inc) { m_include = inc; }
+
+    void setTypeFlags(TypeFlags flags)
+    {
+        m_type_flags = flags;
+    }
+
+    TypeFlags typeFlags() const
+    {
+        return m_type_flags;
+    }
+
+    CodeSnipList codeSnips() const { return m_code_snips; }
+    void setCodeSnips(const CodeSnipList &codeSnips) { m_code_snips = codeSnips; }
+    void addCodeSnip(const CodeSnip &codeSnip) { m_code_snips << codeSnip; }
+
+    FunctionModificationList functionModifications() const { return m_function_mods; }
+    void setFunctionModifications(const FunctionModificationList &functionModifications) {
+        m_function_mods = functionModifications;
+    }
+    void addFunctionModification(const FunctionModification &functionModification) {
+        m_function_mods << functionModification;
+    }
+    FunctionModificationList functionModifications(const QString &signature) const;
+
+    FieldModification fieldModification(const QString &name) const;
+    void setFieldModifications(const FieldModificationList &mods) { m_field_mods = mods; }
+    FieldModificationList fieldModifications() const { return m_field_mods; }
+
+    QString javaPackage() const { return m_package; }
+    void setTargetLangPackage(const QString &package) { m_package = package; }
+
+    bool isQObject() const { return m_qobject; }
+    void setQObject(bool qobject) { m_qobject = qobject; }
+
+    QString defaultSuperclass() const { return m_default_superclass; }
+    void setDefaultSuperclass(const QString &sc) { m_default_superclass = sc; }
+
+    virtual QString qualifiedCppName() const { return m_qualified_cpp_name; }
+
+
+    void setIsPolymorphicBase(bool on)
+    {
+        m_polymorphic_base = on;
+    }
+    bool isPolymorphicBase() const { return m_polymorphic_base; }
+
+    void setPolymorphicIdValue(const QString &value)
+    {
+        m_polymorphic_id_value = value;
+    }
+    QString polymorphicIdValue() const { return m_polymorphic_id_value; }
+
+    void setExpensePolicy(const ExpensePolicy &policy) { m_expense_policy = policy; }
+    const ExpensePolicy &expensePolicy() const { return m_expense_policy; }
+
+    QString targetType() const { return m_target_type; }
+    void setTargetType(const QString &code) { m_target_type = code; }
+
+    QString targetLangName() const { return m_java_name.isEmpty()
+                                   ? TypeEntry::targetLangName()
+                                   : m_java_name;
+    }
+    void setTargetLangName(const QString &name) { m_java_name = name; }
+
+    bool isGenericClass() const { return m_generic_class; }
+    void setGenericClass(bool isGeneric) { m_generic_class = isGeneric; }
+
+    QString injectedImports;
+
+    // qtd
+    bool isStructInD() const { return m_isStructInD; }
+    void setStructInD(bool isStruct) { m_isStructInD = isStruct; }
+
+    bool isAbstract() const { return m_isAbstract; }
+    void setAbstract(bool isAbstract) { m_isAbstract = isAbstract; }
+
+    QString addedTo;
+    QStringList includedClasses;
+
+
+private:
+    IncludeList m_extra_includes;
+    Include m_include;
+    QHash<QString, bool> m_includes_used;
+    FunctionModificationList m_function_mods;
+    FieldModificationList m_field_mods;
+    CodeSnipList m_code_snips;
+    QString m_package;
+    QString m_default_superclass;
+    QString m_qualified_cpp_name;
+    QString m_java_name;
+
+    uint m_qobject : 1;
+    uint m_polymorphic_base : 1;
+    uint m_generic_class : 1;
+
+    QString m_polymorphic_id_value;
+    QString m_lookup_name;
+    QString m_target_type;
+    ExpensePolicy m_expense_policy;
+    TypeFlags m_type_flags;
+
+    // qtd
+    bool m_isStructInD;
+    bool m_isAbstract;
+};
+
+class ContainerTypeEntry : public ComplexTypeEntry
+{
+public:
+    enum Type {
+        NoContainer,
+        ListContainer,
+        StringListContainer,
+        LinkedListContainer,
+        VectorContainer,
+        StackContainer,
+        QueueContainer,
+        SetContainer,
+        MapContainer,
+        MultiMapContainer,
+        HashContainer,
+        MultiHashContainer,
+        PairContainer,
+    };
+
+    ContainerTypeEntry(const QString &name, Type type)
+        : ComplexTypeEntry(name, ContainerType)
+    {
+        m_type = type;
+        setCodeGeneration(GenerateForSubclass);
+    }
+
+    Type type() const { return m_type; }
+    QString targetLangName() const;
+    QString javaPackage() const;
+    QString qualifiedCppName() const;
+
+private:
+    Type m_type;
+};
+
+
+class NamespaceTypeEntry : public ComplexTypeEntry
+{
+public:
+    NamespaceTypeEntry(const QString &name) : ComplexTypeEntry(name, NamespaceType) { }
+};
+
+
+class ValueTypeEntry : public ComplexTypeEntry
+{
+public:
+    ValueTypeEntry(const QString &name) : ComplexTypeEntry(name, BasicValueType) { }
+
+    bool isValue() const { return true; }
+
+    virtual bool isNativeIdBased() const { return true; }
+
+protected:
+    ValueTypeEntry(const QString &name, Type t) : ComplexTypeEntry(name, t) { }
+};
+
+
+class StringTypeEntry : public ValueTypeEntry
+{
+public:
+    StringTypeEntry(const QString &name)
+        : ValueTypeEntry(name, StringType)
+    {
+        setCodeGeneration(GenerateNothing);
+    }
+
+    QString jniName() const { return strings_jobject; }
+    QString targetLangName() const { return strings_String; }
+    QString javaPackage() const { return strings_java_lang; }
+
+    virtual bool isNativeIdBased() const { return false; }
+};
+
+class CharTypeEntry : public ValueTypeEntry
+{
+public:
+    CharTypeEntry(const QString &name) : ValueTypeEntry(name, CharType)
+    {
+        setCodeGeneration(GenerateNothing);
+    }
+
+    QString jniName() const { return strings_jchar; }
+    QString targetLangName() const { return strings_char; }
+    QString javaPackage() const { return QString(); }
+
+    virtual bool isNativeIdBased() const { return false; }
+};
+
+class JObjectWrapperTypeEntry: public ValueTypeEntry
+{
+public:
+    JObjectWrapperTypeEntry(const QString &name) : ValueTypeEntry(name, JObjectWrapperType) { }
+
+    QString jniName() const { return strings_jobject; }
+    QString targetLangName() const { return strings_Object; }
+    QString javaPackage() const { return strings_java_lang; }
+
+    bool isNativeIdBased() const { return false; }
+};
+
+class VariantTypeEntry: public ValueTypeEntry
+{
+public:
+    VariantTypeEntry(const QString &name) : ValueTypeEntry(name, VariantType) { }
+
+    QString jniName() const { return strings_jobject; }
+    QString targetLangName() const { return "QVariant"; }
+    QString javaPackage() const { return "qt.core"; }
+    virtual bool isNativeIdBased() const { return false; }
+};
+
+
+class InterfaceTypeEntry : public ComplexTypeEntry
+{
+public:
+    InterfaceTypeEntry(const QString &name)
+        : ComplexTypeEntry(name, InterfaceType)
+    {
+    }
+
+    static QString interfaceName(const QString &name) {
+        return "I" + name;
+    }
+
+    ObjectTypeEntry *origin() const { return m_origin; }
+    void setOrigin(ObjectTypeEntry *origin) { m_origin = origin; }
+
+    virtual bool isNativeIdBased() const { return true; }
+    virtual QString qualifiedCppName() const {
+        return ComplexTypeEntry::qualifiedCppName().right(ComplexTypeEntry::qualifiedCppName().length() - interfaceName("").length());
+    }
+
+private:
+    ObjectTypeEntry *m_origin;
+};
+
+
+class ObjectTypeEntry : public ComplexTypeEntry
+{
+public:
+    ObjectTypeEntry(const QString &name)
+        : ComplexTypeEntry(name, ObjectType), m_interface(0)
+    {
+    }
+
+    InterfaceTypeEntry *designatedInterface() const { return m_interface; }
+    void setDesignatedInterface(InterfaceTypeEntry *entry) { m_interface = entry; }
+
+    virtual bool isNativeIdBased() const { return true; }
+
+private:
+    InterfaceTypeEntry *m_interface;
+};
+
+class CustomTypeEntry : public ComplexTypeEntry
+{
+public:
+    CustomTypeEntry(const QString &name) : ComplexTypeEntry(name, CustomType) { }
+
+    virtual void generateCppJavaToQt(QTextStream &s,
+                                     const AbstractMetaType *java_type,
+                                     const QString &env_name,
+                                     const QString &qt_name,
+                                     const QString &java_name) const = 0;
+
+    virtual void generateCppQtToJava(QTextStream &s,
+                                     const AbstractMetaType *java_type,
+                                     const QString &env_name,
+                                     const QString &qt_name,
+                                     const QString &java_name) const = 0;
+};
+
+struct TypeRejection
+{
+    QString class_name;
+    QString function_name;
+    QString field_name;
+    QString enum_name;
+};
+
+class TypeDatabase
+{
+public:
+    TypeDatabase();
+
+    static TypeDatabase *instance();
+
+    QList<Include> extraIncludes(const QString &className);
+
+    inline PrimitiveTypeEntry *findPrimitiveType(const QString &name);
+    inline ComplexTypeEntry *findComplexType(const QString &name);
+    inline ObjectTypeEntry *findObjectType(const QString &name);
+    inline NamespaceTypeEntry *findNamespaceType(const QString &name);
+    ContainerTypeEntry *findContainerType(const QString &name);
+
+    TypeEntry *findType(const QString &name) const {
+        QList<TypeEntry *> entries = findTypes(name);
+        foreach (TypeEntry *entry, entries) {
+            if (entry != 0 &&
+                (!entry->isPrimitive() || static_cast<PrimitiveTypeEntry *>(entry)->preferredTargetLangType())) {
+                return entry;
+            }
+        }
+        return 0;
+    }
+    QList<TypeEntry *> findTypes(const QString &name) const { return m_entries.value(name); }
+    TypeEntryHash allEntries() { return m_entries; }
+    SingleTypeEntryHash entries() {
+        TypeEntryHash entries = allEntries();
+
+        SingleTypeEntryHash returned;
+        QList<QString> keys = entries.keys();
+
+        foreach(QString key, keys) {
+            returned[key] = findType(key);
+        }
+
+        return returned;
+    }
+
+    PrimitiveTypeEntry *findTargetLangPrimitiveType(const QString &java_name);
+
+    void addRejection(const QString &class_name, const QString &function_name,
+                      const QString &field_name, const QString &enum_name);
+    bool isClassRejected(const QString &class_name);
+    bool isFunctionRejected(const QString &class_name, const QString &function_name);
+    bool isFieldRejected(const QString &class_name, const QString &field_name);
+    bool isEnumRejected(const QString &class_name, const QString &enum_name);
+
+    void addType(TypeEntry *e) { m_entries[e->qualifiedCppName()].append(e); }
+
+    SingleTypeEntryHash flagsEntries() const { return m_flags_entries; }
+    FlagsTypeEntry *findFlagsType(const QString &name) const;
+    void addFlagsType(FlagsTypeEntry *fte) { m_flags_entries[fte->originalName()] = fte; }
+
+    TemplateEntry *findTemplate(const QString &name) { return m_templates[name]; }
+    void addTemplate(TemplateEntry *t) { m_templates[t->name()] = t; }
+
+    void setIncludeEclipseWarnings(bool on) { m_includeEclipseWarnings = on; }
+    bool includeEclipseWarnings() const { return m_includeEclipseWarnings; }
+
+    void setSuppressWarnings(bool on) { m_suppressWarnings = on; }
+    void addSuppressedWarning(const QString &s)
+    {
+        m_suppressedWarnings.append(s);
+    }
+
+    bool isSuppressedWarning(const QString &s)
+    {
+        if (!m_suppressWarnings)
+            return false;
+
+        foreach (const QString &_warning, m_suppressedWarnings) {
+            QString warning(QString(_warning).replace("\\*", "&place_holder_for_asterisk;"));
+
+            QStringList segs = warning.split("*", QString::SkipEmptyParts);
+            if (segs.size() == 0)
+                continue ;
+
+            int i = 0;
+            int pos = s.indexOf(QString(segs.at(i++)).replace("&place_holder_for_asterisk;", "*"));
+            //qDebug() << "s == " << s << ", warning == " << segs;
+            while (pos != -1) {
+                if (i == segs.size())
+                    return true;
+                pos = s.indexOf(QString(segs.at(i++)).replace("&place_holder_for_asterisk;", "*"), pos);
+            }
+        }
+
+        return false;
+    }
+
+    void setRebuildClasses(const QStringList &cls) { m_rebuild_classes = cls; }
+
+    static QString globalNamespaceClassName(const TypeEntry *te);
+    QString filename() const { return "typesystem.txt"; }
+
+    bool parseFile(const QString &filename, bool generate = true);
+
+private:
+    uint m_suppressWarnings : 1;
+    uint m_includeEclipseWarnings : 1;
+    uint m_reserved : 30;
+
+    TypeEntryHash m_entries;
+    SingleTypeEntryHash m_flags_entries;
+    TemplateEntryHash m_templates;
+    QStringList m_suppressedWarnings;
+
+    QList<TypeRejection> m_rejections;
+    QStringList m_rebuild_classes;
+};
+
+inline PrimitiveTypeEntry *TypeDatabase::findPrimitiveType(const QString &name)
+{
+    QList<TypeEntry *> entries = findTypes(name);
+
+    foreach (TypeEntry *entry, entries) {
+        if (entry != 0 && entry->isPrimitive() && static_cast<PrimitiveTypeEntry *>(entry)->preferredTargetLangType())
+            return static_cast<PrimitiveTypeEntry *>(entry);
+    }
+
+    return 0;
+}
+
+inline ComplexTypeEntry *TypeDatabase::findComplexType(const QString &name)
+{
+    TypeEntry *entry = findType(name);
+    if (entry != 0 && entry->isComplex())
+        return static_cast<ComplexTypeEntry *>(entry);
+    else
+        return 0;
+}
+
+inline ObjectTypeEntry *TypeDatabase::findObjectType(const QString &name)
+{
+    TypeEntry *entry = findType(name);
+    if (entry != 0 && entry->isObject())
+        return static_cast<ObjectTypeEntry *>(entry);
+    else
+        return 0;
+}
+
+inline NamespaceTypeEntry *TypeDatabase::findNamespaceType(const QString &name)
+{
+    TypeEntry *entry = findType(name);
+    if (entry != 0 && entry->isNamespace())
+        return static_cast<NamespaceTypeEntry *>(entry);
+    else
+        return 0;
+}
+
+QString fixCppTypeName(const QString &name);
+
+#endif // TYPESYSTEM_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/typesystem_core-common.xml	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,1271 @@
+<?xml version="1.0"?>
+<typesystem>
+
+  <rejection class="*" function-name="d_func"/>
+  <rejection class="*" function-name="data_ptr"/>
+  <rejection class="*" function-name="detach"/>
+  <rejection class="*" function-name="isDetached"/>
+
+  <rejection class="*" field-name="d_ptr"/>
+  <rejection class="*" field-name="d"/>
+
+  <rejection class="" enum-name="QtValidLicenseForTestModule"/>
+
+  <rejection class="" enum-name="QtValidLicenseForDBusModule"/>
+  <rejection class="" enum-name="QtValidLicenseForSqlModule"/>
+  <rejection class="" enum-name="QtValidLicenseForOpenGLModule"/>
+  <rejection class="" enum-name="enum_1"/>
+  <rejection class="" enum-name="QtValidLicenseForXmlModule"/>
+  <rejection class="" enum-name="QtValidLicenseForXmlPatternsModule"/>
+  <rejection class="" enum-name="QtValidLicenseForActiveQtModule"/>
+  <rejection class="" enum-name="QtValidLicenseForCoreModule"/>
+  <rejection class="" enum-name="QtValidLicenseForQt3SupportLightModule"/>
+  <rejection class="" enum-name="QtValidLicenseForQt3SupportModule"/>
+  <rejection class="" enum-name="QtValidLicenseForNetworkModule"/>
+  <rejection class="" enum-name="QtValidLicenseForSvgModule"/>
+  <rejection class="" enum-name="QtValidLicenseForGuiModule"/>
+  <rejection class="" enum-name="QtValidLicenseForScriptModule"/>
+  <rejection class="" enum-name="QtValidLicenseForHelpModule"/>
+  <rejection class="QtConcurrent" enum-name="enum_1" />
+  <rejection class="QtConcurrent" function-name="operator|" />
+
+  <rejection class="QFuture::const_iterator" />
+  <rejection class="QFutureInterface" />
+  <rejection class="QFutureInterfaceBase" />
+  <rejection class="QtConcurrent::BlockSizeManager" />
+  <rejection class="QtConcurrent::ConstMemberFunctionWrapper" />
+  <rejection class="QtConcurrent::Exception"/>
+  <rejection class="QtConcurrent::FilterKernel"/>
+  <rejection class="QtConcurrent::FilteredEachKernel"/>
+  <rejection class="QtConcurrent::FilteredReducedKernel"/>
+  <rejection class="QtConcurrent::FunctionWrapper0"/>
+  <rejection class="QtConcurrent::FunctionWrapper1"/>
+  <rejection class="QtConcurrent::FunctionWrapper2"/>
+  <rejection class="QtConcurrent::IntermediateResults"/>
+  <rejection class="QtConcurrent::IterateKernel"/>
+  <rejection class="QtConcurrent::MapKernel"/>
+  <rejection class="QtConcurrent::MappedEachKernel"/>
+  <rejection class="QtConcurrent::MappedReducedKernel"/>
+  <rejection class="QtConcurrent::Median"/>
+  <rejection class="QtConcurrent::MemberFunctionWrapper"/>
+  <rejection class="QtConcurrent::MemberFunctionWrapper1"/>
+  <rejection class="QtConcurrent::ReduceKernel"/>
+  <rejection class="QtConcurrent::ResultItem"/>
+  <rejection class="QtConcurrent::ResultIterator"/>
+  <rejection class="QtConcurrent::ResultIteratorBase"/>
+  <rejection class="QtConcurrent::ResultReporter"/>
+  <rejection class="QtConcurrent::ResultStore"/>
+  <rejection class="QtConcurrent::ResultStoreBase"/>
+  <rejection class="QtConcurrent::RunFunctionTask"/>
+  <rejection class="QtConcurrent::RunFunctionTaskBase"/>
+  <rejection class="QtConcurrent::SelectSpecialization"/>
+  <rejection class="QtConcurrent::SelectStoredConstMemberFunctionCall0"/>
+  <rejection class="QtConcurrent::SelectStoredConstMemberFunctionCall1"/>
+  <rejection class="QtConcurrent::SelectStoredConstMemberFunctionCall2"/>
+  <rejection class="QtConcurrent::SelectStoredConstMemberFunctionCall3"/>
+  <rejection class="QtConcurrent::SelectStoredConstMemberFunctionCall4"/>
+  <rejection class="QtConcurrent::SelectStoredConstMemberFunctionCall5"/>
+  <rejection class="QtConcurrent::SelectStoredConstMemberFunctionPointerCall0"/>
+  <rejection class="QtConcurrent::SelectStoredConstMemberFunctionPointerCall1"/>
+  <rejection class="QtConcurrent::SelectStoredConstMemberFunctionPointerCall2"/>
+  <rejection class="QtConcurrent::SelectStoredConstMemberFunctionPointerCall3"/>
+  <rejection class="QtConcurrent::SelectStoredConstMemberFunctionPointerCall4"/>
+  <rejection class="QtConcurrent::SelectStoredConstMemberFunctionPointerCall5"/>
+  <rejection class="QtConcurrent::SelectStoredFunctorCall0"/>
+  <rejection class="QtConcurrent::SelectStoredFunctorCall1"/>
+  <rejection class="QtConcurrent::SelectStoredFunctorCall2"/>
+  <rejection class="QtConcurrent::SelectStoredFunctorCall3"/>
+  <rejection class="QtConcurrent::SelectStoredFunctorCall4"/>
+  <rejection class="QtConcurrent::SelectStoredFunctorCall5"/>
+  <rejection class="QtConcurrent::SelectStoredFunctorPointerCall0"/>
+  <rejection class="QtConcurrent::SelectStoredFunctorPointerCall1"/>
+  <rejection class="QtConcurrent::SelectStoredFunctorPointerCall2"/>
+  <rejection class="QtConcurrent::SelectStoredFunctorPointerCall3"/>
+  <rejection class="QtConcurrent::SelectStoredFunctorPointerCall4"/>
+  <rejection class="QtConcurrent::SelectStoredFunctorPointerCall5"/>
+  <rejection class="QtConcurrent::SelectStoredMemberFunctionCall0"/>
+  <rejection class="QtConcurrent::SelectStoredMemberFunctionCall1"/>
+  <rejection class="QtConcurrent::SelectStoredMemberFunctionCall2"/>
+  <rejection class="QtConcurrent::SelectStoredMemberFunctionCall3"/>
+  <rejection class="QtConcurrent::SelectStoredMemberFunctionCall4"/>
+  <rejection class="QtConcurrent::SelectStoredMemberFunctionCall5"/>
+  <rejection class="QtConcurrent::SelectStoredMemberFunctionPointerCall0"/>
+  <rejection class="QtConcurrent::SelectStoredMemberFunctionPointerCall1"/>
+  <rejection class="QtConcurrent::SelectStoredMemberFunctionPointerCall2"/>
+  <rejection class="QtConcurrent::SelectStoredMemberFunctionPointerCall3"/>
+  <rejection class="QtConcurrent::SelectStoredMemberFunctionPointerCall4"/>
+  <rejection class="QtConcurrent::SelectStoredMemberFunctionPointerCall5"/>
+  <rejection class="QtConcurrent::SequenceHolder1"/>
+  <rejection class="QtConcurrent::SequenceHolder2"/>
+  <rejection class="QtConcurrent::StoredConstMemberFunctionCall0"/>
+  <rejection class="QtConcurrent::StoredConstMemberFunctionCall1"/>
+  <rejection class="QtConcurrent::StoredConstMemberFunctionCall2"/>
+  <rejection class="QtConcurrent::StoredConstMemberFunctionCall3"/>
+  <rejection class="QtConcurrent::StoredConstMemberFunctionCall4"/>
+  <rejection class="QtConcurrent::StoredConstMemberFunctionCall5"/>
+  <rejection class="QtConcurrent::StoredConstMemberFunctionPointerCall0"/>
+  <rejection class="QtConcurrent::StoredConstMemberFunctionPointerCall1"/>
+  <rejection class="QtConcurrent::StoredConstMemberFunctionPointerCall2"/>
+  <rejection class="QtConcurrent::StoredConstMemberFunctionPointerCall3"/>
+  <rejection class="QtConcurrent::StoredConstMemberFunctionPointerCall4"/>
+  <rejection class="QtConcurrent::StoredConstMemberFunctionPointerCall5"/>
+  <rejection class="QtConcurrent::StoredFunctorCall0"/>
+  <rejection class="QtConcurrent::StoredFunctorCall1"/>
+  <rejection class="QtConcurrent::StoredFunctorCall2"/>
+  <rejection class="QtConcurrent::StoredFunctorCall3"/>
+  <rejection class="QtConcurrent::StoredFunctorCall4"/>
+  <rejection class="QtConcurrent::StoredFunctorCall5"/>
+  <rejection class="QtConcurrent::StoredFunctorPointerCall0"/>
+  <rejection class="QtConcurrent::StoredFunctorPointerCall1"/>
+  <rejection class="QtConcurrent::StoredFunctorPointerCall2"/>
+  <rejection class="QtConcurrent::StoredFunctorPointerCall3"/>
+  <rejection class="QtConcurrent::StoredFunctorPointerCall4"/>
+  <rejection class="QtConcurrent::StoredFunctorPointerCall5"/>
+  <rejection class="QtConcurrent::StoredMemberFunctionCall0"/>
+  <rejection class="QtConcurrent::StoredMemberFunctionCall1"/>
+  <rejection class="QtConcurrent::StoredMemberFunctionCall2"/>
+  <rejection class="QtConcurrent::StoredMemberFunctionCall3"/>
+  <rejection class="QtConcurrent::StoredMemberFunctionCall4"/>
+  <rejection class="QtConcurrent::StoredMemberFunctionCall5"/>
+  <rejection class="QtConcurrent::StoredMemberFunctionPointerCall0"/>
+  <rejection class="QtConcurrent::StoredMemberFunctionPointerCall1"/>
+  <rejection class="QtConcurrent::StoredMemberFunctionPointerCall2"/>
+  <rejection class="QtConcurrent::StoredMemberFunctionPointerCall3"/>
+  <rejection class="QtConcurrent::StoredMemberFunctionPointerCall4"/>
+  <rejection class="QtConcurrent::StoredMemberFunctionPointerCall5"/>
+  <rejection class="QtConcurrent::ThreadEngine"/>
+  <rejection class="QtConcurrent::ThreadEngineBase"/>
+  <rejection class="QtConcurrent::ThreadEngineSemaphore"/>
+  <rejection class="QtConcurrent::ThreadEngineStarter"/>
+  <rejection class="QtConcurrent::ThreadEngineStarterBase"/>
+  <rejection class="QtConcurrent::UnhandledException"/>
+  <rejection class="QtConcurrent::VoidStoredConstMemberFunctionCall0"/>
+  <rejection class="QtConcurrent::VoidStoredConstMemberFunctionCall1"/>
+  <rejection class="QtConcurrent::VoidStoredConstMemberFunctionCall2"/>
+  <rejection class="QtConcurrent::VoidStoredConstMemberFunctionCall3"/>
+  <rejection class="QtConcurrent::VoidStoredConstMemberFunctionCall4"/>
+  <rejection class="QtConcurrent::VoidStoredConstMemberFunctionCall5"/>
+  <rejection class="QtConcurrent::VoidStoredConstMemberFunctionPointerCall0"/>
+  <rejection class="QtConcurrent::VoidStoredConstMemberFunctionPointerCall1"/>
+  <rejection class="QtConcurrent::VoidStoredConstMemberFunctionPointerCall2"/>
+  <rejection class="QtConcurrent::VoidStoredConstMemberFunctionPointerCall3"/>
+  <rejection class="QtConcurrent::VoidStoredConstMemberFunctionPointerCall4"/>
+  <rejection class="QtConcurrent::VoidStoredConstMemberFunctionPointerCall5"/>
+  <rejection class="QtConcurrent::VoidStoredFunctorCall0"/>
+  <rejection class="QtConcurrent::VoidStoredFunctorCall1"/>
+  <rejection class="QtConcurrent::VoidStoredFunctorCall2"/>
+  <rejection class="QtConcurrent::VoidStoredFunctorCall3"/>
+  <rejection class="QtConcurrent::VoidStoredFunctorCall4"/>
+  <rejection class="QtConcurrent::VoidStoredFunctorCall5"/>
+  <rejection class="QtConcurrent::VoidStoredFunctorPointerCall0"/>
+  <rejection class="QtConcurrent::VoidStoredFunctorPointerCall1"/>
+  <rejection class="QtConcurrent::VoidStoredFunctorPointerCall2"/>
+  <rejection class="QtConcurrent::VoidStoredFunctorPointerCall3"/>
+  <rejection class="QtConcurrent::VoidStoredFunctorPointerCall4"/>
+  <rejection class="QtConcurrent::VoidStoredFunctorPointerCall5"/>
+  <rejection class="QtConcurrent::VoidStoredMemberFunctionCall0"/>
+  <rejection class="QtConcurrent::VoidStoredMemberFunctionCall1"/>
+  <rejection class="QtConcurrent::VoidStoredMemberFunctionCall2"/>
+  <rejection class="QtConcurrent::VoidStoredMemberFunctionCall3"/>
+  <rejection class="QtConcurrent::VoidStoredMemberFunctionCall4"/>
+  <rejection class="QtConcurrent::VoidStoredMemberFunctionCall5"/>
+  <rejection class="QtConcurrent::VoidStoredMemberFunctionPointerCall0"/>
+  <rejection class="QtConcurrent::VoidStoredMemberFunctionPointerCall1"/>
+  <rejection class="QtConcurrent::VoidStoredMemberFunctionPointerCall2"/>
+  <rejection class="QtConcurrent::VoidStoredMemberFunctionPointerCall3"/>
+  <rejection class="QtConcurrent::VoidStoredMemberFunctionPointerCall4"/>
+  <rejection class="QtConcurrent::VoidStoredMemberFunctionPointerCall5"/>
+
+  <rejection class="QSize"/>
+  <rejection class="QSizeF"/>
+
+  <rejection class="QMdi" />
+  <rejection class="stdext" />
+  <rejection class="QAlgorithmsPrivate"/>
+  <rejection class="QAtomic"/>
+  <rejection class="QAtomicPointer"/>
+  <rejection class="QAtomicInt" />
+  <rejection class="QBasicAtomicInt" />
+  <rejection class="QBasicAtomic"/>
+  <rejection class="QBasicAtomicPointer"/>
+  <rejection class="QBitRef"/>
+  <rejection class="QCache"/>
+  <rejection class="QCharRef"/>
+  <rejection class="QDebug"/>
+  <rejection class="QExplicitlySharedDataPointer"/>
+  <rejection class="QFlag"/>
+  <rejection class="QFlags"/>
+  <rejection class="QForeachContainer"/>
+  <rejection class="QForeachContainerBase"/>
+  <rejection class="QGlobalStatic"/>
+  <rejection class="QHash"/>
+  <rejection class="QHashData"/>
+  <rejection class="QHashDummyNode"/>
+  <rejection class="QHashDummyNode"/>
+  <rejection class="QHashDummyNode"/>
+  <rejection class="QHashDummyNode"/>
+  <rejection class="QHashDummyNode"/>
+  <rejection class="QHashDummyValue"/>
+  <rejection class="QHashIterator"/>
+  <rejection class="QHashNode"/>
+  <rejection class="QHashNode"/>
+  <rejection class="QHashNode"/>
+  <rejection class="QHashNode"/>
+  <rejection class="QHashNode"/>
+  <rejection class="QInternal"/>
+  <rejection class="QLibrary"/>
+  <rejection class="QLinkedList"/>
+  <rejection class="QLinkedListData"/>
+  <rejection class="QLinkedListIterator"/>
+  <rejection class="QLinkedListNode"/>
+  <rejection class="QListData"/>
+  <rejection class="QListIterator"/>
+  <rejection class="QMap"/>
+  <rejection class="QMapData"/>
+  <rejection class="QMapIterator"/>
+  <rejection class="QMetaType"/>
+  <rejection class="QMetaTypeId"/>
+  <rejection class="QMetaProperty"/>
+  <rejection class="QMetaObject"/>
+  <rejection class="QMetaClassInfo"/>
+  <rejection class="QMetaMethod"/>
+  <rejection class="QMetaEnum"/>
+  <rejection class="QMultiHash"/>
+  <rejection class="QMultiMap"/>
+  <rejection class="QMutableHashIterator"/>
+  <rejection class="QMutableLinkedListIterator"/>
+  <rejection class="QMutableListIterator"/>
+  <rejection class="QMutableMapIterator"/>
+  <rejection class="QMutableVectorIterator"/>
+  <rejection class="QMutexLocker"/>
+  <rejection class="QNoImplicitBoolCast"/>
+  <rejection class="QObjectCleanupHandler"/>
+  <rejection class="QObjectData"/>
+  <rejection class="QObjectUserData"/>
+  <rejection class="QPluginLoader"/>
+  <rejection class="QPointer"/>
+  <rejection class="QReadLocker"/>
+  <rejection class="QResource"/>
+  <rejection class="QSet"/>
+  <rejection class="QSetIterator"/>
+  <rejection class="QSharedData"/>
+  <rejection class="QSharedDataPointer"/>
+  <rejection class="QStack"/>
+  <rejection class="QSysInfo"/>
+  <rejection class="QTextStreamManipulator"/>
+  <rejection class="QThreadStorage"/>
+  <rejection class="QThreadStorageData"/>
+  <rejection class="QTypeInfo"/>
+  <rejection class="QTypeInfo"/>
+  <rejection class="QVFbKeyData"/>
+  <rejection class="QVariantComparisonHelper"/>
+  <rejection class="QVectorData"/>
+  <rejection class="QVectorIterator"/>
+  <rejection class="QVectorTypedData"/>
+  <rejection class="QWriteLocker"/>
+  <rejection class="QtPrivate"/>
+  <rejection class="qGreater"/>
+  <rejection class="qLess"/>
+  <rejection class="std"/>
+  <rejection class="QAbstractFileEngine::ExtensionOption"/>
+  <rejection class="QAbstractFileEngine::ExtensionReturn"/>
+  <rejection class="QByteArray::Data"/>
+  <rejection class="QIntForType"/>
+  <rejection class="QList::Node"/>
+  <rejection class="QList::const_iterator"/>
+  <rejection class="QList::iterator"/>
+  <rejection class="QMetaTypeId2"/>
+  <rejection class="QMutableSetIterator"/>
+  <rejection class="QSubString"/>
+  <rejection class="QUintForType"/>
+  <rejection class="QtConcurrent::internal" />
+
+  <rejection class="QLocale::Data" />
+  <rejection class="QGlobalStaticDeleter" />
+  <rejection class="QSharedMemory" /> <!-- Temporarily until we know how to implement it in Java -->
+  <rejection class="QVarLengthArray" />
+
+  <!-- DBus -->
+  <rejection class="QDBusAbstractAdaptor" />
+  <rejection class="QDBusAbstractInterface" />
+  <rejection class="QDBusArgument" />
+  <rejection class="QDBusConnection" />
+  <rejection class="QDBusConnectionInterface" />
+  <rejection class="QDBusContext" />
+  <rejection class="QDBusError" />
+  <rejection class="QDBusInterface" />
+  <rejection class="QDBusMessage" />
+  <rejection class="QDBusMetaType" />
+  <rejection class="QDBusObjectPath" />
+  <rejection class="QDBusReply" />
+  <rejection class="QDBusServer" />
+  <rejection class="QDBusSignature" />
+  <rejection class="QDBusVariant" />
+
+  <rejection class="_Revbidit" />
+  <rejection class="_complex" />
+  <rejection class="_exception" />
+  <rejection class="_iobuf" />
+  <rejection class="_stat" />
+  <rejection class="_wfinddata_t" />
+  <rejection class="exception" />
+  <rejection class="istreambuf_iterator" />
+  <rejection class="ostreambuf_iterator" />
+  <rejection class="reverse_bidirectional_iterator" />
+  <rejection class="reverse_iterator" />
+  <rejection class="stat" />
+  <rejection class="tm" />
+
+  <rejection class="QAbstractEventDispatcher" function-name="filterEvent"/>
+  <rejection class="QAbstractEventDispatcher" function-name="setEventFilter"/>
+  <rejection class="QAbstractFileEngine" function-name="beginEntryList"/>
+  <rejection class="QAbstractFileEngine" function-name="endEntryList"/>
+  <rejection class="QAbstractFileEngine" function-name="extension"/>
+  <rejection class="QCoreApplication" function-name="compressEvent"/>
+  <rejection class="QCoreApplication" function-name="eventFilter"/>
+  <rejection class="QCoreApplication" function-name="filterEvent"/>
+  <rejection class="QCoreApplication" function-name="setEventFilter"/>
+  <rejection class="QFile" function-name="setDecodingFunction"/>
+  <rejection class="QFile" function-name="setEncodingFunction"/>
+  <rejection class="QList" function-name="begin"/>
+  <rejection class="QList" function-name="constBegin"/>
+  <rejection class="QList" function-name="constEnd"/>
+  <rejection class="QList" function-name="end"/>
+  <rejection class="QList" function-name="erase"/>
+  <rejection class="QList" function-name="erase"/>
+  <rejection class="QList" function-name="free"/>
+  <rejection class="QList" function-name="fromList"/>
+  <rejection class="QList" function-name="fromSet"/>
+  <rejection class="QList" function-name="fromSet"/>
+  <rejection class="QList" function-name="insert"/>
+  <rejection class="QList" function-name="malloc"/>
+  <rejection class="QList" function-name="node_construct"/>
+  <rejection class="QList" function-name="node_copy"/>
+  <rejection class="QList" function-name="node_destruct"/>
+  <rejection class="QList" function-name="toSet"/>
+  <rejection class="QObject" function-name="receivers"/>
+  <rejection class="QObject" function-name="findChild"/>
+  <rejection class="QObject" function-name="findChildren"/>
+  <rejection class="QObject" function-name="setUserData"/>
+  <rejection class="QObject" function-name="userData"/>
+  <rejection class="QObject" function-name="destroyed"/>
+  <rejection class="QObject" function-name="connect"/>
+  <rejection class="QObject" function-name="connectNotify"/>
+  <rejection class="QObject" function-name="disconnect"/>
+  <rejection class="QObject" function-name="disconnectNotify"/>
+  <rejection class="QObject" function-name="registerUserData"/>
+  <rejection class="QObject" function-name="sender"/>
+  <rejection class="QTimer" function-name="singleShot"/>
+  <rejection class="QProcess" function-name="pid"/>
+  <rejection class="QRegion" function-name="cleanUp"/>
+  <rejection class="QSettings" function-name="registerFormat"/>
+  <rejection class="QVector" function-name="back"/>
+  <rejection class="QVector" function-name="begin"/>
+  <rejection class="QVector" function-name="constBegin"/>
+  <rejection class="QVector" function-name="constEnd"/>
+  <rejection class="QVector" function-name="end"/>
+  <rejection class="QVector" function-name="erase"/>
+  <rejection class="QVector" function-name="free"/>
+  <rejection class="QVector" function-name="front"/>
+  <rejection class="QVector" function-name="insert"/>
+  <rejection class="QVector" function-name="malloc"/>
+  <rejection class="QVector" function-name="alloc"/>
+  <rejection class="QVector" function-name="operator+="/>
+  <rejection class="QAbstractFileEngineIterator" function-name="entryInfo"/>
+
+  <rejection class="QAbstractFileEngineIterator" enum-name="EntryInfoType"/>
+  <rejection class="QDataStream" enum-name="ByteOrder"/>
+
+
+  <namespace-type name="Qt">
+    <modify-function signature="codecForHtml(const QByteArray &amp;)" remove="all" />
+    <modify-function signature="mightBeRichText(const QString &amp;)" remove="all" />
+    <modify-function signature="escape(const QString&amp;)" remove="all" />
+    <modify-function signature="convertFromPlainText(const QString &amp;, Qt::WhiteSpaceMode)" remove="all" />
+  </namespace-type>
+
+
+  <enum-type name="QtMsgType">
+    <reject-enum-value name="QtSystemMsg" />
+  </enum-type>
+
+  <enum-type name="QReadWriteLock::RecursionMode" />
+  <enum-type name="QSystemSemaphore::AccessMode" />
+  <enum-type name="QSystemSemaphore::SystemSemaphoreError" />
+  <enum-type name="QTextBoundaryFinder::BoundaryReason" flags="QTextBoundaryFinder::BoundaryReasons" />
+  <enum-type name="QTextBoundaryFinder::BoundaryType" />
+  <enum-type name="QAbstractFileEngine::Extension" extensible="yes"/>
+  <enum-type name="QAbstractFileEngine::FileFlag" flags="QAbstractFileEngine::FileFlags"/>
+  <enum-type name="QAbstractFileEngine::FileName"/>
+  <enum-type name="QAbstractFileEngine::FileOwner"/>
+  <enum-type name="QAbstractFileEngine::FileTime"/>
+  <enum-type name="QDataStream::Status"/>
+  <enum-type name="QDir::Filter" flags="QDir::Filters"/>
+  <enum-type name="QEvent::Type" extensible="yes">
+    <reject-enum-value name="ApplicationActivated"/>
+    <reject-enum-value name="ApplicationDeactivated"/>
+  </enum-type>
+  <enum-type name="QEventLoop::ProcessEventsFlag" flags="QEventLoop::ProcessEventsFlags"/>
+  <enum-type name="QFile::FileError"/>
+  <enum-type name="QFile::MemoryMapFlags" />
+  <enum-type name="QFile::Permission" flags="QFile::Permissions"/>
+  <enum-type name="QIODevice::OpenModeFlag" flags="QIODevice::OpenMode"/>
+  <enum-type name="QLibraryInfo::LibraryLocation"/>
+  <enum-type name="QLocale::FormatType"/>
+  <enum-type name="QLocale::NumberOption" flags="QLocale::NumberOptions"/>
+  <enum-type name="QLocale::MeasurementSystem" />
+  <enum-type name="QMutex::RecursionMode"/>
+  <enum-type name="QProcess::ExitStatus"/>
+  <enum-type name="QProcess::ProcessChannel"/>
+  <enum-type name="QProcess::ProcessChannelMode"/>
+  <enum-type name="QProcess::ProcessError"/>
+  <enum-type name="QProcess::ProcessState"/>
+  <enum-type name="QRegExp::CaretMode"/>
+  <enum-type name="QRegExp::PatternSyntax"/>
+  <enum-type name="QSettings::Format"/>
+  <enum-type name="QSettings::Scope"/>
+  <enum-type name="QSettings::Status"/>
+  <enum-type name="QSocketNotifier::Type"/>
+  <enum-type name="QSystemLocale::QueryType"/>
+  <enum-type name="QTextCodec::ConversionFlag" flags="QTextCodec::ConversionFlags"/>
+  <enum-type name="QTextStream::FieldAlignment"/>
+  <enum-type name="QTextStream::NumberFlag" flags="QTextStream::NumberFlags"/>
+  <enum-type name="QTextStream::RealNumberNotation"/>
+  <enum-type name="QTextStream::Status"/>
+  <enum-type name="QTimeLine::CurveShape"/>
+  <enum-type name="QTimeLine::Direction"/>
+  <enum-type name="QTimeLine::State"/>
+  <enum-type name="QUrl::FormattingOption" flags="QUrl::FormattingOptions"/>
+  <enum-type name="QUrl::ParsingMode"/>
+  <enum-type name="QUuid::Variant"/>
+  <enum-type name="QUuid::Version"/>
+  <enum-type name="Qt::SizeHint" />
+  <enum-type name="Qt::SizeMode" />
+  <enum-type name="Qt::WindowFrameSection" />
+  <enum-type name="Qt::Axis"/>
+  <enum-type name="Qt::AnchorAttribute"/>
+  <enum-type name="Qt::ApplicationAttribute"/>
+  <enum-type name="Qt::ArrowType"/>
+  <enum-type name="Qt::AspectRatioMode"/>
+  <enum-type name="Qt::BGMode"/>
+  <enum-type name="Qt::BrushStyle"/>
+  <enum-type name="Qt::CaseSensitivity"/>
+  <enum-type name="Qt::CheckState"/>
+  <enum-type name="Qt::ClipOperation"/>
+  <enum-type name="Qt::ConnectionType"/>
+  <enum-type name="Qt::ContextMenuPolicy"/>
+  <enum-type name="Qt::Corner"/>
+  <enum-type name="Qt::DayOfWeek"/>
+  <enum-type name="Qt::DockWidgetAreaSizes"/>
+  <enum-type name="Qt::DropAction" flags="Qt::DropActions"/>
+  <enum-type name="Qt::FillRule"/>
+  <enum-type name="Qt::FocusPolicy"/>
+  <enum-type name="Qt::FocusReason"/>
+  <enum-type name="Qt::GlobalColor"/>
+  <enum-type name="Qt::HitTestAccuracy"/>
+  <enum-type name="Qt::InputMethodQuery"/>
+  <enum-type name="Qt::ItemFlag" flags="Qt::ItemFlags"/>
+  <enum-type name="Qt::ItemSelectionMode"/>
+  <enum-type name="Qt::KeyboardModifier" flags="Qt::KeyboardModifiers"/>
+  <enum-type name="Qt::LayoutDirection"/>
+  <enum-type name="QLineF::IntersectType"/>
+  <enum-type name="Qt::MatchFlag" flags="Qt::MatchFlags"/>
+  <enum-type name="Qt::Modifier"/>
+  <enum-type name="Qt::MouseButton" flags="Qt::MouseButtons"/>
+  <enum-type name="Qt::Orientation" flags="Qt::Orientations"/>
+  <enum-type name="Qt::PenCapStyle"/>
+  <enum-type name="Qt::PenJoinStyle"/>
+  <enum-type name="Qt::PenStyle"/>
+  <enum-type name="Qt::ScrollBarPolicy"/>
+  <enum-type name="Qt::ShortcutContext"/>
+  <enum-type name="Qt::SortOrder"/>
+  <enum-type name="Qt::TextElideMode"/>
+  <enum-type name="Qt::TextFlag"/>
+  <enum-type name="Qt::TextFormat"/>
+  <enum-type name="Qt::TextInteractionFlag" flags="Qt::TextInteractionFlags"/>
+  <enum-type name="Qt::TimeSpec"/>
+  <enum-type name="Qt::ToolBarAreaSizes"/>
+  <enum-type name="Qt::ToolButtonStyle"/>
+  <enum-type name="Qt::TransformationMode"/>
+  <enum-type name="Qt::UIEffect"/>
+  <enum-type name="Qt::WhiteSpaceMode"/>
+  <enum-type name="Qt::WindowModality"/>
+  <enum-type name="Qt::WindowState" flags="Qt::WindowStates"/>
+  <enum-type name="Qt::WindowType" flags="Qt::WindowFlags"/>
+  <enum-type name="QDirIterator::IteratorFlag" flags="QDirIterator::IteratorFlags"/>
+  <enum-type name="Qt::EventPriority"/>
+  <enum-type name="Qt::MaskMode"/>
+  <enum-type name="QCryptographicHash::Algorithm"/>
+
+  <enum-type name="QtConcurrent::ReduceOption" flags="QtConcurrent::ReduceOptions" />
+  <enum-type name="QtConcurrent::ThreadFunctionResult" />
+
+  <enum-type name="QCoreApplication::Encoding">
+    <reject-enum-value name="DefaultCodec"/>
+  </enum-type>
+
+  <enum-type name="Qt::AlignmentFlag" flags="Qt::Alignment">
+    <reject-enum-value name="AlignLeading"/>
+    <reject-enum-value name="AlignTrailing"/>
+  </enum-type>
+
+  <enum-type name="Qt::CursorShape">
+    <reject-enum-value name="LastCursor"/>
+  </enum-type>
+
+  <enum-type name="Qt::DateFormat">
+    <reject-enum-value name="LocalDate"/>
+  </enum-type>
+
+
+  <enum-type name="Qt::ItemDataRole" force-integer="yes">
+    <reject-enum-value name="BackgroundColorRole"/>
+    <reject-enum-value name="TextColorRole"/>
+  </enum-type>
+
+
+  <enum-type name="QDataStream::Version">
+    <reject-enum-value name="Qt_4_1"/>
+    <reject-enum-value name="Qt_4_5"/>
+  </enum-type>
+
+  <enum-type name="QDir::SortFlag" flags="QDir::SortFlags">
+    <reject-enum-value name="Unsorted"/>
+  </enum-type>
+
+  <enum-type name="Qt::DockWidgetArea" flags="Qt::DockWidgetAreas">
+    <reject-enum-value name="AllDockWidgetAreas"/>
+  </enum-type>
+
+  <enum-type name="Qt::ImageConversionFlag" flags="Qt::ImageConversionFlags">
+    <reject-enum-value name="AutoDither"/>
+    <reject-enum-value name="ColorOnly"/>
+    <reject-enum-value name="DiffuseDither"/>
+    <reject-enum-value name="NoAlpha"/>
+    <reject-enum-value name="ThresholdAlphaDither"/>
+  </enum-type>
+
+  <enum-type name="Qt::Key">
+    <reject-enum-value name="Key_Any"/>
+  </enum-type>
+
+  <enum-type name="QLocale::Language">
+    <reject-enum-value name="LastLanguage"/>
+    <reject-enum-value name="NorwegianBokmal"/>
+    <reject-enum-value name="Nynorsk"/>
+  </enum-type>
+
+  <enum-type name="QLocale::Country">
+    <reject-enum-value name="LastCountry"/>
+  </enum-type>
+
+  <enum-type name="Qt::ToolBarArea" flags="Qt::ToolBarAreas">
+    <reject-enum-value name="AllToolBarAreas"/>
+  </enum-type>
+
+  <enum-type name="Qt::WidgetAttribute">
+    <reject-enum-value name="WA_ForceAcceptDrops"/>
+    <reject-enum-value name="WA_NoBackground"/>
+    <reject-enum-value name="WA_MacMetalStyle"/>
+  </enum-type>
+
+  <value-type name="QBasicTimer"/>
+  <value-type name="QByteArrayMatcher">
+    <modify-function signature="operator=(QByteArrayMatcher)" remove="all"/>
+  </value-type>
+
+  <value-type name="QDate">
+    <modify-function signature="julianToGregorian(uint,int&amp;,int&amp;,int&amp;)">
+        <remove/>
+    </modify-function>
+
+    <modify-function signature="setYMD(int, int, int)" remove="all"/> <!--### Obsolete in 4.3-->
+  </value-type>
+
+  <value-type name="QDateTime">
+    <modify-function signature="operator=(QDateTime)" remove="all"/>
+  </value-type>
+
+  <value-type name="QDir">
+    <modify-function signature="QDir(QString,QString,QFlags&lt;QDir::SortFlag&gt;,QFlags&lt;QDir::Filter&gt;)">
+        <modify-argument index="3">
+            <replace-default-expression with="SortFlag.Name, SortFlag.IgnoreCase"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="operator=(QDir)" remove="all"/>
+    <modify-function signature="operator=(QString)" remove="all"/>
+    <modify-function signature="addResourceSearchPath(QString)" remove="all"/> <!--### Obsolete in 4.3-->
+  </value-type>
+
+  <value-type name="QPoint"/>
+  <value-type name="QPointF"/>
+
+  <value-type name="QRect">
+    <modify-function signature="getCoords(int*,int*,int*,int*)const"> <remove/> </modify-function>
+    <modify-function signature="getRect(int*,int*,int*,int*)const"> <remove/> </modify-function>
+    <modify-function signature="operator&amp;=(QRect)"> <remove/> </modify-function>
+    <modify-function signature="operator|=(QRect)"> <remove/> </modify-function>
+    <modify-function signature="operator&amp;(QRect)const"> <remove/> </modify-function>
+    <modify-function signature="operator|(QRect)const"> <remove/> </modify-function>
+
+    <modify-function signature="intersect(const QRect&amp;)const" remove="all"/> <!--### Obsolete in 4.3-->
+    <modify-function signature="unite(const QRect&amp;)const" remove="all"/> <!--### Obsolete in 4.3-->
+  </value-type>
+
+  <value-type name="QRectF">
+    <modify-function signature="getCoords(double*,double*,double*,double*)const"> <remove/> </modify-function>
+    <modify-function signature="getRect(double*,double*,double*,double*)const"> <remove/> </modify-function>
+    <modify-function signature="operator&amp;=(QRectF)"> <remove/> </modify-function>
+    <modify-function signature="operator|=(QRectF)"> <remove/> </modify-function>
+    <modify-function signature="operator&amp;(QRectF)const"> <remove/> </modify-function>
+    <modify-function signature="operator|(QRectF)const"> <remove/> </modify-function>
+
+    <modify-function signature="intersect(const QRectF&amp;)const" remove="all"/> <!--### Obsolete in 4.3-->
+    <modify-function signature="unite(const QRectF&amp;)const" remove="all"/> <!--### Obsolete in 4.3-->
+  </value-type>
+
+
+  <value-type name="QSize" wrap="struct">
+    <modify-function signature="operator*=(double)"> <access modifier="private"/> </modify-function>
+    <modify-function signature="operator/=(double)"> <access modifier="private"/> </modify-function>
+    <modify-function signature="operator+=(QSize)"> <access modifier="private"/> </modify-function>
+    <modify-function signature="operator-=(QSize)"> <access modifier="private"/> </modify-function>
+    <modify-function signature="rheight()"> <remove/> </modify-function>
+    <modify-function signature="rwidth()"> <remove/> </modify-function>
+  </value-type>
+
+  <value-type name="QSizeF" wrap="struct">
+    <modify-function signature="operator*=(double)"> <access modifier="private"/> </modify-function>
+    <modify-function signature="operator/=(double)"> <access modifier="private"/> </modify-function>
+    <modify-function signature="operator+=(QSizeF)"> <access modifier="private"/> </modify-function>
+    <modify-function signature="operator-=(QSizeF)"> <access modifier="private"/> </modify-function>
+    <modify-function signature="rheight()"> <remove/> </modify-function>
+    <modify-function signature="rwidth()"> <remove/> </modify-function>
+  </value-type>
+
+  <value-type name="QStringMatcher">
+    <modify-function signature="operator=(QStringMatcher)" remove="all"/>
+  </value-type>
+
+  <value-type name="QTime"/>
+
+  <value-type name="QPersistentModelIndex">
+    <modify-function signature="operator=(QPersistentModelIndex)" remove="all"/>
+    <modify-function signature="operator=(QModelIndex)" remove="all"/>
+    <modify-function signature="internalPointer()const" remove="all"/>
+  </value-type>
+
+  <value-type name="QUuid">
+    <modify-function signature="QUuid(const char*)">
+        <remove/>
+    </modify-function>
+  </value-type>
+
+  <value-type name="QLocale">
+    <modify-function signature="toString(unsigned long long) const" remove="all"/>
+    <modify-function signature="toString(unsigned short) const" remove="all"/>
+    <modify-function signature="toString(unsigned int) const" remove="all"/>
+    <modify-function signature="toUInt(QString,bool*,int)const" remove="all"/>
+    <modify-function signature="toULongLong(QString,bool*,int)const" remove="all"/>
+    <modify-function signature="operator=(QLocale)" remove="all"/>
+
+  </value-type>
+
+
+  <value-type name="QBitArray">
+    <modify-function signature="operator[](int)" remove="all"/>
+    <modify-function signature="operator[](int)const" remove="all"/>
+    <modify-function signature="operator[](uint)const" remove="all"/>
+    <modify-function signature="operator[](uint)" remove="all"/>
+
+    <modify-function signature="operator&amp;=(QBitArray)" access="private"/>
+    <modify-function signature="operator=(QBitArray)" access="private"/>
+    <modify-function signature="operator^=(QBitArray)" access="private"/>
+    <modify-function signature="operator|=(QBitArray)" access="private"/>
+    <modify-function signature="operator~()const" access="private"/>
+  </value-type>
+
+  <object-type name="QReadWriteLock"/>
+  <object-type name="QDirIterator"/>
+  <object-type name="QAbstractFileEngineIterator"/>
+  <object-type name="QAbstractItemModel"/>
+
+  <object-type name="QAbstractListModel">
+    <extra-includes>
+        <include file-name="QStringList" location="global"/>
+        <include file-name="QSize" location="global"/>
+    </extra-includes>
+  </object-type>
+
+  <value-type name="QUrl">
+    <extra-includes>
+        <include file-name="QStringList" location="global"/>
+    </extra-includes>
+    <modify-function signature="operator=(QUrl)" remove="all"/>
+    <modify-function signature="operator=(QString)" remove="all"/>
+
+    <modify-function signature="fromPunycode(const QByteArray&amp;)" remove="all"/> <!--### Obsolete in 4.3-->
+    <modify-function signature="toPunycode(const QString&amp;)" remove="all"/> <!--### Obsolete in 4.3-->
+  </value-type>
+
+  <value-type name="QRegExp">
+    <extra-includes>
+        <include file-name="QStringList" location="global"/>
+    </extra-includes>
+    <modify-function signature="operator=(QRegExp)" remove="all"/>
+    <modify-function signature="cap(int)const" remove="all"/>
+    <modify-function signature="errorString()const" remove="all"/>
+    <modify-function signature="pos(int)const" remove="all"/>
+  </value-type>
+
+  <value-type name="QFileInfo">
+    <extra-includes>
+        <include file-name="QDateTime" location="global"/>
+        <include file-name="QDir" location="global"/>
+    </extra-includes>
+    <modify-function signature="operator!=(const QFileInfo &amp;)const" remove="all"/>
+    <modify-function signature="operator==(const QFileInfo &amp;)const" remove="all"/>
+    <modify-function signature="operator=(QFileInfo)" remove="all"/>
+    <modify-function signature="setFile(QFile)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="readLink()const" remove="all"/> <!--### Obsolete in 4.3-->
+  </value-type>
+
+  <interface-type name="QFactoryInterface" java-name="QAbstractFactory" />
+
+  <value-type name="QByteArray">
+
+    <extra-includes>
+        <include file-name="QNoImplicitBoolCast" location="global"/>
+    </extra-includes>
+
+    <!-- removed functions -->
+    <modify-function signature="begin()" remove="all"/>
+    <modify-function signature="begin()const" remove="all"/>
+    <modify-function signature="constBegin()const" remove="all"/>
+    <modify-function signature="constData()const" remove="all"/>
+    <modify-function signature="constEnd()const" remove="all"/>
+    <modify-function signature="count()const" remove="all"/>
+    <modify-function signature="data()const" remove="all"/>
+    <modify-function signature="end()" remove="all"/>
+    <modify-function signature="end()const" remove="all"/>
+    <modify-function signature="number(uint,int)" remove="all"/>
+    <modify-function signature="number(unsigned long long,int)" remove="all"/>
+    <modify-function signature="operator const char *()const" remove="all"/>
+    <modify-function signature="operator const void *()const" remove="all"/>
+    <modify-function signature="operator+=(const char*)" remove="all"/>
+    <modify-function signature="operator=(const char*)" remove="all"/>
+    <modify-function signature="operator[](int)" remove="all"/>
+    <modify-function signature="operator[](int)const" remove="all"/>
+    <modify-function signature="operator[](uint)" remove="all"/>
+    <modify-function signature="operator[](uint)const" remove="all"/>
+    <modify-function signature="push_back(char)" remove="all"/>
+    <modify-function signature="push_back(const QByteArray&amp;)" remove="all"/>
+    <modify-function signature="push_back(const char*)" remove="all"/>
+    <modify-function signature="push_front(char)" remove="all"/>
+    <modify-function signature="push_front(const QByteArray&amp;)" remove="all"/>
+    <modify-function signature="push_front(const char*)" remove="all"/>
+    <modify-function signature="setNum(uint,int)" remove="all"/>
+    <modify-function signature="setNum(unsigned long long,int)" remove="all"/>
+    <modify-function signature="setNum(unsigned short,int)" remove="all"/>
+    <modify-function signature="toLong(bool*, int) const" remove="all"/>
+    <modify-function signature="toLongLong(bool*, int) const" remove="all"/>
+    <modify-function signature="toShort(bool*, int) const" remove="all"/>
+    <modify-function signature="toUInt(bool*, int) const" remove="all"/>
+    <modify-function signature="toULong(bool*, int) const" remove="all"/>
+    <modify-function signature="toULongLong(bool*, int) const" remove="all"/>
+
+    <!-- functions made private... -->
+    <modify-function signature="operator=(QByteArray)" access="private"/>
+    <modify-function signature="operator+=(QByteArray)" remove="all"/>
+    <modify-function signature="operator+=(QString)" remove="all"/>
+    <modify-function signature="operator+=(char)" remove="all"/>
+  </value-type>
+
+  <value-type name="QTextBoundaryFinder">
+    <modify-function signature="QTextBoundaryFinder(QTextBoundaryFinder::BoundaryType,const QChar*,int,unsigned char*,int)" remove="all" />
+    <modify-function signature="operator=(QTextBoundaryFinder)" remove="all" />
+  </value-type>
+
+  <object-type name="QXmlStreamEntityResolver" />
+  <object-type name="QAbstractEventDispatcher"/>
+  <object-type name="QEventLoop"/>
+  <object-type name="QFile">
+    <modify-function signature="readLink()const" remove="all"/> <!--### Obsolete in 4.3-->
+    <modify-function signature="readLink(QString)" remove="all"/> <!--### Obsolete in 4.3-->
+    <modify-function signature="map(long long,long long,QFile::MemoryMapFlags)" remove="all" /> <!-- Can't provide same API and performance -->
+    <modify-function signature="unmap(unsigned char*)" remove="all" /> <!-- Can't provide same API and performance -->
+  </object-type>
+
+  <object-type name="QIODevice"/>
+
+  <object-type name="QCryptographicHash"/>
+  <object-type name="QLibraryInfo"/>
+  <object-type name="QMutex"/>
+  <object-type name="QSemaphore"/>
+  <object-type name="QSocketNotifier"/>
+  <object-type name="QSystemLocale"/>
+  <object-type name="QTemporaryFile">
+    <modify-function signature="fileName()const" rename="uniqueFilename"/>
+  </object-type>
+  <object-type name="QMimeData">
+    <extra-includes>
+        <include file-name="QStringList" location="global"/>
+        <include file-name="QUrl" location="global"/>
+    </extra-includes>
+  </object-type>
+  <object-type name="QTextCodec">
+
+    <modify-function signature="setCodecForTr(QTextCodec*)">
+        <access modifier="private"/>
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcCodecForTr"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setCodecForCStrings(QTextCodec*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcCodecForCStrings"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setCodecForLocale(QTextCodec*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcCodecForLocale"/>
+        </modify-argument>
+    </modify-function>
+
+
+    <modify-function signature="codecForTr()">
+        <remove/>
+    </modify-function>
+
+    <modify-function signature="QTextCodec()">
+        <modify-argument index="-1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="fromUnicode(const QChar*,int,QTextCodec::ConverterState*)const">
+        <remove/>
+    </modify-function>
+
+    <modify-function signature="toUnicode(const char*,int,QTextCodec::ConverterState*)const">
+        <remove/>
+    </modify-function>
+
+    <modify-function signature="toUnicode(const char*)const">
+        <remove/>
+    </modify-function>
+  </object-type>
+
+  <object-type name="QTextDecoder">
+    <modify-function signature="toUnicode(const char*,int)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="toUnicode(QString*,const char*,int)" remove="all"/>
+  </object-type>
+  <object-type name="QTextEncoder">
+    <modify-function signature="fromUnicode(const QChar*,int)">
+        <remove/>
+    </modify-function>
+  </object-type>
+  <object-type name="QTimeLine"/>
+  <object-type name="QTranslator">
+    <modify-function signature="translate(const char*,const char*,const char*,int)const">
+        <remove/>
+    </modify-function>
+  </object-type>
+
+  <object-type name="QWaitCondition"/>
+
+  <object-type name="QFileSystemWatcher">
+    <extra-includes>
+      <include file-name="QStringList" location="global"/>
+    </extra-includes>
+  </object-type>
+
+  <object-type name="QTextCodec::ConverterState">
+    <include file-name="QTextCodec" location="global"/>
+  </object-type>
+
+  <object-type name="QBuffer">
+    <modify-function signature="buffer()">
+        <remove/>
+    </modify-function>
+  </object-type>
+
+  <object-type name="QTimer"/>
+  
+  <value-type name="QLine"/>
+  <value-type name="QLineF"/>
+  
+  <object-type name="QAbstractFileEngineHandler">
+    <modify-function signature="create(const QString &amp;) const">
+        <modify-argument index="return">
+            <define-ownership owner="c++" class="shell"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+
+  <object-type name="QAbstractFileEngine::MapExtensionOption" />
+  <object-type name="QAbstractFileEngine::MapExtensionReturn" />
+  <object-type name="QAbstractFileEngine::UnMapExtensionOption" />
+  <object-type name="QAbstractFileEngine">
+    <extra-includes>
+        <include file-name="QDateTime" location="global"/>
+    </extra-includes>
+    <modify-function signature="map(long long,long long,QFile::MemoryMapFlags)" remove="all" />
+    <modify-function signature="unmap(unsigned char*)" remove="all" />
+  </object-type>
+
+  <object-type name="QProcess">
+    <modify-function signature="readChannelMode()const" remove="all"/> <!--### Obsolete in 4.3-->
+    <modify-function signature="setReadChannelMode(QProcess::ProcessChannelMode)" remove="all"/> <!--### Obsolete in 4.3-->
+  </object-type>
+
+  <object-type name="QSignalMapper">
+    <modify-function signature="mapped(const QString &amp;)">
+        <rename to="mappedString"/>
+    </modify-function>
+    <modify-function signature="mapped(int)">
+        <rename to="mappedInteger"/>
+    </modify-function>
+    <modify-function signature="mapped(QObject *)">
+        <rename to="mappedQObject"/>
+    </modify-function>
+    <modify-function signature="mapped(QWidget *)" remove="all"/>
+
+    <modify-function signature="mapping(QWidget*)const" remove="all"/>
+
+    <modify-function signature="setMapping(QObject*,QWidget*)" remove="all"/>
+  </object-type>
+
+  <object-type name="QObject">
+    <modify-function signature="childEvent(QChildEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="customEvent(QEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="event(QEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="eventFilter(QObject*,QEvent*)">
+        <modify-argument index="2" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="timerEvent(QTimerEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+
+    <modify-function signature="setParent(QObject*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="deleteLater()">
+        <rename to="disposeLater"/>
+    </modify-function>
+
+    <modify-function signature="inherits(const char*)const">
+        <remove/>
+    </modify-function>
+
+    <modify-function signature="property(const char*)const">
+        <access modifier="private"/>
+    </modify-function>
+
+    <modify-function signature="setProperty(const char*,QVariant)">
+        <access modifier="private"/>
+    </modify-function>
+
+
+    <extra-includes>
+        <include file-name="QVarLengthArray" location="global"/>
+    </extra-includes>
+
+  </object-type>
+
+  <object-type name="QCoreApplication">
+    <extra-includes>
+        <include file-name="QStringList" location="global"/>
+    </extra-includes>
+
+    <modify-function signature="argv()" remove="all" /> <!-- Obsolete -->
+    <modify-function signature="argc()" remove="all" /> <!-- Obsolete -->
+
+    <modify-function signature="notify(QObject*,QEvent*)">
+        <modify-argument index="2" invalidate-after-use="yes" />
+    </modify-function>
+
+
+    <modify-function signature="QCoreApplication(int &amp;, char  **)">
+      <access modifier="private"/>
+    </modify-function>
+    <modify-function signature="removePostedEvents(QObject*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="removePostedEvents(QObject*,int)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="installTranslator(QTranslator *)">
+        <modify-argument index="1">
+            <reference-count action="add" variable-name="__rcTranslators"/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="removeTranslator(QTranslator *)">
+        <modify-argument index="1">
+            <reference-count action="remove" variable-name="__rcTranslators"/>
+        </modify-argument>
+    </modify-function>
+
+
+    <modify-function signature="postEvent(QObject*,QEvent*)">
+        <modify-argument index="2">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+
+  <object-type name="QSettings">
+    <extra-includes>
+        <include file-name="QStringList" location="global"/>
+    </extra-includes>
+
+    <modify-function signature="setSystemIniPath(const QString&amp;)" remove="all"/> <!--### Obsolete in 4.3-->
+    <modify-function signature="setUserIniPath(const QString&amp;)" remove="all"/> <!--### Obsolete in 4.3-->
+  </object-type>
+
+  <object-type name="QEvent" polymorphic-base="yes" polymorphic-id-expression="%1-&gt;type() == QEvent::None"/>
+  <object-type name="QChildEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::ChildAdded || %1-&gt;type() == QEvent::ChildPolished || %1-&gt;type() == QEvent::ChildRemoved">
+    <modify-field name="c" read="false" write="false"/>
+  </object-type>
+  <object-type name="QTimerEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Timer"/>
+  <object-type name="QDynamicPropertyChangeEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::DynamicPropertyChange"/>
+
+  <object-type name="QDataStream">
+    <modify-function signature="setDevice(QIODevice*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcDevice"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="unsetDevice()">
+        <inject-code position="end">
+            __rcDevice = null;
+        </inject-code>
+    </modify-function>
+
+
+    <modify-function signature="operator&lt;&lt;(const char*)"> <remove/> </modify-function>
+    <modify-function signature="operator&lt;&lt;(unsigned char)"> <remove/> </modify-function>
+    <modify-function signature="operator&lt;&lt;(unsigned int)"> <remove/> </modify-function>
+    <modify-function signature="operator&lt;&lt;(unsigned long long)"> <remove/> </modify-function>
+    <modify-function signature="operator&lt;&lt;(unsigned short)"> <remove/> </modify-function>
+
+    <modify-function signature="operator&gt;&gt;(char &amp;*)"> <remove/> </modify-function>
+    <modify-function signature="operator&gt;&gt;(uint&amp;)"> <remove/> </modify-function>
+    <modify-function signature="operator&gt;&gt;(unsigned char&amp;)"> <remove/> </modify-function>
+    <modify-function signature="operator&gt;&gt;(unsigned long long&amp;)"> <remove/> </modify-function>
+
+    <modify-function signature="readRawData(char*,int)"> <remove/> </modify-function>
+    <modify-function signature="readBytes(char&amp;*,uint&amp;)"> <remove/> </modify-function>
+    <modify-function signature="writeRawData(const char*,int)"> <remove/> </modify-function>
+    <modify-function signature="writeBytes(const char*,uint)"> <remove/> </modify-function>
+  </object-type>
+
+  <object-type name="QFSFileEngine">
+    <extra-includes>
+           <include file-name="QDateTime" location="global"/>
+        </extra-includes>
+  </object-type>
+
+  <object-type name="QTextStream">
+    <modify-function signature="QTextStream(QByteArray *, QFlags&lt;QIODevice::OpenModeFlag&gt;)"> <remove/> </modify-function>
+    <modify-function signature="QTextStream(QString*,QFlags&lt;QIODevice::OpenModeFlag&gt;)"> <remove/> </modify-function>
+    <modify-function signature="operator&gt;&gt;(QChar&amp;)"> <remove/> </modify-function>
+    <modify-function signature="operator&lt;&lt;(const void*)"> <remove/> </modify-function>
+    <modify-function signature="operator&lt;&lt;(unsigned int)"> <remove/> </modify-function>
+    <modify-function signature="operator&lt;&lt;(unsigned long long)"> <remove/> </modify-function>
+    <modify-function signature="operator&lt;&lt;(const QChar &amp;)"> <remove/> </modify-function>
+    <modify-function signature="operator&lt;&lt;(unsigned long)"> <remove/> </modify-function>
+    <modify-function signature="operator&lt;&lt;(signed long)"> <remove/> </modify-function>
+    <modify-function signature="operator&lt;&lt;(const char*)"> <remove/> </modify-function>
+    <modify-function signature="operator&lt;&lt;(unsigned short)"> <remove/> </modify-function>
+    <modify-function signature="operator&lt;&lt;(const QByteArray&amp;)"> <remove/> </modify-function>
+    <modify-function signature="operator&gt;&gt;(unsigned long long&amp;)"> <remove/> </modify-function>
+    <modify-function signature="operator&gt;&gt;(uint&amp;)"> <remove/> </modify-function>
+    <modify-function signature="operator&gt;&gt;(ulong&amp;)"> <remove/> </modify-function>
+    <modify-function signature="setString(QString*,QFlags&lt;QIODevice::OpenModeFlag&gt;)"> <remove/> </modify-function>
+    <modify-function signature="string()const"> <remove/> </modify-function>
+    <modify-function signature="operator&gt;&gt;(signed long&amp;)"> <remove/> </modify-function>
+    <modify-function signature="operator&gt;&gt;(char*)"> <remove/> </modify-function>
+    <modify-function signature="operator&gt;&gt;(QByteArray&amp;)"> <remove/> </modify-function>
+    <modify-function signature="operator&gt;&gt;(QString&amp;)"> <remove/> </modify-function>
+    <modify-function signature="operator&gt;&gt;(unsigned short&amp;)"> <remove/> </modify-function>
+    <modify-function signature="operator&lt;&lt;(const QString&amp;)"> <remove/> </modify-function>
+
+
+    <modify-function signature="setCodec(QTextCodec *)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcCodec"/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="QTextStream(QIODevice *)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcDevice"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setDevice(QIODevice *)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcDevice"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+
+  <object-type name="QSystemSemaphore" />
+
+  <namespace-type name="QtConcurrent" target-type="class" />
+
+  <value-type name="QFuture" generate="no">
+    <modify-function signature="operator T() const" remove="all" />
+    <modify-function signature="operator=(const QFuture &amp;)" remove="all" />
+  </value-type>
+  <value-type name="QtJambiVoidFuture" java-name="QFutureVoid">
+    <modify-function signature="resultCount()const" remove="all" />
+    <modify-function signature="isResultReadyAt(int)const" remove="all" />
+  </value-type>
+  <value-type name="QtJambiFuture" java-name="QFuture" generic-class="yes" />
+
+  <object-type name="QFutureWatcherBase">
+    <modify-function signature="connectNotify(const char *)" remove="all" />
+    <modify-function signature="disconnectNotify(const char *)" remove="all" />
+  </object-type>
+  <object-type name="QtJambiVoidFutureWatcher" java-name="QFutureWatcherVoid" />
+
+  <object-type name="QFutureWatcher" generate="no">
+    <modify-function signature="future()const" remove="all" />
+  </object-type>
+  <object-type name="QtJambiFutureWatcher" java-name="QFutureWatcher" generic-class="yes" />
+
+  <object-type name="QFutureSynchronizer" generate="no" />
+  <object-type name="QtJambiFutureSynchronizer" generic-class="yes" java-name="QFutureSynchronizer" />
+  <object-type name="QtJambiVoidFutureSynchronizer" java-name="QFutureSynchronizerVoid" />
+  <object-type name="QThreadPool" />
+
+  <object-type name="QFutureIterator" generate="no">
+      <modify-function signature="operator=(const QFuture&amp;)" remove="all" />
+  </object-type>
+  <object-type name="QtJambiFutureIterator" generic-class="yes" java-name="QFutureIterator" />
+  <object-type name="QRunnable" />
+
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'std::*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type '*Private\*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type '*Private&amp;'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QMetaObject'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'FILE\*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QByteArray::Data\*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QTSMFC'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QTSMFI'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QAbstractFileEngine::ExtensionOption const\*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QAbstractFileEngine::Iterator\*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QDataStream::ByteOrder'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: visibility of function '*' modified in class '*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: hiding of function '*' in class '*'"/>
+  <suppress-warning text="WARNING(CppImplGenerator) :: protected function '*' in final class '*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QPointer&lt;*&gt;'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QVector&lt;*&gt;'"/>
+  <suppress-warning text="* private virtual function '*' in 'QAbstractListModel'"/>
+  <suppress-warning text="* private virtual function '*' in 'QAbstractTableModel'"/>
+  <suppress-warning text="* private virtual function '*' in 'QListWidget'"/>
+  <suppress-warning text="* private virtual function '*' in 'QTreeWidget'"/>
+  <suppress-warning text="* private virtual function '*' in 'QFontDialog'"/>
+  <suppress-warning text="* private virtual function '*' in 'QTableWidget'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QDateTime' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QPersistentModelIndex' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QUuid' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QRect' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QTime' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QLocale' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QDir' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QPointF' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QSize' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QFileInfo' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QSizeF' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QRegExp' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QRectF' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QDate' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QPoint' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QUrl' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QFutureWatcherBase::futureInterface', unmatched return type 'QFutureInterfaceBase&amp;'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QFutureWatcherBase::futureInterface', unmatched return type 'QFutureInterfaceBase const&amp;'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QFutureWatcher::futureInterface', unmatched return type 'QFutureInterfaceBase&amp;'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QFutureWatcher::futureInterface', unmatched return type 'QFutureInterfaceBase const&amp;'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QFuture' has equals operators but no qHash() function" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: unknown operator 'T'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QFutureVoid' has equals operators but no qHash() function" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QFuture::constBegin', unmatched return type 'const_iterator'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QFuture::end', unmatched return type 'const_iterator'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QFuture::constEnd', unmatched return type 'const_iterator'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QFuture::QFuture', unmatched parameter type 'QFutureInterface&lt;T&gt;*'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QFuture::begin', unmatched return type 'const_iterator'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::blockingMapped', unmatched return type 'Sequence'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::blockingMapped', unmatched return type 'QList&lt;U&gt;'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::blockingMapped', unmatched return type 'QList&lt;MapFunctor::result_type&gt;'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::blockingMapped', unmatched return type 'OutputSequence'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::filtered', unmatched parameter type 'Iterator'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::filtered', unmatched parameter type 'Sequence const&amp;'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::filter', unmatched parameter type 'Sequence&amp;'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::startFiltered', unmatched return type 'ThreadEngineStarter&lt;Sequence::value_type&gt;'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::startFiltered', unmatched return type 'ThreadEngineStarter&lt;Iterator::value_type&gt;'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::blockingMappedReduced', unmatched return type 'V'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::blockingMappedReduced', unmatched return type 'W'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::blockingMappedReduced', unmatched return type 'ResultType'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::blockingMappedReduced', unmatched return type 'U'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::blockingFiltered', unmatched return type 'OutputSequence'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::blockingFiltered', unmatched return type 'Sequence'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::startMappedReduced', unmatched return type 'ThreadEngineStarter&lt;ResultType&gt;'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::blockingFilteredReduced', unmatched return type 'U'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::blockingFilteredReduced', unmatched return type 'V'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::blockingFilteredReduced', unmatched return type 'ResultType'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::startMap', unmatched return type 'ThreadEngineStarter&lt;void&gt;'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::startThreadEngine', unmatched return type 'ThreadEngineStarter&lt;ThreadEngine::ResultType&gt;'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::mappedReduced', unmatched parameter type 'Iterator'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::mappedReduced', unmatched parameter type 'Sequence const&amp;'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::filteredReduced', unmatched parameter type 'Iterator'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::filteredReduced', unmatched parameter type 'Sequence const&amp;'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::map', unmatched parameter type 'Iterator'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::map', unmatched parameter type 'Sequence&amp;'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::filterInternal', unmatched return type 'ThreadEngineStarter&lt;void&gt;'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::createFunctor', unmatched return type 'QtConcurrent::SelectMemberFunctor0lt;T,Class&gt;::type'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::createFunctor', unmatched return type 'SelectFunctor0&lt;T,T&gt;::type'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::mapped', unmatched parameter type 'Iterator'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::mapped', unmatched parameter type 'Sequence const&amp;'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::blockingMap', unmatched parameter type 'Iterator'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::blockingMap', unmatched parameter type 'Sequence&amp;'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::startMapped', unmatched return type 'QtConcurrent::ThreadEngineStarter&lt;T&gt;'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::startFilteredReduced', unmatched return type 'ThreadEngineStarter&lt;ResultType&gt;'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::run', unmatched parameter type 'Class const*'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::run', unmatched parameter type 'Class*'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::run', unmatched parameter type 'Class const&amp;'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::run', unmatched parameter type 'FunctionObject*'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::run', unmatched parameter type 'FunctionObject'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::run', unmatched parameter type 'T'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::blockingFilter', unmatched parameter type 'Sequence&amp;'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::createFunctor', unmatched return type 'QtConcurrent::SelectMemberFunctor0&lt;T,Class&gt;::type'" />
+
+  <suppress-warning text="WARNING(Parser) :: ** WARNING scope not found for function definition:QFuture&lt;void&gt;::operator= - definition *ignored*" />
+  <suppress-warning text="WARNING(Parser) :: ** WARNING scope not found for function definition:QFutureInterface&lt;void&gt;::future - definition *ignored*" />
+  <suppress-warning text="WARNING(Parser) :: ** WARNING scope not found for function definition:QFutureWatcher&lt;void&gt;::setFuture - definition *ignored*" />
+
+
+</typesystem>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/typesystem_core-java.java	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,1022 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+package generator;
+
+import qt.*;
+import qt.core.*;
+
+class QObject___ extends QObject {
+	
+	// list of QObjects references to prevent them from garbage collecting if they are managed by Qt
+	private static QObject[] __gc_ref_list;
+    
+    // this flag controls whether QObject is managed by D's GC, or it has a parent and therefore managed by Qt
+    private bool __gc_managed = true;
+	
+	// this flag needs to be set false when QObject is deleted from inside Qt so when deleting it from D it won't delete C++ object
+	public bool __no_real_delete = false;
+}// class
+
+abstract class QAbstractItemModel___ extends QAbstractItemModel {
+/*    private native boolean setData_native(long id, int row, int col, Object value, int role);
+
+    public final boolean setData(int row, int col, Object value) {
+        return setData_native(nativeId(), row, col, value, qt.core.Qt.ItemDataRole.DisplayRole);
+    }
+
+    public final boolean setData(int row, int col, Object value, int role) {
+        return setData_native(nativeId(), row, col, value, role);
+    }
+
+    private native Object data_native(long id, int row, int col, int role);
+
+    public final Object data(int row, int col, int role) {
+        return data_native(nativeId(), row, col, role);
+    }
+
+    public final Object data(int row, int col) {
+        return data_native(nativeId(), row, col, Qt.ItemDataRole.DisplayRole);
+    }*/
+}// class
+
+class QTimer___ extends QTimer {
+    static private class QSingleShotTimer extends QObject {
+        private int timerId = -1;
+        public Signal0 timeout = new Signal0();
+
+        public QSingleShotTimer(int msec, QObject obj, String method) {
+            super(obj);
+            timeout.connect(obj, method);
+            timerId = startTimer(msec);
+        }
+
+        protected void disposed() {
+            if (timerId > 0)
+                killTimer(timerId);
+            super.disposed();
+        }
+
+        protected void timerEvent(QTimerEvent e) {
+            if (timerId > 0)
+                killTimer(timerId);
+            timerId = -1;
+            timeout.emit();
+            disposeLater();
+        }
+    }
+
+    public static void singleShot(int msec, QObject obj, String method) {
+        new QSingleShotTimer(msec, obj, method);
+    }
+}// class
+
+class QCoreApplication___ extends QCoreApplication {
+
+    protected static QCoreApplication m_instance = null;
+
+	this(char[][] args)
+	{
+//        if (m_instance != null)
+//            throw new RuntimeException("QCoreApplication can only be initialized once");
+            
+		argc = args.length;
+		argv = toStringzArray(args);
+		this(&argc, argv);
+
+//        m_instance.aboutToQuit.connect(m_instance, "disposeOfMyself()");
+	}
+	
+	private int argc;
+	private char **argv;
+}// class
+
+class QTranslator___ extends QTranslator {
+   	public final bool load(ubyte[] data) {
+        return load(data.ptr, data.length);
+    }
+}// class
+
+class QProcess___ extends QProcess {
+
+    public static class DetachedProcessInfo {
+        public DetachedProcessInfo(boolean success, long pid) {
+            this.success = success;
+            this.pid = pid;
+        }
+
+        public boolean success;
+        public long pid;
+    }
+
+    public static DetachedProcessInfo startDetached(String program, java.util.List<String> arguments, String workingDirectory) {
+        QNativePointer pid = new QNativePointer(QNativePointer.Type.Long);
+        boolean success = startDetached(program, arguments, workingDirectory, pid);
+        return new DetachedProcessInfo(success, pid.longValue());
+    }
+}// class
+
+class QDataStream___ extends QDataStream {
+
+    public final bool readBoolean() {
+        bool res;
+        operator_shift_right_boolean(&res);
+        return res;
+    }
+
+    public final byte readByte() {
+        byte res;
+        operator_shift_right_byte(&res);
+        return res;
+    }
+
+    public final short readShort() {
+        short res;
+        operator_shift_right_short(&res);
+        return res;
+    }
+
+    public final int readInt() {
+        int res;
+        operator_shift_right_int(&res);
+        return res;
+    }
+
+    public final long readLong() {
+        long res;
+        operator_shift_right_long(&res);
+        return res;
+    }
+
+    public final ushort readChar() {
+        ushort res;
+        operator_shift_right_char(&res);
+        return res;
+    }
+
+    public final float readFloat() {
+        float res;
+        operator_shift_right_float(&res);
+        return res;
+    }
+
+    public final double readDouble() {
+        double res;
+        operator_shift_right_double(&res);
+        return res;
+    }
+
+    public final QDataStream writeShort(short s) {
+        writeShort_char(s);
+        return this;
+    }
+/*
+    private static extern(C) void qtd_QDataStream_readString_private(void* __this_nativeId);
+
+    private native void writeString_private(long nativeId, String string);
+
+    public final String readString() {
+        if (nativeId() == 0)
+            throw new QNoNativeResourcesException("Function call on incomplete object of type: " + getClass().getName());
+        return readString_private(nativeId());
+    }
+
+    public final void writeString(String string) {
+        if (nativeId() == 0)
+            throw new QNoNativeResourcesException("Function call on incomplete object of type: " + getClass().getName());
+        writeString_private(nativeId(), string);
+    }
+
+    private native int writeBytes(long id, byte buffer[], int length);
+
+    private native int readBytes(long id, byte buffer[], int length);
+
+    public final int writeBytes(byte buffer[]) {
+        return writeBytes(buffer, buffer.length);
+    }
+
+    public final int writeBytes(byte buffer[], int length) {
+        return writeBytes(nativeId(), buffer, length);
+    }
+
+    public final int readBytes(byte buffer[]) {
+        return readBytes(buffer, buffer.length);
+    }
+
+    public final int readBytes(byte buffer[], int length) {
+        return readBytes(nativeId(), buffer, length);
+    }
+*/
+}// class
+
+class QTextStream___ extends QTextStream {
+/*    public final void setCodec(String codecName) {
+        setCodec(QNativePointer.createCharPointer(codecName));
+        if (codec() != __rcCodec)
+            __rcCodec = null;
+    }
+
+    private QNativePointer srb = new QNativePointer(QNativePointer.Type.Byte, 32) {
+        {
+            setVerificationEnabled(false);
+        }
+    };
+
+    public final byte readByte() {
+        operator_shift_right_byte(srb);
+        return srb.byteValue();
+    }
+
+    public final short readShort() {
+        operator_shift_right_short(srb);
+        return srb.shortValue();
+    }
+
+    public final int readInt() {
+        operator_shift_right_int(srb);
+        return srb.intValue();
+    }
+
+    public final long readLong() {
+        operator_shift_right_long(srb);
+        return srb.longValue();
+    }
+
+    public final float readFloat() {
+        operator_shift_right_float(srb);
+        return srb.floatValue();
+    }
+
+    public final double readDouble() {
+        operator_shift_right_double(srb);
+        return srb.doubleValue();
+    }
+
+    public final QTextStream writeShort(short s) {
+        writeShort_char((char) s);
+        return this;
+    }
+
+    public final QTextStream writeChar(char c) {
+        writeShort_char(c);
+        return this;
+    }
+
+    public final char readChar() {
+        operator_shift_right_short(srb);
+        return srb.charValue();
+    }
+
+    public final String readString() {
+        return readString_native(nativeId());
+    }
+
+    public final void writeString(String string) {
+        writeString_native(nativeId(), string);
+    }
+
+    private final native String readString_native(long id);
+
+    private final native void writeString_native(long id, String string);
+*/
+}// class
+
+class QBitArray___ extends QBitArray {
+/*
+    @qt.QtBlockedSlot
+    public final void xor(QBitArray other) {
+        operator_xor_assign(other);
+    }
+
+    @qt.QtBlockedSlot
+    public final void and(QBitArray other) {
+        operator_and_assign(other);
+    }
+
+    @qt.QtBlockedSlot
+    public final void or(QBitArray other) {
+        operator_or_assign(other);
+    }
+
+    @qt.QtBlockedSlot
+    public final void set(QBitArray other) {
+        operator_assign(other);
+    }
+
+    @qt.QtBlockedSlot
+    public final QBitArray inverted() {
+        return operator_negate();
+    }
+*/
+}// class
+
+// hfr
+
+class QDate___ extends QDate {
+
+    public final int weekNumber() {
+        return weekNumber(null);
+    }
+
+    public final int yearOfWeekNumber() {
+        int np;
+        weekNumber(&np);
+        return np;
+    }
+
+}// class
+
+class QDir___ extends QDir {
+/*
+    @qt.QtBlockedSlot
+    public String at(int i) {
+        return operator_subscript(i);
+    }
+*/
+}// class
+
+class QByteArray___ extends QByteArray {
+    public QByteArray(String s) {
+        this();
+        append(s);
+    }
+
+    public QByteArray(byte data[]) {
+        this(qt.internal.QtJambiInternal.byteArrayToNativePointer(data), data.length);
+    }
+
+    public final boolean contains(String str) {
+        return contains(new QByteArray(str));
+    }
+
+    public final int count(String str) {
+        return count(new QByteArray(str));
+    }
+
+    public final boolean endsWith(String str) {
+        return endsWith(new QByteArray(str));
+    }
+
+    public final QByteArray prepend(String str) {
+        return prepend(new QByteArray(str));
+    }
+
+    public final QByteArray replace(QByteArray before, String after) {
+        return replace(before, new QByteArray(after));
+    }
+
+    public final QByteArray replace(String before, String after) {
+        return replace(new QByteArray(before), new QByteArray(after));
+    }
+
+    public final boolean startsWith(String str) {
+        return startsWith(new QByteArray(str));
+    }
+
+    public final byte[] toByteArray() {
+        byte[] res = new byte[size()];
+
+        for (int i = 0; i < size(); i++) {
+            res[i] = at(i);
+        }
+        return res;
+    }
+
+    @qt.QtBlockedSlot
+    public final QByteArray set(QByteArray other) {
+        operator_assign(other);
+        return this;
+    }
+
+}// class
+
+class QFile___ extends QFile {
+/*
+    public static String decodeName(String localFileName) {
+        return decodeName(qt.QNativePointer.createCharPointer(localFileName));
+    }
+*/
+}// class
+
+class QIODevice___ extends QIODevice {
+
+    /**
+     * Gets a byte from the device.
+     *
+     * @return -1 on failure, or the value of the byte on success
+     */
+/*    public final int getByte() {
+        QNativePointer np = new QNativePointer(QNativePointer.Type.Byte);
+        boolean success = getByte(np);
+        return success ? np.byteValue() : -1;
+    }
+*/
+}// class
+
+class QCryptographicHash___ extends QCryptographicHash {
+
+    public final void addData(byte data[]) {
+        QNativePointer np = qt.internal.QtJambiInternal.byteArrayToNativePointer(data);
+        addData(np, data.length);
+    }
+
+}// class
+
+class QTextCodec___ extends QTextCodec {
+/*
+    static {
+        setCodecForTr(QTextCodec.codecForName("UTF-8"));
+    }
+
+    public static QTextCodec codecForName(String name) {
+        return codecForName(qt.QNativePointer.createCharPointer(name));
+    }
+*/
+}// class
+
+class QBuffer___ extends QBuffer {
+
+    // retain a reference to avoid gc
+    private Object strongDataReference = null;
+
+    public QBuffer(QByteArray byteArray, QObject parent) {
+        this(byteArray.nativePointer(), parent);
+        strongDataReference = byteArray;
+    }
+
+    public QBuffer(QByteArray byteArray) {
+        this(byteArray, null);
+    }
+
+    public final void setBuffer(QByteArray byteArray) {
+        setBuffer(byteArray.nativePointer());
+        strongDataReference = byteArray;
+    }
+
+    public final void setData(byte data[]) {
+        QNativePointer np = qt.internal.QtJambiInternal.byteArrayToNativePointer(data);
+        setData(np, data.length);
+    }
+
+}// class
+
+class QSignalMapper___ extends QSignalMapper {
+
+    private java.util.Hashtable<QObject, QObject> __rcObjectForObject = new java.util.Hashtable<QObject, QObject>();
+
+    private java.util.Hashtable<QObject, Object> __rcWidgetForObject = new java.util.Hashtable<QObject, Object>();
+
+}// class
+
+class QAbstractFileEngine_MapExtensionReturn___ extends QAbstractFileEngine_MapExtensionReturn {
+/*    private QNativePointer currentAddressNativePointer; // don't garbage collect while in use
+    public final void setAddress(String address) {
+        currentAddressNativePointer = address != null ? QNativePointer.createCharPointer(address) : null;
+        address_private(currentAddressNativePointer);
+    }
+
+    public final String address() {
+        QNativePointer np = address_private();
+        return np != null ? qt.internal.QtJambiInternal.charPointerToString(np) : null;
+    }*/
+}// class
+
+class QAbstractFileEngine___ extends QAbstractFileEngine {
+    /**
+     * Adds <tt>path</tt> to the set of paths in which Qt Jambi should search for resources. Resources
+     * can be accessed using the "classpath:" scheme.
+     */
+/*    public static void addSearchPathForResourceEngine(String path)
+    {
+        qt.internal.QClassPathEngine.addSearchPath(path);
+    }
+*/
+    /**
+     * Removes <tt>path</tt> from the set of paths in which Qt Jambi searches
+     * for resources.
+     */
+/*    public static void removeSearchPathForResourceEngine(String path)
+    {
+        qt.internal.QClassPathEngine.removeSearchPath(path);
+    }
+*/
+}// class
+
+class QAbstractFileEngine_UnMapExtensionOption___ extends QAbstractFileEngine_UnMapExtensionOption {
+    private QNativePointer currentAddressNativePointer; // don't garbage collect while in use
+    public final void setAddress(String address) {
+        currentAddressNativePointer = address != null ? QNativePointer.createCharPointer(address) : null;
+        address_private(currentAddressNativePointer);
+    }
+
+    public final String address() {
+        QNativePointer np = address_private();
+        return np != null ? qt.internal.QtJambiInternal.charPointerToString(np) : null;
+    }
+}// class
+
+class QFutureWatcher___ extends QFutureWatcher {
+
+    public final QFuture<T> future() {
+        if (nativeId() == 0)
+            throw new QNoNativeResourcesException("Function call on incomplete object of type: " +getClass().getName());
+        return __qt_future(nativeId());
+    }
+    private native QFuture<T> __qt_future(long nativeId);
+
+}// class
+
+class QFutureWatcherVoid___ extends QFutureWatcherVoid {
+
+    public final QFutureVoid future() {
+        if (nativeId() == 0)
+            throw new QNoNativeResourcesException("Function call on incomplete object of type: " +getClass().getName());
+        return __qt_future(nativeId());
+    }
+
+    private native QFutureVoid __qt_future(long nativeId);
+
+}// class
+
+class QFutureSynchronizer___ extends QFutureSynchronizer {
+
+    public final java.util.List<QFuture<T>> futures() {
+        if (nativeId() == 0)
+            throw new QNoNativeResourcesException("Function call on incomplete object of type: " +getClass().getName());
+        return __qt_futures(nativeId());
+    }
+    private native java.util.List<QFuture<T>> __qt_futures(long nativeId);
+
+}// class
+
+class QFutureSynchronizerVoid___ extends QFutureSynchronizerVoid {
+
+    public final java.util.List<QFutureVoid> futures() {
+        if (nativeId() == 0)
+            throw new QNoNativeResourcesException("Function call on incomplete object of type: " +getClass().getName());
+        return __qt_futures(nativeId());
+    }
+    private native java.util.List<QFutureVoid> __qt_futures(long nativeId);
+
+}// class
+
+class QLineF___ extends QLineF {
+    /*
+    public final QLineF.IntersectType intersect(QLineF line, qt.core.QPointF intersectionPoint) {
+   return intersect(line, intersectionPoint != null ? intersectionPoint.nativePointer() : null);
+}
+*/
+}// class
+
+/**
+The QtConcurrent class contains static methods for running computations in parallel (using separate threads)
+on the items in a java.util.Collection, such as a Vector or LinkedList. We will now describe these methods.
+
+The QtConcurrent::map(), QtConcurrent::mapped() and QtConcurrent::mappedReduced() functions run computations in parallel on the items in a sequence such as a QList or a QVector. QtConcurrent::map() modifies a sequence in-place, QtConcurrent::mapped() returns a new sequence containing the modified content, and QtConcurrent::mappedReduced() returns a single result.
+Concurrent Map
+<p>
+QtConcurrent::mapped() takes an input sequence and a map function. This map function is then called for each item in the sequence, and a new sequence containing the return values from the map function is returned.
+<p>
+The map function must be of the form:
+<pre>
+     U function(const T &amp;t);
+</pre>
+T and U can be any type (and they can even be the same type), but T must match the type stored in the sequence. The function returns the modified or mapped content.
+<p>
+This example shows how to apply a scale function to all the items in a sequence:
+<pre>
+     QImage scaled(const QImage &amp;image)
+     {
+         return image.scaled(100, 100);
+     }
+
+     QList &lt;QImage&gt; images = ...;
+     QFuture&lt;QImage&gt; thumbnails = QtConcurrent::mapped(images, scaled);
+</pre>
+The results of the map are made available through QFuture. See the QFuture and QFutureWatcher documentation for more information on how to use QFuture in your applications.
+<p>
+If you want to modify a sequence in-place, use QtConcurrent::map(). The map function must then be of the form:
+<pre>
+     U function(T &amp;t);
+</pre>
+Note that the return value and return type of the map function are not used.
+<p>
+Using QtConcurrent::map() is similar to using QtConcurrent::mapped():
+<pre>
+     void scale(QImage &amp;image)
+     {
+         image = image.scaled(100, 100);
+     }
+
+     QList&lt;QImage&gt; images = ...;
+     QFuture&lt;void&gt; future = QtConcurrent::map(images, scale);
+</pre>
+Since the sequence is modified in place, QtConcurrent::map() does not return any results via QFuture. However, you can still use QFuture and QFutureWatcher to monitor the status of the map.
+Concurrent Map-Reduce
+<p>
+QtConcurrent::mappedReduced() is similar to QtConcurrent::mapped(), but instead of returning a sequence with the new results, the results are combined into a single value using a reduce function.
+<p>
+The reduce function must be of the form:
+<pre>
+     V function(T &amp;result, const U &amp;intermediate)
+</pre>
+T is the type of the final result, U is the return type of the map function. Note that the return value and return type of the reduce function are not used.
+<p>
+Call QtConcurrent::mappedReduced() like this:
+<pre>
+     void addToCollage(QImage &amp;collage, const QImage &amp;thumbnail)
+     {
+         QPainter p(&amp;collage);
+         static QPoint offset = QPoint(0, 0);
+         p.drawImage(offset, thumbnail);
+         offset += ...;
+     }
+
+     QList&lt;QImage&gt; images = ...;
+     QFuture&lt;QImage&gt; collage = QtConcurrent::mappedReduced(images, scaled, addToCollage);
+</pre>
+The reduce function will be called once for each result returned by the map function, and should merge the intermediate into the result variable. QtConcurrent::mappedReduced() guarantees that only one thread will call reduce at a time, so using a mutex to lock the result variable is not neccesary. The QtConcurrent::ReduceOptions enum provides a way to control the order in which the reduction is done. If QtConcurrent::UnorderedReduce is used (the default), the order is undefined, while QtConcurrent::OrderedReduce ensures that the reduction is done in the order of the original sequence.
+Additional API Features
+Using Iterators instead of Sequence
+<p>
+Each of the above functions has a variant that takes an iterator range instead of a sequence. You use them in the same way as the sequence variants:
+<pre>
+     QList&lt;QImage&gt; images = ...;
+
+     QFuture&lt;QImage&gt; thumbnails = QtConcurrent::mapped(images.constBegin(), images.constEnd(), scaled);
+
+     // map in-place only works on non-const iterators
+     QFuture&lt;void&gt; future = QtConcurrent::map(images.begin(), images.end(), scale);
+
+     QFuture&lt;QImage&gt; collage = QtConcurrent::mappedReduced(images.constBegin(), images.constEnd(), scaled, addToCollage);
+</pre>
+Blocking Variants
+<p>
+Each of the above functions has a blocking variant that returns the final result instead of a QFuture. You use them in the same way as the asynchronous variants.
+<pre>
+     QList&lt;QImage&gt; images = ...;
+
+     // each call blocks until the entire operation is finished
+     QList&lt;QImage&gt; future = QtConcurrent::blockingMapped(images, scaled);
+
+     QtConcurrent::blockingMap(images, scale);
+
+     QImage collage = QtConcurrent::blockingMappedReduced(images, scaled, addToCollage);
+</pre>
+Note that the result types above are not QFuture objects, but real result types (in this case, QList&lt;QImage&gt; and QImage).
+Using Member Functions
+<p>
+QtConcurrent::map(), QtConcurrent::mapped(), and QtConcurrent::mappedReduced() accept pointers to member functions. The member function class type must match the type stored in the sequence:
+<pre>
+     // squeeze all strings in a QStringList
+     QStringList strings = ...;
+     QFuture&lt;void&gt; squeezedStrings = QtConcurrent::map(strings, &amp;QString::squeeze);
+
+     // swap the rgb values of all pixels on a list of images
+     QList&lt;QImage&gt; images = ...;
+     QFuture&lt;QImage&gt; bgrImages = QtConcurrent::mapped(images, &amp;QImage::rgbSwapped);
+
+     // create a set of the lengths of all strings in a list
+     QStringList strings = ...;
+     QFuture&lt;QSet&lt;int&gt; &gt; wordLengths = QtConcurrent::mappedReduced(string, &amp;QString::length, &amp;QSet&lt;int&gt;::insert);
+</pre>
+Note that when using QtConcurrent::mappedReduced(), you can mix the use of normal and member functions freely:
+<p>
+<pre>
+     // can mix normal functions and member functions with QtConcurrent::mappedReduced()
+
+     // compute the average length of a list of strings
+     extern void computeAverage(int &amp;average, int length);
+     QStringList strings = ...;
+     QFuture&lt;int&gt; averageWordLength = QtConcurrent::mappedReduced(strings, &amp;QString::length, computeAverage);
+
+     // create a set of the color distribution of all images in a list
+     extern int colorDistribution(const QImage &amp;string);
+     QList&lt;QImage&gt; images = ...;
+     QFuture&lt;QSet&lt;int&gt; &gt; totalColorDistribution = QtConcurrent::mappedReduced(images, colorDistribution, QSet&lt;int&gt;::insert);
+</pre>
+Using Function Objects
+<p>
+QtConcurrent::map(), QtConcurrent::mapped(), and QtConcurrent::mappedReduced() accept function objects, which can be used to add state to a function call. The result_type typedef must define the result type of the function call operator:
+<pre>
+     struct Scaled
+     {
+         Scaled(int size)
+         : m_size(size) { }
+
+         typedef QImage result_type;
+
+         QImage operator()(const QImage &amp;image)
+         {
+             return image.scaled(m_size, m_size);
+         }
+
+         int m_size;
+     };
+
+     QList&lt;QImage&gt; images = ...;
+     QFuture&lt;QImage&gt; thumbnails = QtConcurrent::mapped(images, Scaled(100));
+</pre>
+Using Bound Function Arguments
+<p>
+Note that Qt does not provide support for bound functions. This is provided by 3rd party libraries like Boost or C++ TR1 Library Extensions.
+<p>
+If you want to use a map function that takes more than one argument you can use boost::bind() or std::tr1::bind() to transform it onto a function that takes one argument.
+<p>
+As an example, we'll use QImage::scaledToWidth():
+<pre>
+     QImage QImage::scaledToWidth(int width, Qt::TransformationMode) const;
+</pre>
+scaledToWidth takes three arguments (including the "this" pointer) and can't be used with QtConcurrent::mapped() directly, because QtConcurrent::mapped() expects a function that takes one argument. To use QImage::scaledToWidth() with QtConcurrent::mapped() we have to provide a value for the width and the transformation mode:
+<pre>
+     boost::bind(&amp;QImage::scaledToWidth, 100 Qt::SmoothTransformation)
+</pre>
+The return value from boost::bind() is a function object (functor) with the following signature:
+<pre>
+     QImage scaledToWith(const QImage &amp;image)
+</pre>
+This matches what QtConcurrent::mapped() expects, and the complete example becomes:
+<pre>
+     QList&gt;QImage&lt; images = ...;
+     QFuture&gt;QImage&lt; thumbnails = QtConcurrent::mapped(images, boost::bind(&amp;QImage::scaledToWidth, 100 Qt::SmoothTransformation));
+</pre>
+*/
+class QtConcurrent___ extends QtConcurrent {
+
+    static {
+        qt.QtJambi_LibraryInitializer.init();
+        qt.core.QtJambi_LibraryInitializer.init();
+    }
+
+    /**
+     * An implemetation of this interface is given one to QtConcurrent's map() methods.
+     * The map() method of this interface is called for each object in a java.util.Collection.
+     *
+     */
+    public interface MapFunctor<T> {
+
+        /**
+         * This function is called for each item in the Collection. The function is then free to alter <tt>object</tt> as it see fit.
+         */
+        public void map(T object);
+    }
+    /**
+     *  Calls function once for each item in sequence. The function is passed a reference to the item, so that any modifications done to the item will appear in sequence.
+     */
+    public static native <T> QFutureVoid map(java.util.Collection<T> sequence, MapFunctor<T> functor);
+
+    /**
+     *  Calls function once for each item in sequence. The function is passed a reference to the item, so that any modifications done to the item will appear in sequence.
+     */
+    public static native <T> void blockingMap(java.util.Collection<T> sequence, MapFunctor<T> functor);
+
+    /**
+     * Implement this interface to perform a mapped operation. An implementation of the interface is sendt
+     * to ome of the mapped methods of QtConcurrent, which applies the MappedFunctor.map() method to all elements in a collection,
+     * and returns the result.
+     */
+    public interface MappedFunctor<U, T> {
+
+        /**
+         * This method is called for each object in a collection. It should returned a new altered
+         * object.
+         */
+        public U map(T object);
+    }
+
+    /**
+     * Calls function once for each item in sequence and returns a future with each mapped item as a result. You can QFutureIterator to iterate through the results.
+     *
+     */
+    public static native <U, T> QFuture<U> mapped(java.util.Collection<T> sequence, MappedFunctor<U, T> functor);
+
+    /**
+     * Calls function once for each item in sequence and returns a future with each mapped item as a result. You can QFutureIterator to iterate through the results.
+     */
+    public static native <U, T> java.util.List<U> blockingMapped(java.util.Collection<T> sequence, MappedFunctor<U, T> functor);
+
+    /**
+     * Implement this interface in order to perform a reduce operation.
+     * <p>
+     * The reduce method will be called once per intermediate result (the result of the mapping of the data)
+     * and the very first time the reduce() method is called for the particular data set, the result is set to
+     * the returned value of the defaultResult() method.
+     */
+    public interface ReducedFunctor<U, T> {
+        public U defaultResult();
+
+        /**
+         *  Performs a reduce operation on <tt>intermediate</tt>. <tt>result</tt> is the result of the reduction.
+         */
+        public void reduce(U result, T intermediate);
+    }
+
+    /**
+     * This is an overloaded method provided for convenience.
+     * <p>
+     * It is equivalent of mappedReduced(sequence, functor, reducedFunctor, ReduceOption.UnorderedReduce, ReduceOption.SequentialReduce)
+     */
+    public static <U, V, T> QFuture<U> mappedReduced(java.util.Collection<T> sequence, MappedFunctor<V, T> functor, ReducedFunctor<U, V> reducedFunctor) {
+        return mappedReduced(sequence, functor, reducedFunctor, ReduceOption.UnorderedReduce, ReduceOption.SequentialReduce);
+    }
+
+
+    /**
+     * This is an overloaded method provided for convenience.
+     * <p>
+     * Note that while mapFunction is called concurrently, only one thread at a time will call reduceFunction. The order in which reduceFunction is called is determined by reduceOptions.
+     *
+     */
+    public static <U, V, T> QFuture<U> mappedReduced(java.util.Collection<T> sequence, MappedFunctor<V, T> functor, ReducedFunctor<U, V> reducedFunctor, ReduceOption ... options) {
+        return mappedReduced(sequence, functor, reducedFunctor, new ReduceOptions(options));
+    }
+
+    /**
+     * Calls mapFunction once for each item in sequence. The return value of each mapFunction is passed to reduceFunction.
+     * <p>
+     * Note that while mapFunction is called concurrently, only one thread at a time will call reduceFunction. The order in which reduceFunction is called is determined by reduceOptions.
+     *
+     */
+    public static <U, V, T> QFuture<U> mappedReduced(java.util.Collection<T> sequence, MappedFunctor<V, T> functor, ReducedFunctor<U, V> reducedFunctor, ReduceOptions options) {
+        return mappedReduced(sequence, functor, reducedFunctor, options.value());
+    }
+
+    private native static <U, V, T> QFuture<U> mappedReduced(java.util.Collection<T> sequence, MappedFunctor<V, T> functor, ReducedFunctor<U, V> reducedFunctor, int options);
+
+
+    /**
+     * This is an overloaded method provided for convenience.
+     * <p>
+     * It is equivalent of calling blockingMappedReduced(sequence, functor, reducedFunctor, ReduceOption.UnorderedReduce, ReduceOption.SequentialReduce)
+     *
+     */
+    public static <U, V, T> U blockingMappedReduced(java.util.Collection<T> sequence, MappedFunctor<V, T> functor, ReducedFunctor<U, V> reducedFunctor) {
+        return blockingMappedReduced(sequence, functor, reducedFunctor, ReduceOption.UnorderedReduce, ReduceOption.SequentialReduce);
+    }
+
+    /**
+     * Calls mapFunction once for each item in sequence. The return value of each mapFunction is passed to reduceFunction.
+     * <p>
+     * Note that while mapFunction is called concurrently, only one thread at a time will call reduceFunction. The order in which reduceFunction is called is determined by reduceOptions.
+     * <p>
+     * Note: This function will block until all items in the sequence have been processed.
+     */
+    public static <U, V, T> U blockingMappedReduced(java.util.Collection<T> sequence, MappedFunctor<V, T> functor, ReducedFunctor<U, V> reducedFunctor, ReduceOption ... options) {
+        return blockingMappedReduced(sequence, functor, reducedFunctor, new ReduceOptions(options));
+    }
+
+    /**
+     * Calls mapFunction once for each item in sequence. The return value of each mapFunction is passed to reduceFunction.
+     * <p>
+     * Note that while mapFunction is called concurrently, only one thread at a time will call reduceFunction. The order in which reduceFunction is called is determined by reduceOptions.
+     * <p>
+     * Note: This function will block until all items in the sequence have been processed.
+     */
+    public static <U, V, T> U blockingMappedReduced(java.util.Collection<T> sequence, MappedFunctor<V, T> functor, ReducedFunctor<U, V> reducedFunctor, ReduceOptions options) {
+        return blockingMappedReduced(sequence, functor, reducedFunctor, options.value());
+    }
+
+    private native static <U, V, T> U blockingMappedReduced(java.util.Collection<T> sequence, MappedFunctor<V, T> functor, ReducedFunctor<U, V> reducedFunctor, int options);
+
+    /**
+     * An implementation of this interface is given to one of QtConcurrent's filtered() methods.
+     * The filter method if this interface is called for each item in a java.util.Collection.
+     *
+     */
+    public interface FilteredFunctor<T> {
+
+        /**
+         *  This method is called for each item in a java.util.Collection. The items for which
+         *  this method returns true are removed from the collection.
+         */
+        public boolean filter(T object);
+    }
+
+    /**
+     * Calls filterFunctor's filtered() method once for each item in sequence and returns a new Sequence of kept items. If filterFunction returns true, a copy of the item is put in the new Sequence. Otherwise, the item will not appear in the new Sequence.
+     */
+    public native static <T> QFuture<T> filtered(java.util.Collection<T> sequence, FilteredFunctor<T> filteredFunctor);
+
+    /**
+     * Calls filterFunctor's filtered() method once for each item in sequence and returns a new Sequence of kept items. If filterFunction returns true, a copy of the item is put in the new Sequence. Otherwise, the item will not appear in the new Sequence.
+     */
+    public native static <T> java.util.List<T> blockingFiltered(java.util.Collection<T> sequence, FilteredFunctor<T> filteredFunctor);
+
+
+    /**
+     * This is an overloaded method provided for convenience. It is equivalent of calling filteredReduced(sequence, filteredFunctor, ReduceOption.UnorderedReduce, ReduceOption.Seq This is an overloaded method provided for convenience. It is equivalent of calling filteredReduced)
+     */
+    public static <U, T> QFuture<U> filteredReduced(java.util.Collection<T> sequence, FilteredFunctor<T> filteredFunctor, ReducedFunctor<U, T> reducedFunctor) {
+        return filteredReduced(sequence, filteredFunctor, reducedFunctor, ReduceOption.UnorderedReduce, ReduceOption.SequentialReduce);
+    }
+
+    /**
+     * Calls filterFunction once for each item in sequence. If filterFunction returns true for an item, that item is then passed to reduceFunction. In other words, the return value is the result of reduceFunction for each item where filterFunction returns true.
+     * <p>
+     * Note that while filterFunction is called concurrently, only one thread at a time will call reduceFunction. The order in which reduceFunction is called is undefined if reduceOptions is QtConcurrent::UnorderedReduce. If reduceOptions is QtConcurrent::OrderedReduce, reduceFunction is called in the order of the original sequence.
+     */
+    public static <U, T> QFuture<U> filteredReduced(java.util.Collection<T> sequence, FilteredFunctor<T> filteredFunctor, ReducedFunctor<U, T> reducedFunctor, ReduceOption ... options) {
+        return filteredReduced(sequence, filteredFunctor, reducedFunctor, new ReduceOptions(options));
+    }
+
+    /**
+     * Calls filterFunction once for each item in sequence. If filterFunction returns true for an item, that item is then passed to reduceFunction. In other words, the return value is the result of reduceFunction for each item where filterFunction returns true.
+     * <p>
+     * Note that while filterFunction is called concurrently, only one thread at a time will call reduceFunction. The order in which reduceFunction is called is undefined if reduceOptions is QtConcurrent::UnorderedReduce. If reduceOptions is QtConcurrent::OrderedReduce, reduceFunction is called in the order of the original sequence.
+     */
+    public static <U, T> QFuture<U> filteredReduced(java.util.Collection<T> sequence, FilteredFunctor<T> filteredFunctor, ReducedFunctor<U, T> reducedFunctor, ReduceOptions options) {
+        return filteredReduced(sequence, filteredFunctor, reducedFunctor, options.value());
+    }
+    private native static <U, T> QFuture<U> filteredReduced(java.util.Collection<T> sequence, FilteredFunctor<T> filteredFunctor, ReducedFunctor<U, T> reducedFunctor, int options);
+
+    /**
+     * This is an overloaded method provided for convenience. It is the equivalent of calling blockingFilteredReduced(sequence, filteredFunctor, reducedFunctor, ReduceOption.UnorderedReduce, ReduceOption.SequentialReduce)
+     */
+    public static <U, T> U blockingFilteredReduced(java.util.Collection<T> sequence, FilteredFunctor<T> filteredFunctor, ReducedFunctor<U, T> reducedFunctor) {
+        return blockingFilteredReduced(sequence, filteredFunctor, reducedFunctor, ReduceOption.UnorderedReduce, ReduceOption.SequentialReduce);
+    }
+
+    /**
+     * Calls filterFunction once for each item in sequence. If filterFunction returns true for an item, that item is then passed to reduceFunction. In other words, the return value is the result of reduceFunction for each item where filterFunction returns true.
+     * <p>
+     * Note that while filterFunction is called concurrently, only one thread at a time will call reduceFunction. The order in which reduceFunction is called is undefined if reduceOptions is QtConcurrent::UnorderedReduce. If reduceOptions is QtConcurrent::OrderedReduce, reduceFunction is called in the order of the original sequence.
+     */
+    public static <U, T> U blockingFilteredReduced(java.util.Collection<T> sequence, FilteredFunctor<T> filteredFunctor, ReducedFunctor<U, T> reducedFunctor, ReduceOption ... options) {
+        return blockingFilteredReduced(sequence, filteredFunctor, reducedFunctor, new ReduceOptions(options));
+    }
+
+    /**
+     * Calls filterFunction once for each item in sequence. If filterFunction returns true for an item, that item is then passed to reduceFunction. In other words, the return value is the result of reduceFunction for each item where filterFunction returns true.
+     * <p>
+     * Note that while filterFunction is called concurrently, only one thread at a time will call reduceFunction. The order in which reduceFunction is called is undefined if reduceOptions is QtConcurrent::UnorderedReduce. If reduceOptions is QtConcurrent::OrderedReduce, reduceFunction is called in the order of the original sequence.
+     */
+    public static <U, T> U blockingFilteredReduced(java.util.Collection<T> sequence, FilteredFunctor<T> filteredFunctor, ReducedFunctor<U, T> reducedFunctor, ReduceOptions options) {
+        return blockingFilteredReduced(sequence, filteredFunctor, reducedFunctor, options.value());
+    }
+
+    private native static <U, T> U blockingFilteredReduced(java.util.Collection<T> sequence, FilteredFunctor<T> filteredFunctor, ReducedFunctor<U, T> reducedFunctor, int options);
+
+    /**
+     * Executes the method <tt>m</tt> through the QtConcurrent framework with the given arguments. The returned QFuture object's result wil be the
+     * return value of <tt>m</tt>. Note that this method does not accept function that return void. use runVoidMethod() for this.
+     */
+    public static <T> QFuture<T> run(Object _this, java.lang.reflect.Method m, Object ... args) {
+        if (m.getReturnType() == null || m.getReturnType().equals(Void.TYPE))
+            throw new IllegalArgumentException("Cannot call run on method returning void. Use 'runVoidMethod' instead.");
+
+        return runPrivate(_this, m.getDeclaringClass(), m, args, qt.internal.QtJambiInternal.resolveConversionSchema(m.getParameterTypes(), m.getParameterTypes()), qt.internal.QtJambiInternal.typeConversionCode(m.getReturnType()));
+    }
+    private native static <T> QFuture<T> runPrivate(Object _this, Class<?> declaringClass, java.lang.reflect.Method m, Object args[], int conversionScheme[], byte returnType);
+
+    /**
+     * Executes the method <tt>m</tt> with the given arguments using the QtConcurrent framework. Notice that runVoidMethod() does not
+     * accept methods that has a return value. Use the run() method for this purpose.
+     */
+    public static QFutureVoid runVoidMethod(Object _this, java.lang.reflect.Method m, Object ... args) {
+        if (m.getReturnType() != null && !m.getReturnType().equals(Void.TYPE))
+            throw new IllegalArgumentException("Cannot call runVoidMethod on method returning non-void type. Use 'run' instead.");
+
+        return runVoidMethodPrivate(_this, m.getDeclaringClass(), m, args, qt.internal.QtJambiInternal.resolveConversionSchema(m.getParameterTypes(), m.getParameterTypes()));
+    }
+    private native static QFutureVoid runVoidMethodPrivate(Object _this, Class<?> declaringClass, java.lang.reflect.Method m, Object args[], int conversionScheme[]);
+
+
+}// class
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/typesystem_core-java.xml	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,1969 @@
+<?xml version="1.0"?>
+<typesystem package="qt.core" default-superclass="QtDObject">
+    <inject-code>
+    qt.Utilities.loadQtLibrary("QtCore");
+    </inject-code>
+
+    <template name="core.return_string_instead_of_char*">
+        public final String %FUNCTION_NAME() {
+            QNativePointer np = %FUNCTION_NAME_private();
+            String returned = "";
+            int i=0;
+            while (np.byteAt(i) != 0) returned += (char) np.byteAt(i++);
+            return returned;
+        }
+    </template>
+    <template name="core.call_with_string_instead_of_char*">
+        public final void %FUNCTION_NAME(String %ARG_NAME) {
+            %FUNCTION_NAME(QNativePointer.createCharPointer(%ARG_NAME));
+        }
+    </template>
+
+    <template name="core.private_function_return_self">
+      public final %RETURN_TYPE %FUNCTION_NAME(%ARGUMENTS) {
+        %FUNCTION_NAME_private(%ARGUMENT_NAMES);
+        return this;
+      }
+    </template>
+
+    <template name="core.unary_other_type">
+        <insert-template name="core.private_function_return_self">
+            <replace from="%RETURN_TYPE" to="%OUT_TYPE"/>
+            <replace from="%ARGUMENTS" to="%IN_TYPE other"/>
+            <replace from="%ARGUMENT_NAMES" to="other"/>
+        </insert-template>
+    </template>
+
+    <template name="core.unary_self_type">
+        <insert-template name="core.unary_other_type">
+            <replace from="%IN_TYPE" to="%TYPE"/>
+            <replace from="%OUT_TYPE" to="%TYPE"/>
+        </insert-template>
+    </template>
+
+    <template name="core.operator_assign_self_type">
+        <insert-template name="core.unary_self_type">
+            <replace from="%FUNCTION_NAME" to="operator_assign"/>
+        </insert-template>
+    </template>
+
+    <template name="core.operator_assign_other_type">
+        <insert-template name="core.unary_other_type">
+            <replace from="%FUNCTION_NAME" to="operator_assign"/>
+        </insert-template>
+    </template>
+
+    <template name="core.call_through_with_byte[]_instead_of_char*_and_int">
+    public final int %FUNCTION_NAME(byte data[]) {
+        QNativePointer np = new QNativePointer(QNativePointer.Type.Byte, data.length);
+        %COPY_IN
+        int returned = (int) %FUNCTION_NAME(np, data.length);
+        %COPY_OUT
+        return returned;
+    }
+    </template>
+
+    <template name="core.read_with_byte[]_instead_of_char*_and_int">
+        <insert-template name="core.call_through_with_byte[]_instead_of_char*_and_int">
+            <replace from="%COPY_IN" to=""/>
+            <replace from="%COPY_OUT" to="for (int i=0; i&lt;returned; ++i) data[i] = np.byteAt(i);"/>
+        </insert-template>
+    </template>
+
+    <template name="core.write_with_byte[]_instead_of_char*_and_int">
+        <insert-template name="core.call_through_with_byte[]_instead_of_char*_and_int">
+            <replace from="%COPY_OUT" to=""/>
+            <replace from="%COPY_IN" to="for (int i=0; i&lt;data.length; ++i) np.setByteAt(i, data[i]);"/>
+        </insert-template>
+    </template>
+
+    <template name="core.stream_operator_shift_right">
+        public final %STREAM_TYPE operator_shift_right(%TYPE array[]) {
+            QNativePointer np = new QNativePointer(QNativePointer.Type.%NATIVEPOINTER_TYPE);
+            for (int i=0; i&lt;array.length; ++i) {
+                operator_shift_right_%TYPE(np);
+                array[i] = np.%VALUE_FUNCTION();
+            }
+
+            return this;
+        }
+    </template>
+
+    <template name="core.convert_primitive_array_to_java">
+        %JNITYPEArray %out = __jni_env-&gt;New%JAVATYPEArray((int) %len);
+        __jni_env-&gt;Set%JAVATYPEArrayRegion(%out, 0, (int) %len, (%JNITYPE *) %in);
+        %JNITYPE *__ptr = (%JNITYPE *) %in;
+        Q_UNUSED(__ptr);
+        %JNITYPEArray __array = %out;
+        Q_UNUSED(__array);
+    </template>
+
+    <template name="core.cleanup_convert_primitive_array_to_java">
+        if (%len &gt; 0) __jni_env-&gt;Get%JAVATYPEArrayRegion(__array, 0, %len, __ptr);
+    </template>
+
+    <template name="core.get_array_length">
+        int %out = __jni_env-&gt;GetArrayLength((jarray) %ARRAY);
+    </template>
+
+    <template name="core.cleanup_convert_primitive_array_from_java">
+        __jni_env-&gt;Release%JAVATYPEArrayElements((%JNITYPEArray) %1, (%JNITYPE *) __ptr, 0);
+    </template>
+
+    <template name="core.convert_primitive_array_from_java">
+        %CTYPE *%out = (%CTYPE *) __jni_env-&gt;Get%JAVATYPEArrayElements((%JNITYPEArray) %in, 0);
+        %CTYPE *__ptr = %out;
+    </template>
+
+
+<primitive-type name="bool" java-name="bool" jni-name="jboolean"/>
+<primitive-type name="double" jni-name="jdouble"/>
+<primitive-type name="float" jni-name="jfloat"/>
+
+    <primitive-type name="__int64" java-name="long" preferred-conversion="no" jni-name="jlong"/>
+    <primitive-type name="unsigned __int64" java-name="long" preferred-conversion="no" jni-name="jlong"/>
+    <primitive-type name="unsigned long long" java-name="ulong" preferred-conversion="no" jni-name="jlong"/>
+    <primitive-type name="long long" java-name="long" preferred-conversion="no" jni-name="jlong"/>
+    <primitive-type name="quintptr" preferred-conversion="no" java-name="ulong" jni-name="jlong" />
+
+    <primitive-type name="short" preferred-conversion="no" java-name="short" jni-name="jchar"/>
+    <primitive-type name="short" preferred-java-type="no" java-name="short" jni-name="jshort" />
+    <primitive-type name="signed short" java-name="short" preferred-conversion="no" jni-name="jchar"/>
+    <primitive-type name="unsigned short" java-name="ushort" preferred-conversion="no" jni-name="jchar"/>
+
+    <primitive-type name="char" java-name="char" jni-name="jbyte"/>
+    <primitive-type name="signed char" java-name="char" preferred-conversion="no" jni-name="jbyte"/>
+    <primitive-type name="unsigned char" java-name="ubyte" preferred-conversion="no" jni-name="jbyte"/>
+
+    <primitive-type name="int" jni-name="jint"/>
+    <primitive-type name="signed int" java-name="int" preferred-conversion="no" jni-name="jint"/>
+    <primitive-type name="uint" java-name="uint" preferred-conversion="no" jni-name="jint"/>
+    <primitive-type name="ulong" java-name="uint" preferred-conversion="no" jni-name="jint"/>
+    <primitive-type name="unsigned int" java-name="uint" preferred-conversion="no" jni-name="jint"/>
+    <primitive-type name="signed long" java-name="int" preferred-conversion="no" jni-name="jint"/>
+    <primitive-type name="long" java-name="int" preferred-conversion="no" jni-name="jint"/>
+    <primitive-type name="unsigned long" java-name="uint" preferred-conversion="no" jni-name="jint"/>
+
+    <primitive-type name="WId" java-name="long" preferred-conversion="no" jni-name="jlong"/>
+    <primitive-type name="Qt::HANDLE" java-name="long" preferred-conversion="no" jni-name="jlong"/>
+<!--    <primitive-type name="QVariant::Type" java-name="int" preferred-conversion="no" jni-name="jint"/>-->
+
+    <primitive-type name="QByteRef" java-name="byte" preferred-conversion="no" jni-name="jbyte"/>
+    <primitive-type name="QBitRef" java-name="bool" preferred-conversion="no" jni-name="jboolean"/>
+
+    <primitive-type name="QBool" java-name="bool" preferred-conversion="no" jni-name="bool"/>
+<!--    <primitive-type name="QVariant" java-name="QVariant" jni-name="jVariant"/>-->
+
+    <primitive-type name="jobject" java-name="java.lang.Object" jni-name="jobject"/>
+
+
+    <value-type name="QDate">
+        <inject-code>
+            <import-file name="typesystem_core-java.java" quote-after-line="class QDate___" quote-before-line="}// class"/>
+        </inject-code>
+        <extra-includes>
+            <include file-name="qt.QNativePointer" location="java"/>
+        </extra-includes>
+        <modify-function signature="weekNumber(int*)const">
+            <access modifier="private"/>
+            <modify-argument index="1">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+
+    </value-type>
+
+
+    <value-type name="QDir">
+        <inject-code>
+            <import-file name="typesystem_core-java.java" quote-after-line="class QDir___" quote-before-line="}// class"/>
+        </inject-code>
+        <modify-function signature="operator[](int)const" access="private"/>
+
+    </value-type>
+
+    <template name="core.multiply-devide-add-subtract">
+    public final %TYPE multiply(double d) { operator_multiply_assign(d); return this; }
+    public final %TYPE divide(double d) { operator_divide_assign(d); return this; }
+    public final %TYPE add(%TYPE p) { operator_add_assign(p); return this; }
+    public final %TYPE subtract(%TYPE p) { operator_subtract_assign(p); return this; }
+    </template>
+
+    <value-type name="QPoint">
+        <modify-function signature="operator*=(double)"
+                         access="private"
+                         associated-to="multiply(double d)"/>
+        <modify-function signature="operator/=(double)"
+             access="private"
+             associated-to="divide(double d)"/>
+        <modify-function signature="operator+=(QPoint)"
+             access="private"
+             associated-to="add(QPoint)"/>
+        <modify-function signature="operator-=(QPoint)"
+             access="private"
+             associated-to="subtract(QPoint)"/>
+        <modify-function signature="rx()"> <remove/> </modify-function>
+        <modify-function signature="ry()"> <remove/> </modify-function>
+        <inject-code>
+            <insert-template name="core.multiply-devide-add-subtract">
+                <replace from="%TYPE" to="QPoint"/>
+            </insert-template>
+        </inject-code>
+    </value-type>
+
+    <value-type name="QPointF">
+        <modify-function signature="operator*=(double)"
+             access="private"
+             associated-to="multiply(double d)"/>
+        <modify-function signature="operator/=(double)"
+             access="private"
+             associated-to="divide(double d)"/>
+        <modify-function signature="operator+=(QPointF)"
+             access="private"
+             associated-to="add(QPointF p)"/>
+        <modify-function signature="operator-=(QPointF)"
+             access="private"
+             associated-to="subtract(QPointF p)"/>
+        <modify-function signature="rx()"> <remove/> </modify-function>
+        <modify-function signature="ry()"> <remove/> </modify-function>
+        <inject-code>
+            <insert-template name="core.multiply-devide-add-subtract">
+                <replace from="%TYPE" to="QPointF"/>
+            </insert-template>
+        </inject-code>
+    </value-type>
+
+    <value-type name="QSize">
+        <inject-code>
+            <insert-template name="core.multiply-devide-add-subtract">
+                <replace from="%TYPE" to="QSize"/>
+            </insert-template>
+        </inject-code>
+    </value-type>
+
+    <value-type name="QSizeF">
+        <inject-code>
+            <insert-template name="core.multiply-devide-add-subtract">
+                <replace from="%TYPE" to="QSizeF"/>
+            </insert-template>
+        </inject-code>
+    </value-type>
+
+    <value-type name="QLocale">
+        <extra-includes>
+            <include file-name="qt.QNativePointer" location="java"/>
+        </extra-includes>
+
+        <template name="core.qlocale_to_type_general">
+        public final %TYPE %FUNCTION_NAME(String s%EXTRA_ARGUMENTS) {
+            QNativePointer ok = new QNativePointer(QNativePointer.Type.Boolean);
+            %TYPE returned = (%TYPE) %FUNCTION_NAME(s, ok%EXTRA_CALL_ARGUMENTS);
+            if (!ok.booleanValue())
+                throw new NumberFormatException(s);
+            return returned;
+        }
+        </template>
+
+
+        <template name="core.qlocale_to_type_integer">
+            <insert-template name="core.qlocale_to_type_general">
+                <replace from="%EXTRA_ARGUMENTS" to=", int base"/>
+                <replace from="%EXTRA_CALL_ARGUMENTS" to=", base"/>
+            </insert-template>
+
+        public final %TYPE %FUNCTION_NAME(String s) {
+            return %FUNCTION_NAME(s, 0);
+        }
+        </template>
+
+        <template name="core.qlocale_to_type_float">
+            <insert-template name="core.qlocale_to_type_general">
+                <replace from="%EXTRA_ARGUMENTS" to=""/>
+                <replace from="%EXTRA_CALL_ARGUMENTS" to=""/>
+            </insert-template>
+        </template>
+
+        <modify-function signature="toDouble(QString,bool*)const">
+            <access modifier="private"/>
+            <modify-argument index="2">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+        <inject-code>
+            <insert-template name="core.qlocale_to_type_float">
+                <replace from="%TYPE" to="double"/>
+                <replace from="%FUNCTION_NAME" to="toDouble"/>
+            </insert-template>
+        </inject-code>
+
+        <modify-function signature="toFloat(QString,bool*)const">
+            <access modifier="private"/>
+            <modify-argument index="2">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+        <inject-code>
+            <insert-template name="core.qlocale_to_type_float">
+                <replace from="%TYPE" to="float"/>
+                <replace from="%FUNCTION_NAME" to="toFloat"/>
+            </insert-template>
+        </inject-code>
+
+        <modify-function signature="toInt(QString,bool*,int)const">
+            <access modifier="private"/>
+            <modify-argument index="2">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="3">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+        <inject-code>
+            <insert-template name="core.qlocale_to_type_integer">
+                <replace from="%TYPE" to="int"/>
+                <replace from="%FUNCTION_NAME" to="toInt"/>
+            </insert-template>
+        </inject-code>
+
+        <modify-function signature="toLongLong(QString,bool*,int)const">
+            <access modifier="private"/>
+            <rename to="toLong"/>
+            <modify-argument index="2">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="3">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+        <inject-code>
+            <insert-template name="core.qlocale_to_type_integer">
+                <replace from="%TYPE" to="long"/>
+                <replace from="%FUNCTION_NAME" to="toLong"/>
+            </insert-template>
+        </inject-code>
+
+        <modify-function signature="toShort(QString,bool*,int)const">
+            <access modifier="private"/>
+            <modify-argument index="2">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="3">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+        <inject-code>
+            <insert-template name="core.qlocale_to_type_integer">
+                <replace from="%TYPE" to="short"/>
+                <replace from="%FUNCTION_NAME" to="toShort"/>
+            </insert-template>
+        </inject-code>
+
+        <modify-function signature="toUShort(QString,bool*,int)const">
+            <access modifier="private"/>
+            <rename to="toChar"/>
+            <modify-argument index="2">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="3">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+        <inject-code>
+            <insert-template name="core.qlocale_to_type_integer">
+                <replace from="%TYPE" to="char"/>
+                <replace from="%FUNCTION_NAME" to="toChar"/>
+            </insert-template>
+        </inject-code>
+    </value-type>
+
+    <object-type name="QAbstractItemModel">
+        <modify-function signature="parent()const" remove="all"/>
+        <extra-includes>
+            <include file-name="QStringList" location="global"/>
+            <include file-name="QSize" location="global"/>
+        </extra-includes>
+        <modify-function signature="match(QModelIndex,int,QVariant,int,QFlags&lt;Qt::MatchFlag&gt;)const">
+            <modify-argument index="5">
+                <replace-default-expression with="Qt.MatchFlag.MatchStartsWith, Qt.MatchFlag.MatchWrap"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="createIndex(int, int, int)const">
+            <remove/>
+        </modify-function>
+        <inject-code class="java">
+            <import-file name="typesystem_core-java.java" quote-after-line="class QAbstractItemModel___" quote-before-line="}// class"/>
+        </inject-code>
+        <inject-code class="native">
+    extern "C" JNIEXPORT jboolean JNICALL QTJAMBI_FUNCTION_PREFIX(Java_com_trolltech_qt_core_QAbstractItemModel_setData_1native)
+    (JNIEnv *__jni_env,
+     jobject,
+     jlong __this_nativeId,
+     jint row, jint col, jobject value, jint role)
+    {
+        QtJambiShell_QAbstractItemModel *__qt_this =
+            (QtJambiShell_QAbstractItemModel *) qtjambi_from_jlong(__this_nativeId);
+        QVariant qt_value = qtjambi_to_qvariant(__jni_env, value);
+
+        QModelIndex index = __qt_this-&gt;index(row, col, QModelIndex());
+        return __qt_this-&gt;setData(index, qt_value, role);
+    }
+
+    extern "C" JNIEXPORT jobject JNICALL QTJAMBI_FUNCTION_PREFIX(Java_com_trolltech_qt_core_QAbstractItemModel_data_1native)
+    (JNIEnv *__jni_env,
+     jobject,
+     jlong __this_nativeId,
+     jint row, jint col, jint role)
+    {
+        QtJambiShell_QAbstractItemModel *__qt_this =
+            (QtJambiShell_QAbstractItemModel *) qtjambi_from_jlong(__this_nativeId);
+
+        QModelIndex index = __qt_this-&gt;index(row, col, QModelIndex());
+        return qtjambi_from_qvariant(__jni_env, __qt_this-&gt;data(index, role));
+    }
+        </inject-code>
+
+        <modify-function signature="mimeData(QList&lt;QModelIndex&gt;)const">
+            <modify-argument index="0">
+                <define-ownership class="shell" owner="c++"/>
+            </modify-argument>
+        </modify-function>
+    </object-type>
+
+
+    <value-type name="QByteArray">
+        <inject-code class="java">
+            <import-file name="typesystem_core-java.java" quote-after-line="class QByteArray___" quote-before-line="}// class"/>
+
+            <template name="QByteArray::toType(base)">
+    public final %TYPE% %NAME%(int base) throws NumberFormatException{
+        qt.QNativePointer ok = new qt.QNativePointer(qt.QNativePointer.Type.Boolean);
+        %TYPE% res = %NAME%_private(ok, base);
+        if(!ok.booleanValue()){
+            throw new NumberFormatException();
+        }
+        return res;
+    }
+
+    public %TYPE% %NAME%(){
+        return %NAME%(10);
+    }
+            </template>
+
+            <insert-template name="QByteArray::toType(base)">
+                <replace from="%NAME%" to="toChar"/>
+                <replace from="%TYPE%" to="char"/>
+            </insert-template>
+
+            <insert-template name="QByteArray::toType(base)">
+                <replace from="%NAME%" to="toInt"/>
+                <replace from="%TYPE%" to="int"/>
+            </insert-template>
+
+            <template name="QByteArray::toType()">
+    public final %TYPE% %NAME%() throws NumberFormatException{
+        qt.QNativePointer ok = new qt.QNativePointer(qt.QNativePointer.Type.Boolean);
+        %TYPE% res = %NAME%_private(ok);
+        if(!ok.booleanValue()){
+            throw new NumberFormatException();
+        }
+        return res;
+    }
+            </template>
+
+            <insert-template name="QByteArray::toType()">
+                <replace from="%NAME%" to="toDouble"/>
+                <replace from="%TYPE%" to="double"/>
+            </insert-template>
+
+            <insert-template name="QByteArray::toType()">
+                <replace from="%NAME%" to="toFloat"/>
+                <replace from="%TYPE%" to="float"/>
+            </insert-template>
+
+        </inject-code>
+
+
+
+   <modify-function signature="toUShort(bool*, int) const" rename="toChar_private" access="private">
+        <modify-argument index="1">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="2">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="toInt(bool*, int) const" rename="toInt_private" access="private">
+        <modify-argument index="1">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="2">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="toDouble(bool*) const">
+        <rename to="toDouble_private"/>
+        <access modifier="private"/>
+        <modify-argument index="1">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="toFloat(bool*) const">
+        <rename to="toFloat_private"/>
+        <access modifier="private"/>
+        <modify-argument index="1">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="QByteArray(const char*)" remove="all"/>
+
+    <modify-function signature="QByteArray(const char*,int)">
+        <access modifier="private"/>
+    </modify-function>
+
+
+    <modify-function signature="append(QString)">
+        <access modifier="private"/>
+        <rename to="append_private"/>
+    </modify-function>
+    <inject-code>
+        <insert-template name="core.unary_other_type">
+            <replace from="%IN_TYPE" to="String"/>
+            <replace from="%OUT_TYPE" to="QByteArray"/>
+            <replace from="%FUNCTION_NAME" to="append"/>
+        </insert-template>
+    </inject-code>
+
+    <modify-function signature="append(const char*)">
+        <remove/>
+    </modify-function>
+
+    <modify-function signature="append(QByteArray)">
+        <access modifier="private"/>
+        <rename to="append_private"/>
+    </modify-function>
+    <inject-code>
+        <insert-template name="core.unary_self_type">
+            <replace from="%TYPE" to="QByteArray"/>
+            <replace from="%FUNCTION_NAME" to="append"/>
+        </insert-template>
+    </inject-code>
+
+    <modify-function signature="append(char)">
+        <access modifier="private"/>
+        <rename to="append_private"/>
+    </modify-function>
+    <inject-code>
+        <insert-template name="core.unary_other_type">
+            <replace from="%IN_TYPE" to="byte"/>
+            <replace from="%OUT_TYPE" to="QByteArray"/>
+            <replace from="%FUNCTION_NAME" to="append"/>
+        </insert-template>
+    </inject-code>
+
+    <modify-function signature="contains(const char*)const">
+        <remove/>
+    </modify-function>
+
+
+    <modify-function signature="count(const char*)const">
+        <remove/>
+    </modify-function>
+
+
+    <modify-function signature="endsWith(const char*)const">
+        <remove/>
+    </modify-function>
+
+
+    <modify-function signature="fill(char,int)">
+        <access modifier="private"/>
+        <rename to="fill_private"/>
+        <modify-argument index="2">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+    <inject-code>
+        <insert-template name="core.private_function_return_self">
+            <replace from="%RETURN_TYPE" to="QByteArray"/>
+            <replace from="%FUNCTION_NAME" to="fill"/>
+            <replace from="%ARGUMENTS" to="byte b, int size"/>
+            <replace from="%ARGUMENT_NAMES" to="b, size"/>
+        </insert-template>
+
+        public QByteArray  fill(byte b) {
+            return fill(b, -1);
+        }
+
+    </inject-code>
+
+    <modify-function signature="indexOf(const char*,int)const">
+        <remove/>
+    </modify-function>
+
+    <modify-function signature="insert(int,QByteArray)">
+        <access modifier="private"/>
+        <rename to="insert_private"/>
+    </modify-function>
+    <inject-code>
+        <insert-template name="core.private_function_return_self">
+            <replace from="%RETURN_TYPE" to="QByteArray"/>
+            <replace from="%FUNCTION_NAME" to="insert"/>
+            <replace from="%ARGUMENTS" to="int i, QByteArray ba"/>
+            <replace from="%ARGUMENT_NAMES" to="i, ba"/>
+        </insert-template>
+    </inject-code>
+
+    <modify-function signature="insert(int,char)">
+        <access modifier="private"/>
+        <rename to="insert_private"/>
+    </modify-function>
+    <inject-code>
+        <insert-template name="core.private_function_return_self">
+            <replace from="%RETURN_TYPE" to="QByteArray"/>
+            <replace from="%FUNCTION_NAME" to="insert"/>
+            <replace from="%ARGUMENTS" to="int i, byte b"/>
+            <replace from="%ARGUMENT_NAMES" to="i, b"/>
+        </insert-template>
+    </inject-code>
+
+    <modify-function signature="insert(int,QString)">
+        <access modifier="private"/>
+        <rename to="insert_private"/>
+    </modify-function>
+    <inject-code>
+        <insert-template name="core.private_function_return_self">
+            <replace from="%RETURN_TYPE" to="QByteArray"/>
+            <replace from="%FUNCTION_NAME" to="insert"/>
+            <replace from="%ARGUMENTS" to="int i, String str"/>
+            <replace from="%ARGUMENT_NAMES" to="i, str"/>
+        </insert-template>
+    </inject-code>
+
+    <modify-function signature="insert(int,const char*)" remove="all"/>
+    <modify-function signature="lastIndexOf(const char*,int)const" remove="all"/>
+
+    <modify-function signature="prepend(QByteArray)">
+        <access modifier="private"/>
+        <rename to="prepend_private"/>
+    </modify-function>
+    <inject-code>
+        <insert-template name="core.unary_self_type">
+            <replace from="%TYPE" to="QByteArray"/>
+            <replace from="%FUNCTION_NAME" to="prepend"/>
+        </insert-template>
+    </inject-code>
+
+    <modify-function signature="prepend(char)">
+        <access modifier="private"/>
+        <rename to="prepend_private"/>
+    </modify-function>
+    <inject-code>
+        <insert-template name="core.unary_other_type">
+            <replace from="%OUT_TYPE" to="QByteArray"/>
+            <replace from="%IN_TYPE" to="byte"/>
+            <replace from="%FUNCTION_NAME" to="prepend"/>
+        </insert-template>
+    </inject-code>
+
+    <modify-function signature="prepend(const char*)">
+        <remove/>
+    </modify-function>
+
+
+    <modify-function signature="remove(int,int)">
+        <access modifier="private"/>
+        <rename to="remove_private"/>
+    </modify-function>
+    <inject-code>
+        <insert-template name="core.private_function_return_self">
+            <replace from="%RETURN_TYPE" to="QByteArray"/>
+            <replace from="%FUNCTION_NAME" to="remove"/>
+            <replace from="%ARGUMENTS" to="int pos, int len"/>
+            <replace from="%ARGUMENT_NAMES" to="pos, len"/>
+        </insert-template>
+    </inject-code>
+
+    <modify-function signature="replace(QByteArray,const char*)">
+        <remove/>
+    </modify-function>
+
+
+    <template name="core.qbytearray_replace">
+        <insert-template name="core.private_function_return_self">
+            <replace from="%RETURN_TYPE" to="QByteArray"/>
+            <replace from="%FUNCTION_NAME" to="replace"/>
+            <replace from="%ARGUMENTS" to="%BEFORE_TYPE before, %AFTER_TYPE after"/>
+            <replace from="%ARGUMENT_NAMES" to="before, after"/>
+        </insert-template>
+    </template>
+
+    <modify-function signature="replace(char,QByteArray)">
+        <access modifier="private"/>
+        <rename to="replace_private"/>
+    </modify-function>
+    <inject-code>
+        <insert-template name="core.qbytearray_replace">
+            <replace from="%BEFORE_TYPE" to="byte"/>
+            <replace from="%AFTER_TYPE" to="QByteArray"/>
+        </insert-template>
+    </inject-code>
+
+    <modify-function signature="replace(QString,const char*)">
+        <remove/>
+    </modify-function>
+
+
+    <modify-function signature="replace(int,int,const char*)">
+        <remove/>
+    </modify-function>
+
+    <modify-function signature="replace(const char*,const char*)">
+        <remove/>
+    </modify-function>
+
+    <modify-function signature="replace(const char*,QByteArray)">
+        <remove/>
+    </modify-function>
+
+    <modify-function signature="replace(int,int,QByteArray)">
+        <access modifier="private"/>
+        <rename to="replace_private"/>
+    </modify-function>
+    <inject-code>
+        <insert-template name="core.private_function_return_self">
+            <replace from="%RETURN_TYPE" to="QByteArray"/>
+            <replace from="%FUNCTION_NAME" to="replace"/>
+            <replace from="%ARGUMENTS" to="int pos, int len, QByteArray after"/>
+            <replace from="%ARGUMENT_NAMES" to="pos, len, after"/>
+        </insert-template>
+    </inject-code>
+
+    <modify-function signature="replace(char,const char*)">
+        <remove/>
+    </modify-function>
+
+    <modify-function signature="replace(char,QString)">
+        <access modifier="private"/>
+        <rename to="replace_private"/>
+    </modify-function>
+    <inject-code>
+        <insert-template name="core.qbytearray_replace">
+            <replace from="%BEFORE_TYPE" to="byte"/>
+            <replace from="%AFTER_TYPE" to="String"/>
+        </insert-template>
+    </inject-code>
+
+    <modify-function signature="replace(char,char)">
+        <access modifier="private"/>
+        <rename to="replace_private"/>
+    </modify-function>
+    <inject-code>
+        <insert-template name="core.qbytearray_replace">
+            <replace from="%BEFORE_TYPE" to="byte"/>
+            <replace from="%AFTER_TYPE" to="byte"/>
+        </insert-template>
+    </inject-code>
+
+    <modify-function signature="replace(QByteArray,QByteArray)">
+        <access modifier="private"/>
+        <rename to="replace_private"/>
+    </modify-function>
+    <inject-code>
+        <insert-template name="core.qbytearray_replace">
+            <replace from="%BEFORE_TYPE" to="QByteArray"/>
+            <replace from="%AFTER_TYPE" to="QByteArray"/>
+        </insert-template>
+    </inject-code>
+
+    <modify-function signature="replace(QString,QByteArray)">
+        <access modifier="private"/>
+        <rename to="replace_private"/>
+    </modify-function>
+    <inject-code>
+        <insert-template name="core.qbytearray_replace">
+            <replace from="%BEFORE_TYPE" to="String"/>
+            <replace from="%AFTER_TYPE" to="QByteArray"/>
+        </insert-template>
+    </inject-code>
+
+    <modify-function signature="setNum(int,int)">
+        <access modifier="private"/>
+        <rename to="setNum_private"/>
+        <modify-argument index="2">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+
+    <template name="core.qbytearray_setNum_integer">
+        <insert-template name="core.private_function_return_self">
+            <replace from="%RETURN_TYPE" to="QByteArray"/>
+            <replace from="%FUNCTION_NAME" to="setNum"/>
+            <replace from="%ARGUMENTS" to="%INTEGER_TYPE n, int base"/>
+            <replace from="%ARGUMENT_NAMES" to="n, base"/>
+        </insert-template>
+
+        public QByteArray setNum(%INTEGER_TYPE n) {
+            return setNum(n, 10);
+        }
+    </template>
+    <template name="core.qbytearray_setNum_float">
+        <insert-template name="core.private_function_return_self">
+            <replace from="%RETURN_TYPE" to="QByteArray"/>
+            <replace from="%FUNCTION_NAME" to="setNum"/>
+            <replace from="%ARGUMENTS" to="%FLOAT_TYPE n, char f, int prec"/>
+            <replace from="%ARGUMENT_NAMES" to="n, (byte) f, prec"/>
+        </insert-template>
+
+        public final QByteArray setNum(%FLOAT_TYPE n, char f) {
+            return setNum(n, f, 6);
+        }
+
+        public final QByteArray setNum(%FLOAT_TYPE n) {
+            return setNum(n, 'g');
+        }
+    </template>
+
+    <inject-code>
+        <insert-template name="core.qbytearray_setNum_integer">
+            <replace from="%INTEGER_TYPE" to="int"/>
+        </insert-template>
+    </inject-code>
+
+    <inject-code>
+        <insert-template name="core.qbytearray_setNum_integer">
+            <replace from="%INTEGER_TYPE" to="char"/>
+        </insert-template>
+    </inject-code>
+
+
+    <modify-function signature="setNum(float,char,int)">
+        <access modifier="private"/>
+        <rename to="setNum_private"/>
+        <modify-argument index="2">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="3">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+    <inject-code>
+        <insert-template name="core.qbytearray_setNum_float">
+            <replace from="%FLOAT_TYPE" to="float"/>
+        </insert-template>
+    </inject-code>
+
+    <modify-function signature="setNum(long long,int)">
+        <access modifier="private"/>
+        <rename to="setNum_private"/>
+        <modify-argument index="2">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+    <inject-code>
+        <insert-template name="core.qbytearray_setNum_integer">
+            <replace from="%INTEGER_TYPE" to="long"/>
+        </insert-template>
+    </inject-code>
+
+    <modify-function signature="setNum(double,char,int)">
+        <access modifier="private"/>
+        <rename to="setNum_private"/>
+        <modify-argument index="2">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="3">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+    <inject-code>
+        <insert-template name="core.qbytearray_setNum_float">
+            <replace from="%FLOAT_TYPE" to="double"/>
+        </insert-template>
+    </inject-code>
+
+    <modify-function signature="setNum(short,int)">
+        <access modifier="private"/>
+        <rename to="setNum_private"/>
+        <modify-argument index="2">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+    <inject-code>
+    <insert-template name="core.qbytearray_setNum_integer">
+            <replace from="%INTEGER_TYPE" to="short"/>
+        </insert-template>
+    </inject-code>
+
+    <modify-function signature="startsWith(const char*)const">
+        <remove/>
+    </modify-function>
+
+
+    <modify-function signature="fromRawData(const char*,int)">
+        <remove/>
+    </modify-function>
+
+    </value-type>
+
+
+    <object-type name="QFile">
+        <inject-code>
+            <import-file name="typesystem_core-java.java" quote-after-line="class QFile___" quote-before-line="}// class"/>
+        </inject-code>
+        <modify-function signature="decodeName(const char*)">
+            <access modifier="private"/>
+        </modify-function>
+
+    </object-type>
+
+
+    <object-type name="QIODevice">
+        <inject-code>
+            <import-file name="typesystem_core-java.java" quote-after-line="class QIODevice___" quote-before-line="}// class"/>
+        </inject-code>
+        <extra-includes>
+            <include file-name="qt.QNativePointer" location="java"/>
+        </extra-includes>
+
+        <modify-function signature="putChar(char)" rename="putByte"/>
+        <modify-function signature="ungetChar(char)" rename="ungetByte"/>
+        <modify-function signature="getChar(char*)">
+            <access modifier="private"/>
+            <rename to="getByte"/>
+        </modify-function>
+
+
+        <modify-function signature="peek(char*,long long)">
+            <access modifier="private"/>
+        </modify-function>
+        <inject-code>
+            <insert-template name="core.read_with_byte[]_instead_of_char*_and_int">
+                <replace from="%FUNCTION_NAME" to="peek"/>
+            </insert-template>
+        </inject-code>
+
+        <modify-function signature="read(char*,long long)">
+            <access modifier="private"/>
+        </modify-function>
+        <inject-code>
+            <insert-template name="core.read_with_byte[]_instead_of_char*_and_int">
+                <replace from="%FUNCTION_NAME" to="read"/>
+            </insert-template>
+        </inject-code>
+
+        <modify-function signature="readLine(char*,long long)">
+            <access modifier="private"/>
+        </modify-function>
+        <inject-code>
+            <insert-template name="core.read_with_byte[]_instead_of_char*_and_int">
+                <replace from="%FUNCTION_NAME" to="readLine"/>
+            </insert-template>
+        </inject-code>
+
+        <modify-function signature="write(const char*,long long)">
+            <access modifier="private"/>
+        </modify-function>
+        <inject-code>
+            <insert-template name="core.write_with_byte[]_instead_of_char*_and_int">
+                <replace from="%FUNCTION_NAME" to="write"/>
+            </insert-template>
+        </inject-code>
+
+        <template name="core.iodevice_convert_char*_to_byte[]">
+            <insert-template name="core.convert_primitive_array_to_java">
+                <replace from="%JNITYPE" to="jbyte"/>
+                <replace from="%JAVATYPE" to="Byte"/>
+            </insert-template>
+        </template>
+
+        <template name="core.iodevice_cleanup_to_java">
+            <insert-template name="core.cleanup_convert_primitive_array_to_java">
+                <replace from="%JNITYPE" to="jbyte"/>
+                <replace from="%JAVATYPE" to="Byte"/>
+            </insert-template>
+        </template>
+
+
+        <template name="core.iodevice_cleanup">
+            jint %out = (jint) %in;
+            <insert-template name="core.cleanup_convert_primitive_array_from_java">
+                <replace from="%JAVATYPE" to="Byte"/>
+                <replace from="%JNITYPE" to="jbyte"/>
+            </insert-template>
+
+        </template>
+
+        <template name="core.iodevice_convert_byte[]_to_char*">
+            <insert-template name="core.convert_primitive_array_from_java">
+                <replace from="%CTYPE" to="char"/>
+                <replace from="%JAVATYPE" to="Byte"/>
+                <replace from="%JNITYPE" to="jbyte"/>
+            </insert-template>
+        </template>
+
+        <modify-function signature="readData(char*,long long)">
+            <modify-argument index="0">
+                <replace-type modified-type="int"/>
+                <conversion-rule class="native">
+                    <insert-template name="core.iodevice_cleanup"/>
+                </conversion-rule>
+                <conversion-rule class="shell">
+                    qint64 %out = %in;
+                    <insert-template name="core.iodevice_cleanup_to_java">
+                        <replace from="%len" to="(int) %in"/>
+                    </insert-template>
+                </conversion-rule>
+            </modify-argument>
+
+            <modify-argument index="1">
+                <replace-type modified-type="byte[]"/>
+                <conversion-rule class="shell">
+                    <insert-template name="core.iodevice_convert_char*_to_byte[]">
+                        <replace from="%len" to="%2"/>
+                    </insert-template>
+                </conversion-rule>
+                <conversion-rule class="native">
+                    <insert-template name="core.iodevice_convert_byte[]_to_char*"/>
+                </conversion-rule>
+            </modify-argument>
+
+            <modify-argument index="2">
+                <remove-argument/>
+                <conversion-rule class="shell">
+                    // nothing
+                </conversion-rule>
+                <conversion-rule class="native">
+                <insert-template name="core.get_array_length">
+                    <replace from="%ARRAY" to="%1"/>
+                </insert-template>
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="writeData(const char*,long long)">
+            <modify-argument index="1">
+                <replace-type modified-type="byte[]"/>
+                <conversion-rule class="shell">
+                    <insert-template name="core.iodevice_convert_char*_to_byte[]">
+                        <replace from="%len" to="%2"/>
+                    </insert-template>
+                </conversion-rule>
+                <conversion-rule class="native">
+                    <insert-template name="core.iodevice_convert_byte[]_to_char*"/>
+                </conversion-rule>
+            </modify-argument>
+
+            <modify-argument index="2">
+                <remove-argument/>
+                <conversion-rule class="shell">
+                    // nothing
+                </conversion-rule>
+                <conversion-rule class="native">
+                    <insert-template name="core.get_array_length">
+                        <replace from="%ARRAY" to="%1"/>
+                    </insert-template>
+                </conversion-rule>
+            </modify-argument>
+
+            <modify-argument index="0">
+                <replace-type modified-type="int"/>
+                <conversion-rule class="native">
+                    <insert-template name="core.iodevice_cleanup"/>
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="readLineData(char*,long long)">
+            <modify-argument index="1">
+                <replace-type modified-type="byte[]"/>
+                <conversion-rule class="shell">
+                    <insert-template name="core.iodevice_convert_char*_to_byte[]">
+                        <replace from="%len" to="%2"/>
+                    </insert-template>
+                </conversion-rule>
+                <conversion-rule class="native">
+                    <insert-template name="core.iodevice_convert_byte[]_to_char*"/>
+                </conversion-rule>
+            </modify-argument>
+
+            <modify-argument index="2">
+                <remove-argument/>
+                <conversion-rule class="shell">
+                    // nothing
+                </conversion-rule>
+                <conversion-rule class="native">
+                    <insert-template name="core.get_array_length">
+                        <replace from="%ARRAY" to="%1"/>
+                    </insert-template>
+                </conversion-rule>
+            </modify-argument>
+
+            <modify-argument index="0">
+                <replace-type modified-type="int"/>
+                <conversion-rule class="native">
+                    <insert-template name="core.iodevice_cleanup"/>
+                </conversion-rule>
+                <conversion-rule class="shell">
+                    qint64 %out = %in;
+                    <insert-template name="core.iodevice_cleanup_to_java">
+                        <replace from="%len" to="(int) %in"/>
+                    </insert-template>
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+    </object-type>
+
+    <value-type name="QLineF">
+        <inject-code>
+            <import-file name="typesystem_core-java.java" quote-after-line="class QLineF___" quote-before-line="}// class"/>
+        </inject-code>
+        <modify-function signature="intersect(QLineF,QPointF*)const  ">
+            <access modifier="private"/>
+        </modify-function>
+
+    </value-type>
+    
+    <object-type name="QCryptographicHash">
+        <inject-code>
+            <import-file name="typesystem_core-java.java" quote-after-line="class QCryptographicHash___" quote-before-line="}// class"/>
+        </inject-code>
+        <modify-function signature="addData(const char*,int)">
+            <access modifier="private"/>
+        </modify-function>
+
+    </object-type>
+
+
+    <object-type name="QTextCodec">
+        <inject-code>
+            <import-file name="typesystem_core-java.java" quote-after-line="class QTextCodec___" quote-before-line="}// class"/>
+        </inject-code>
+
+        <modify-function signature="convertFromUnicode(const QChar*,int,QTextCodec::ConverterState*)const">
+            <modify-argument index="3" invalidate-after-use="yes" />
+            <modify-argument index="1">
+                <replace-type modified-type="string"/>
+                <conversion-rule class="shell">
+                    // Convert directly QChar * -&gt; ushort *
+                    <insert-template name="core.convert_primitive_array_to_java">
+                        <replace from="%JNITYPE" to="jchar"/>
+                        <replace from="%JAVATYPE" to="Char"/>
+                        <replace from="%len" to="%2"/>
+                    </insert-template>
+                </conversion-rule>
+                <conversion-rule class="native">
+                    // Convert directly ushort * -&gt; QChar *
+                    <insert-template name="core.convert_primitive_array_from_java">
+                        <replace from="%CTYPE" to="ushort"/>
+                        <replace from="%JAVATYPE" to="Char"/>
+                        <replace from="%JNITYPE" to="jchar"/>
+                    </insert-template>
+                </conversion-rule>
+            </modify-argument>
+
+            <modify-argument index="0">
+                <conversion-rule class="native">
+                    jobject %out = qtjambi_from_object(__jni_env, &amp;%in, "QByteArray", "com/trolltech/qt/core/", true);
+                    <insert-template name="core.cleanup_convert_primitive_array_from_java">
+                        <replace from="%JNITYPE" to="jchar"/>
+                        <replace from="%JAVATYPE" to="Char"/>
+                    </insert-template>
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="convertToUnicode(const char*,int,QTextCodec::ConverterState*)const">
+            <modify-argument index="3" invalidate-after-use="yes" />
+            <modify-argument index="1">
+                <replace-type modified-type="byte[]"/>
+                <conversion-rule class="shell">
+                    <insert-template name="core.convert_primitive_array_to_java">
+                        <replace from="%JNITYPE" to="jbyte"/>
+                        <replace from="%JAVATYPE" to="Byte"/>
+                        <replace from="%len" to="%2"/>
+                    </insert-template>
+                </conversion-rule>
+                <conversion-rule class="native">
+                    <insert-template name="core.convert_primitive_array_from_java">
+                        <replace from="%CTYPE" to="char"/>
+                        <replace from="%JAVATYPE" to="Byte"/>
+                        <replace from="%JNITYPE" to="jbyte"/>
+                    </insert-template>
+                </conversion-rule>
+            </modify-argument>
+
+            <modify-argument index="0">
+                <conversion-rule class="native">
+                    jstring %out = qtjambi_from_qstring(__jni_env, %in);
+                    <insert-template name="core.cleanup_convert_primitive_array_from_java">
+                        <replace from="%JNITYPE" to="jbyte"/>
+                        <replace from="%JAVATYPE" to="Byte"/>
+                    </insert-template>
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="codecForName(const char*)  ">
+            <access modifier="private"/>
+        </modify-function>
+
+    </object-type>
+
+    <object-type name="QTranslator">
+        <extra-includes>
+            <include file-name="QTextCodec" location="global"/>
+         </extra-includes>
+        <modify-function signature="load(const unsigned char*,int)">
+            <access modifier="private"/>
+        </modify-function>
+        <inject-code>
+            <import-file name="typesystem_core-java.java" quote-after-line="class QTranslator___" quote-before-line="}// class"/>
+        </inject-code>
+
+        <modify-function signature="translate(const char*,const char*,const char*)const">
+            <modify-argument index="1">
+                <replace-type modified-type="string"/>
+                <conversion-rule class="shell">
+        QTextCodec *codec = QTextCodec::codecForName("UTF-8");
+        QByteArray b1;
+        if (%in != 0)
+            b1 = codec->fromUnicode(%in);
+
+        jobject %out = qtjambi_from_qstring(__jni_env, QString(b1));
+                </conversion-rule>
+
+                <conversion-rule class="native">
+        const char* %out = %in;
+                </conversion-rule>
+            </modify-argument>
+            <modify-argument index="2">
+                <replace-type modified-type="string"/>
+                <conversion-rule class="shell">
+        QByteArray b2;
+        if (%in != 0)
+            b2 = codec->fromUnicode(%in);
+
+        jobject %out = qtjambi_from_qstring(__jni_env, QString(b2));
+                </conversion-rule>
+                <conversion-rule class="native">
+        const char* %out = %in;
+                </conversion-rule>
+
+            </modify-argument>
+            <modify-argument index="3">
+                <replace-type modified-type="string"/>
+                <conversion-rule class="shell">
+        QByteArray b3;
+        if (%in != 0)
+            b3 = codec->fromUnicode(%in);
+
+        jobject %out = qtjambi_from_qstring(__jni_env, QString(b3));
+                </conversion-rule>
+                <conversion-rule class="native">
+        const char* %out = %in;
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+    </object-type>
+
+    <object-type name="QWaitCondition">
+        <modify-function signature="wait(QMutex *, unsigned long)">
+            <modify-argument index="2">
+                <replace-default-expression with="0xffffffff"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="wait(QReadWriteLock *, unsigned long)">
+            <modify-argument index="2">
+                <replace-default-expression with="0xffffffff"/>
+            </modify-argument>
+        </modify-function>
+    </object-type>
+
+
+    <object-type name="QBuffer">
+        <inject-code>
+            <import-file name="typesystem_core-java.java" quote-after-line="class QBuffer___" quote-before-line="}// class"/>
+        </inject-code>
+        <extra-includes>
+            <include file-name="qt.QNativePointer" location="java"/>
+        </extra-includes>
+
+
+        <modify-function signature="QBuffer(QByteArray*,QObject*)">
+            <access modifier="private"/>
+            <modify-argument index="2">
+                <remove-default-expression />
+            </modify-argument>
+        </modify-function>
+
+
+        <modify-function signature="setBuffer(QByteArray*)">
+            <access modifier="private"/>
+        </modify-function>
+
+
+        <modify-function signature="setData(const char*,int)">
+            <access modifier="private"/>
+        </modify-function>
+
+    </object-type>
+
+    <object-type name="QTimer">
+        <inject-code class="java">
+            <import-file name="typesystem_core-java.java" quote-after-line="class QTimer___" quote-before-line="}// class"/>
+        </inject-code>
+    </object-type>
+
+    <object-type name="QProcess">
+        <modify-function signature="finished(int, QProcess::ExitStatus)">
+            <rename to="finishedWithStatusCode"/>
+        </modify-function>
+        <modify-function signature="setStandardOutputProcess(QProcess*)">
+            <modify-argument index="1">
+                <reference-count action="set" variable-name="__rcStandardOutputProcess"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="startDetached(QString,QStringList&lt;QString&gt;,QString,long long*)">
+            <access modifier="private"/>
+            <modify-argument index="4">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+        <inject-code>
+             <import-file name="typesystem_core-java.java" quote-after-line="class QProcess___" quote-before-line="}// class"/>
+        </inject-code>
+  </object-type>
+
+
+    <object-type name="QSignalMapper">
+        <inject-code>
+            <import-file name="typesystem_core-java.java" quote-after-line="class QSignalMapper___" quote-before-line="}// class"/>
+        </inject-code>
+
+
+      <modify-function signature="removeMappings(QObject*)">
+          <modify-argument index="1">
+              <reference-count action="remove" variable-name="__rcMappings"/>
+          </modify-argument>
+          <inject-code class="java" position="end">
+              <argument-map index="1" meta-name="%1"/>
+            if (__rcObjectForObject.containsKey(%1)) __rcObjectForObject.remove(%1);
+            if (__rcWidgetForObject.containsKey(%1)) __rcWidgetForObject.remove(%1);
+          </inject-code>
+      </modify-function>
+
+      <modify-function signature="setMapping(QObject*,QObject*)">
+          <modify-argument index="1">
+              <reference-count action="add" variable-name="__rcMappings"/>
+          </modify-argument>
+          <inject-code class="java" position="end">
+              <argument-map index="1" meta-name="%1"/>
+              <argument-map index="2" meta-name="%2"/>
+              if (%2 == null)
+                __rcObjectForObject.remove(%1);
+              else
+                __rcObjectForObject.put(%1,%2);
+          </inject-code>
+      </modify-function>
+
+      <modify-function signature="setMapping(QObject*,QString)">
+          <modify-argument index="1">
+              <reference-count action="add" variable-name="__rcMappings"/>
+          </modify-argument>
+      </modify-function>
+
+      <modify-function signature="setMapping(QObject*,int)">
+          <modify-argument index="1">
+              <reference-count action="add" variable-name="__rcMappings"/>
+          </modify-argument>
+      </modify-function>
+  </object-type>
+
+  <object-type name="QObject">
+      <inject-code class="java">
+          <import-file name="typesystem_core-java.java" quote-after-line="class QObject___" quote-before-line="}// class"/>
+      </inject-code>
+  </object-type>
+
+  <object-type name="QCoreApplication">
+      <modify-function signature="QCoreApplication(int &amp;, char  **)">
+          <inject-code class="shell">
+              // qtjambi_register_variant_handler();
+          </inject-code>
+      </modify-function>
+      <modify-function signature="translate(const char*,const char*,const char*,QCoreApplication::Encoding)">
+          <access modifier="private"/>
+          <modify-argument index="3">
+              <remove-default-expression/>
+          </modify-argument>
+          <modify-argument index="4">
+              <remove-default-expression/>
+          </modify-argument>
+      </modify-function>
+      <inject-code>
+          <import-file name="typesystem_core-java.java" quote-after-line="class QCoreApplication___" quote-before-line="}// class"/>
+      </inject-code>
+
+      <modify-function signature="translate(const char*,const char*,const char*,QCoreApplication::Encoding,int)">
+          <access modifier="private"/>
+      </modify-function>
+  </object-type>
+
+  <object-type name="QDataStream">
+      <extra-includes>
+          <include file-name="qt.QNativePointer" location="java"/>
+      </extra-includes>
+      <template name="core.datastream_operator_shift_right">
+          <insert-template name="core.stream_operator_shift_right">
+              <replace from="%STREAM_TYPE" to="QDataStream"/>
+          </insert-template>
+      </template>
+
+      <template name="core.datastream_operator_shift_right_primitive">
+          <insert-template name="core.datastream_operator_shift_right">
+              <replace from="%VALUE_FUNCTION" to="%TYPEValue"/>
+          </insert-template>
+      </template>
+
+      <modify-function signature="operator&lt;&lt;(bool)">
+          <rename to="writeBoolean"/>
+          <modify-argument index="0" replace-value="this"/>
+      </modify-function>
+      <modify-function signature="operator&lt;&lt;(signed char)">
+          <rename to="writeByte"/>
+          <modify-argument index="0" replace-value="this"/>
+      </modify-function>
+      <modify-function signature="operator&lt;&lt;(int)">
+          <rename to="writeInt"/>
+          <modify-argument index="0" replace-value="this"/>
+      </modify-function>
+      <modify-function signature="operator&lt;&lt;(long long)">
+          <rename to="writeLong"/>
+          <modify-argument index="0" replace-value="this"/>
+      </modify-function>
+      <modify-function signature="operator&lt;&lt;(float)">
+          <rename to="writeFloat"/>
+          <modify-argument index="0" replace-value="this"/>
+      </modify-function>
+      <modify-function signature="operator&lt;&lt;(double)">
+          <rename to="writeDouble"/>
+          <modify-argument index="0" replace-value="this"/>
+      </modify-function>
+      <modify-function signature="operator&lt;&lt;(short)">
+          <rename to="writeShort_char"/>
+          <access modifier="private"/>
+          <modify-argument index="0" replace-value="this"/>
+      </modify-function>
+
+      <modify-function signature="operator&gt;&gt;(int&amp;)">
+          <rename to="operator_shift_right_int"/>
+          <modify-argument index="0" replace-value="this"/>
+          <access modifier="private"/>
+      </modify-function>
+
+      <modify-function signature="operator&gt;&gt;(bool&amp;)">
+          <rename to="operator_shift_right_boolean"/>
+          <modify-argument index="0" replace-value="this"/>
+          <access modifier="private"/>
+      </modify-function>
+
+      <modify-function signature="operator&gt;&gt;(short&amp;)">
+          <rename to="operator_shift_right_short"/>
+          <modify-argument index="0" replace-value="this"/>
+          <access modifier="private"/>
+      </modify-function>
+
+      <modify-function signature="operator&gt;&gt;(long long&amp;)">
+          <rename to="operator_shift_right_long"/>
+          <modify-argument index="0" replace-value="this"/>
+          <access modifier="private"/>
+      </modify-function>
+
+      <modify-function signature="operator&gt;&gt;(signed char&amp;)">
+          <rename to="operator_shift_right_byte"/>
+          <modify-argument index="0" replace-value="this"/>
+          <access modifier="private"/>
+      </modify-function>
+
+      <modify-function signature="operator&gt;&gt;(unsigned short&amp;)">
+          <rename to="operator_shift_right_char"/>
+          <modify-argument index="0" replace-value="this"/>
+          <access modifier="private"/>
+      </modify-function>
+
+      <modify-function signature="operator&gt;&gt;(float&amp;)">
+          <rename to="operator_shift_right_float"/>
+          <modify-argument index="0" replace-value="this"/>
+          <access modifier="private"/>
+      </modify-function>
+
+      <modify-function signature="operator&gt;&gt;(double&amp;)">
+          <rename to="operator_shift_right_double"/>
+          <modify-argument index="0" replace-value="this"/>
+          <access modifier="private"/>
+      </modify-function>
+
+      <inject-code>
+          <import-file name="typesystem_core-java.java" quote-after-line="class QDataStream___" quote-before-line="}// class"/>
+      </inject-code>
+
+      <inject-code class="native">
+        extern "C" JNIEXPORT jstring JNICALL QTJAMBI_FUNCTION_PREFIX(Java_com_trolltech_qt_core_QDataStream_readString_1private)
+        (JNIEnv *env, jobject, jlong stream)
+        {
+            QTJAMBI_DEBUG_TRACE("(native) entering: QDataStream::%FUNCTION_NAME%_native");
+            QDataStream *qtStream = (QDataStream *) qtjambi_from_jlong(stream);
+
+            jstring returned = 0;
+            if (qtStream != 0) {
+                QString qtString;
+                operator&gt;&gt;(*qtStream, qtString);
+
+                returned = qtjambi_from_qstring(env, qtString);
+            }
+
+            return returned;
+        }
+
+        extern "C" JNIEXPORT void JNICALL QTJAMBI_FUNCTION_PREFIX(Java_com_trolltech_qt_core_QDataStream_writeString_1private)
+        (JNIEnv *env, jobject, jlong stream, jstring string)
+        {
+            QTJAMBI_DEBUG_TRACE("(native) entering: QDataStream::%FUNCTION_NAME%_native");
+            QDataStream *qtStream = (QDataStream *) qtjambi_from_jlong(stream);
+
+            if (qtStream != 0) {
+                QString qtString = qtjambi_to_qstring(env, string);
+                operator&lt;&lt;(*qtStream, qtString);
+            }
+        }
+
+      </inject-code>
+
+      <template name="core.stream_constructor_bytearray">
+        // Hold reference to byte array which goes away when the stream dies
+        private QByteArray byteArray = null;
+        public %CLASSNAME(QByteArray a, QIODevice.OpenMode mode) {
+            this(a.nativePointer(), mode);
+            byteArray = a;
+        }
+
+        public %CLASSNAME(QByteArray a, QIODevice.OpenModeFlag ... mode) {
+            this(a.nativePointer(), mode);
+            byteArray = a;
+        }
+      </template>
+
+      <modify-function signature="QDataStream(QByteArray*,QFlags&lt;QIODevice::OpenModeFlag&gt;)">
+          <access modifier="private"/>
+      </modify-function>
+      <inject-code>
+          <insert-template name="core.stream_constructor_bytearray">
+              <replace from="%CLASSNAME" to="QDataStream"/>
+          </insert-template>
+      </inject-code>
+
+      <template name="core.qdatastream_readorwrite_bytes">
+        extern "C" JNIEXPORT jint JNICALL QTJAMBI_FUNCTION_PREFIX(Java_com_trolltech_qt_core_QDataStream_%FUNCTION_NAME%)
+        (JNIEnv *env, jobject, jlong stream, jbyteArray array, jint length)
+        {
+            QTJAMBI_DEBUG_TRACE("(native) entering: QDataStream::%FUNCTION_NAME%");
+            char *rawBuffer = (char *) env-&gt;GetByteArrayElements(array, 0);
+
+            QDataStream *qtStream = (QDataStream *) qtjambi_from_jlong(stream);
+            int count = qtStream-&gt;%QT_FUNCTION_NAME%(rawBuffer, length);
+
+            env-&gt;ReleaseByteArrayElements(array, (jbyte *) rawBuffer, 0);
+            QTJAMBI_DEBUG_TRACE("(native) -&gt; leaving: QDataStream::%FUNCTION_NAME%");
+            return qMin(count, (int) length);
+        }
+      </template>
+
+      <inject-code class="native">
+          <insert-template name="core.qdatastream_readorwrite_bytes">
+              <replace from="%FUNCTION_NAME%" to="readBytes"/>
+              <replace from="%QT_FUNCTION_NAME%" to="readRawData"/>
+          </insert-template>
+          <insert-template name="core.qdatastream_readorwrite_bytes">
+              <replace from="%FUNCTION_NAME%" to="writeBytes"/>
+              <replace from="%QT_FUNCTION_NAME%" to="writeRawData"/>
+          </insert-template>
+      </inject-code>
+  </object-type>
+
+  <object-type name="QAbstractFileEngine::UnMapExtensionOption">
+    <modify-field name="address">
+        <access modifier="private" />
+        <rename to="address_private" />
+    </modify-field>
+    <inject-code>
+        <import-file name="typesystem_core-java.java" quote-after-line="class QAbstractFileEngine_UnMapExtensionOption___" quote-before-line="}// class"/>
+    </inject-code>
+  </object-type>
+
+  <object-type name="QAbstractFileEngine::MapExtensionReturn">
+    <modify-field name="address">
+        <access modifier="private" />
+        <rename to="address_private" />
+    </modify-field>
+    <inject-code>
+        <import-file name="typesystem_core-java.java" quote-after-line="class QAbstractFileEngine_MapExtensionReturn___" quote-before-line="}// class"/>
+    </inject-code>
+  </object-type>
+
+  <object-type name="QAbstractFileEngine">
+    <inject-code>
+        <import-file name="typesystem_core-java.java" quote-after-line="class QAbstractFileEngine___" quote-before-line="}// class"/>
+    </inject-code>
+  </object-type>
+
+  <object-type name="QTextStream">
+      <extra-includes>
+          <include file-name="qt.QNativePointer" location="java"/>
+      </extra-includes>
+
+      <template name="core.textstream_operator_shift_right">
+          <insert-template name="core.stream_operator_shift_right">
+              <replace from="%STREAM_TYPE" to="QTextStream"/>
+          </insert-template>
+      </template>
+
+      <template name="core.textstream_operator_shift_right_primitive">
+          <insert-template name="core.textstream_operator_shift_right">
+              <replace from="%VALUE_FUNCTION" to="%TYPEValue"/>
+          </insert-template>
+      </template>
+
+      <modify-function signature="operator&lt;&lt;(QBool)">
+          <rename to="writeBoolean"/>
+          <modify-argument index="0" replace-value="this"/>
+      </modify-function>
+      <modify-function signature="operator&lt;&lt;(char)">
+          <modify-argument index="0" replace-value="this"/>
+          <rename to="writeByte"/>
+      </modify-function>
+      <modify-function signature="operator&lt;&lt;(signed int)">
+          <rename to="writeInt"/>
+          <modify-argument index="0" replace-value="this"/>
+      </modify-function>
+      <modify-function signature="operator&lt;&lt;(long long)">
+          <rename to="writeLong"/>
+          <modify-argument index="0" replace-value="this"/>
+      </modify-function>
+      <modify-function signature="operator&lt;&lt;(float)">
+          <rename to="writeFloat"/>
+          <modify-argument index="0" replace-value="this"/>
+      </modify-function>
+      <modify-function signature="operator&lt;&lt;(double)">
+          <rename to="writeDouble"/>
+          <modify-argument index="0" replace-value="this"/>
+      </modify-function>
+      <modify-function signature="operator&lt;&lt;(signed short)">
+          <rename to="writeShort_char"/>
+          <modify-argument index="0" replace-value="this"/>
+          <access modifier="private"/>
+      </modify-function>
+
+      <modify-function signature="operator&gt;&gt;(char&amp;)">
+          <access modifier="private"/>
+          <modify-argument index="0" replace-value="this"/>
+          <rename to="operator_shift_right_byte"/>
+      </modify-function>
+      <modify-function signature="operator&gt;&gt;(signed short&amp;)">
+          <access modifier="private"/>
+          <modify-argument index="0" replace-value="this"/>
+          <rename to="operator_shift_right_short"/>
+      </modify-function>
+      <modify-function signature="operator&gt;&gt;(signed int&amp;)">
+          <access modifier="private"/>
+          <modify-argument index="0" replace-value="this"/>
+          <rename to="operator_shift_right_int"/>
+      </modify-function>
+      <modify-function signature="operator&gt;&gt;(long long&amp;)">
+          <access modifier="private"/>
+          <modify-argument index="0" replace-value="this"/>
+          <rename to="operator_shift_right_long"/>
+      </modify-function>
+      <modify-function signature="operator&gt;&gt;(float&amp;)">
+          <access modifier="private"/>
+          <modify-argument index="0" replace-value="this"/>
+          <rename to="operator_shift_right_float"/>
+      </modify-function>
+      <modify-function signature="operator&gt;&gt;(double&amp;)">
+          <access modifier="private"/>
+          <modify-argument index="0" replace-value="this"/>
+          <rename to="operator_shift_right_double"/>
+      </modify-function>
+
+      <modify-function signature="setCodec(const char*)">
+          <access modifier="private"/>
+      </modify-function>
+      <inject-code>
+          <import-file name="typesystem_core-java.java" quote-after-line="class QTextStream___" quote-before-line="}// class"/>
+      </inject-code>
+
+      <inject-code class="native">
+        extern "C" JNIEXPORT jstring JNICALL QTJAMBI_FUNCTION_PREFIX(Java_com_trolltech_qt_core_QTextStream_readString_1native)
+        (JNIEnv *env, jobject, jlong id)
+        {
+            QTJAMBI_DEBUG_TRACE("(native) entering: QTextStream::readString()");
+            QTextStream *stream = (QTextStream *) qtjambi_from_jlong(id);
+            QString str;
+            (*stream) &gt;&gt; str;
+            jstring s = qtjambi_from_qstring(env, str);
+            QTJAMBI_DEBUG_TRACE("(native) -&gt; leaving: QTextStream::readString()");
+            return s;
+        }
+
+        extern "C" JNIEXPORT void JNICALL QTJAMBI_FUNCTION_PREFIX(Java_com_trolltech_qt_core_QTextStream_writeString_1native)
+        (JNIEnv *env, jobject, jlong id, jstring str)
+        {
+            QTJAMBI_DEBUG_TRACE("(native) entering: QTextStream::writeString()");
+            QString qstr = qtjambi_to_qstring(env, str);
+            QTextStream *stream = (QTextStream *) qtjambi_from_jlong(id);
+            (*stream) &lt;&lt; qstr;
+            QTJAMBI_DEBUG_TRACE("(native) -&gt; leaving: QTextStream::readString()");
+        }
+      </inject-code>
+  </object-type>
+  <value-type name="QBitArray">
+      <inject-code>
+          <import-file name="typesystem_core-java.java" quote-after-line="class QBitArray___" quote-before-line="}// class"/>
+      </inject-code>
+  </value-type>
+
+  <template name="convert_qtjambifuture_to_native">
+    QtJambiFuture %out = %in != 0 ? (const QtJambiFuture&amp; ) *(QtJambiFuture *)qtjambi_from_jlong(%in) : QtJambiFuture();
+  </template>
+  <template name="convert_futurevoid_to_native">
+    QtJambiVoidFuture %out = %in != 0 ? (const QtJambiVoidFuture&amp; ) *(QtJambiVoidFuture *)qtjambi_from_jlong(%in) : QtJambiVoidFuture();
+  </template>
+
+  <value-type name="QFuture">
+    <modify-function signature="operator==(const QFuture &amp;)const">
+        <modify-argument index="1">
+            <replace-type modified-type="qt.core.QFuture" />
+            <conversion-rule class="native">
+                <insert-template name="convert_qtjambifuture_to_native" />
+            </conversion-rule>
+        </modify-argument>
+    </modify-function>
+  </value-type>
+
+  <value-type name="QtJambiFuture">
+    <modify-function signature="QFuture(const QFuture &amp;)">
+        <modify-argument index="1">
+            <replace-type modified-type="qt.core.QFuture&lt;T&gt;" />
+            <conversion-rule class="native">
+                <insert-template name="convert_qtjambifuture_to_native" />
+            </conversion-rule>
+        </modify-argument>
+    </modify-function>
+  </value-type>
+
+  <value-type name="QtJambiVoidFuture">
+    <modify-function signature="QFuture(const QFuture &amp;)">
+        <modify-argument index="1">
+            <replace-type modified-type="qt.core.QFutureVoid" />
+            <conversion-rule class="native">
+                <insert-template name="convert_futurevoid_to_native" />
+            </conversion-rule>
+        </modify-argument>
+    </modify-function>
+  </value-type>
+
+  <object-type name="QFutureWatcherBase">
+    <inject-code class="shell-declaration">
+
+        // private, pure virtual and considered internal
+        // we need to reimplement them so it will compile
+        QFutureInterfaceBase dummyBase;
+        virtual const QFutureInterfaceBase &amp;futureInterface() const { return dummyBase; }
+        virtual QFutureInterfaceBase &amp;futureInterface() { return dummyBase; }
+    </inject-code>
+  </object-type>
+
+  <object-type name="QFutureWatcher">
+    <modify-function signature="setFuture(const QFuture &amp;)">
+        <modify-argument index="1">
+            <replace-type modified-type="qt.core.QFuture&lt;T&gt;" />
+            <conversion-rule class="native">
+                <insert-template name="convert_qtjambifuture_to_native" />
+            </conversion-rule>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+
+  <template name="future_function_in_futurewatcher">
+        extern "C" JNIEXPORT jobject JNICALL QTJAMBI_FUNCTION_PREFIX(Java_com_trolltech_qt_core_QFutureWatcher__1_1qt_1future__J)
+        (JNIEnv *__jni_env,
+         jobject,
+         jlong __this_nativeId)
+        {
+            QTJAMBI_DEBUG_TRACE("(native) entering: QFutureWatcher::future() const");
+            Q_UNUSED(__jni_env)
+            Q_UNUSED(__this_nativeId)
+            QtJambiShell_QFutureWatcher *__qt_this = (QtJambiShell_QFutureWatcher *) qtjambi_from_jlong(__this_nativeId);
+            QTJAMBI_EXCEPTION_CHECK(__jni_env);
+            Q_ASSERT(__qt_this);
+            QtJambiFuture  __qt_return_value = __qt_this->future();
+
+            jobject __java_return_value = qtjambi_from_object(__jni_env, &amp;__qt_return_value, "QFuture", "com/trolltech/qt/core/", true);
+
+            QTJAMBI_DEBUG_TRACE("(native) -> leaving: QFutureWatcher::future() const");
+            return __java_return_value;
+        }
+  </template>
+  <template name="futures_function_in_futuresynchronizer">
+        extern "C" JNIEXPORT jobject JNICALL QTJAMBI_FUNCTION_PREFIX(Java_com_trolltech_qt_core_QFutureSynchronizer__1_1qt_1futures__J)
+        (JNIEnv *__jni_env,
+        jobject,
+        jlong __this_nativeId)
+        {
+            QTJAMBI_DEBUG_TRACE("(native) entering: QFutureSynchronizer::futures() const");
+            Q_UNUSED(__jni_env)
+            Q_UNUSED(__this_nativeId)
+            QtJambiFutureSynchronizer *__qt_this = (QtJambiFutureSynchronizer *) qtjambi_from_jlong(__this_nativeId);
+            QTJAMBI_EXCEPTION_CHECK(__jni_env);
+            Q_ASSERT(__qt_this);
+            QList&lt;QtJambiFuture&gt;  __qt_return_value = __qt_this-&gt;futures();
+
+
+            jobject __java_return_value = qtjambi_arraylist_new(__jni_env, __qt_return_value.size());
+            QList&lt;QtJambiFuture&gt; ::const_iterator __qt_return_value_end_it = __qt_return_value.constEnd();
+            for (QList&lt;QtJambiFuture&gt; ::const_iterator __qt_return_value_it = __qt_return_value.constBegin(); __qt_return_value_it != __qt_return_value_end_it; ++__qt_return_value_it) {
+                QtJambiFuture  __qt_tmp = *__qt_return_value_it;
+                jobject __java_tmp = qtjambi_from_object(__jni_env, &amp;__qt_tmp, "QFuture", "com/trolltech/qt/core/", true);
+                QTJAMBI_EXCEPTION_CHECK(__jni_env);
+                qtjambi_collection_add(__jni_env, __java_return_value, __java_tmp);
+            }
+            QTJAMBI_EXCEPTION_CHECK(__jni_env);
+            QTJAMBI_EXCEPTION_CHECK(__jni_env);
+            QTJAMBI_DEBUG_TRACE("(native) -&gt; leaving: QFutureSynchronizer::futures() const");
+            return __java_return_value;
+        }
+  </template>
+
+  <object-type name="QtJambiFutureWatcher">
+    <inject-code>
+        <import-file name="typesystem_core-java.java" quote-after-line="class QFutureWatcher___" quote-before-line="}// class"/>
+    </inject-code>
+    <inject-code class="native">
+        <insert-template name="future_function_in_futurewatcher" />
+    </inject-code>
+  </object-type>
+
+  <object-type name="QtJambiVoidFutureWatcher">
+    <modify-function signature="setFuture(const QFuture &amp;)">
+        <modify-argument index="1">
+            <replace-type modified-type="qt.core.QFutureVoid" />
+            <conversion-rule class="native">
+                <insert-template name="convert_futurevoid_to_native" />
+            </conversion-rule>
+        </modify-argument>
+    </modify-function>
+    <inject-code>
+        <import-file name="typesystem_core-java.java" quote-after-line="class QFutureWatcherVoid___" quote-before-line="}// class"/>
+    </inject-code>
+    <inject-code class="native">
+        <insert-template name="future_function_in_futurewatcher">
+            <replace from="QFutureWatcher" to="QFutureWatcherVoid" />
+            <replace from="QtJambiFuture" to="QtJambiVoidFuture" />
+            <replace from="&quot;QFuture&quot;" to="&quot;QFutureVoid&quot;" />
+        </insert-template>
+    </inject-code>
+  </object-type>
+
+  <object-type name="QtJambiFutureSynchronizer">
+      <modify-function signature="QFutureSynchronizer(const QFuture &amp;)">
+        <modify-argument index="1">
+            <replace-type modified-type="qt.core.QFuture&lt;T&gt;" />
+            <conversion-rule class="native">
+                <insert-template name="convert_qtjambifuture_to_native" />
+            </conversion-rule>
+        </modify-argument>
+      </modify-function>
+      <modify-function signature="addFuture(const QFuture &amp;)">
+        <modify-argument index="1">
+            <replace-type modified-type="qt.core.QFuture&lt;T&gt;" />
+            <conversion-rule class="native">
+                <insert-template name="convert_qtjambifuture_to_native" />
+            </conversion-rule>
+        </modify-argument>
+      </modify-function>
+      <modify-function signature="setFuture(const QFuture &amp;)">
+        <modify-argument index="1">
+            <replace-type modified-type="qt.core.QFuture&lt;T&gt;" />
+            <conversion-rule class="native">
+                <insert-template name="convert_qtjambifuture_to_native" />
+            </conversion-rule>
+        </modify-argument>
+      </modify-function>
+      <modify-function signature="futures()const" remove="all" />
+      <inject-code class="native">
+        <insert-template name="futures_function_in_futuresynchronizer" />
+      </inject-code>
+      <inject-code class="java">
+        <import-file name="typesystem_core-java.java" quote-after-line="class QFutureSynchronizer___" quote-before-line="}// class"/>
+      </inject-code>
+  </object-type>
+  <object-type name="QtJambiVoidFutureSynchronizer">
+      <modify-function signature="QFutureSynchronizer(const QFuture &amp;)">
+        <modify-argument index="1">
+            <replace-type modified-type="qt.core.QFutureVoid" />
+            <conversion-rule class="native">
+                <insert-template name="convert_futurevoid_to_native" />
+            </conversion-rule>
+        </modify-argument>
+      </modify-function>
+      <modify-function signature="addFuture(const QFuture &amp;)">
+        <modify-argument index="1">
+            <replace-type modified-type="qt.core.QFutureVoid" />
+            <conversion-rule class="native">
+                <insert-template name="convert_futurevoid_to_native" />
+            </conversion-rule>
+        </modify-argument>
+      </modify-function>
+      <modify-function signature="setFuture(const QFuture &amp;)">
+        <modify-argument index="1">
+            <replace-type modified-type="qt.core.QFutureVoid" />
+            <conversion-rule class="native">
+                <insert-template name="convert_futurevoid_to_native" />
+            </conversion-rule>
+        </modify-argument>
+      </modify-function>
+      <modify-function signature="futures()const" remove="all" />
+      <inject-code class="native">
+        <insert-template name="futures_function_in_futuresynchronizer">
+            <replace from="QFutureSynchronizer" to="QFutureSynchronizerVoid" />
+            <replace from="QtJambiFutureSynchronizer" to="QtJambiVoidFutureSynchronizer" />
+            <replace from="QtJambiFuture" to="QtJambiVoidFuture" />
+            <replace from="&quot;QFuture&quot;" to="&quot;QFutureVoid&quot;" />
+        </insert-template>
+      </inject-code>
+      <inject-code class="java">
+        <import-file name="typesystem_core-java.java" quote-after-line="class QFutureSynchronizerVoid___" quote-before-line="}// class"/>
+      </inject-code>
+  </object-type>
+
+  <object-type name="QtJambiFutureIterator">
+    <modify-function signature="QFutureIterator(const QFuture &amp;)">
+        <modify-argument index="1">
+            <replace-type modified-type="qt.core.QFuture&lt;T&gt;" />
+            <conversion-rule class="native">
+                <insert-template name="convert_qtjambifuture_to_native" />
+            </conversion-rule>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+
+  <namespace-type name="QtConcurrent">
+    <inject-code class="java">
+        <import-file name="typesystem_core-java.java" quote-after-line="class QtConcurrent___" quote-before-line="}// class"/>
+    </inject-code>
+  </namespace-type>
+
+</typesystem>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/typesystem_core.xml	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,3147 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<typesystem package="qt.core" default-superclass="QtDObject">
+<inject-code>
+    qt.Utilities.loadQtLibrary("QtCore");
+    </inject-code>
+<template name="core.return_string_instead_of_char*">
+        public final String %FUNCTION_NAME() {
+            QNativePointer np = %FUNCTION_NAME_private();
+            String returned = "";
+            int i=0;
+            while (np.byteAt(i) != 0) returned += (char) np.byteAt(i++);
+            return returned;
+        }
+    </template>
+<template name="core.call_with_string_instead_of_char*">
+        public final void %FUNCTION_NAME(String %ARG_NAME) {
+            %FUNCTION_NAME(QNativePointer.createCharPointer(%ARG_NAME));
+        }
+    </template>
+<template name="core.private_function_return_self">
+      public final %RETURN_TYPE %FUNCTION_NAME(%ARGUMENTS) {
+        %FUNCTION_NAME_private(%ARGUMENT_NAMES);
+        return this;
+      }
+    </template>
+<template name="core.unary_other_type">
+        <insert-template name="core.private_function_return_self">
+            <replace from="%RETURN_TYPE" to="%OUT_TYPE"/>
+            <replace from="%ARGUMENTS" to="%IN_TYPE other"/>
+            <replace from="%ARGUMENT_NAMES" to="other"/>
+        </insert-template>
+    </template>
+<template name="core.unary_self_type">
+        <insert-template name="core.unary_other_type">
+            <replace from="%IN_TYPE" to="%TYPE"/>
+            <replace from="%OUT_TYPE" to="%TYPE"/>
+        </insert-template>
+    </template>
+<template name="core.operator_assign_self_type">
+        <insert-template name="core.unary_self_type">
+            <replace from="%FUNCTION_NAME" to="operator_assign"/>
+        </insert-template>
+    </template>
+<template name="core.operator_assign_other_type">
+        <insert-template name="core.unary_other_type">
+            <replace from="%FUNCTION_NAME" to="operator_assign"/>
+        </insert-template>
+    </template>
+<template name="core.call_through_with_byte[]_instead_of_char*_and_int">
+    public final int %FUNCTION_NAME(byte data[]) {
+        QNativePointer np = new QNativePointer(QNativePointer.Type.Byte, data.length);
+        %COPY_IN
+        int returned = (int) %FUNCTION_NAME(np, data.length);
+        %COPY_OUT
+        return returned;
+    }
+    </template>
+<template name="core.read_with_byte[]_instead_of_char*_and_int">
+        <insert-template name="core.call_through_with_byte[]_instead_of_char*_and_int">
+            <replace from="%COPY_IN" to=""/>
+            <replace from="%COPY_OUT" to="for (int i=0; i&lt;returned; ++i) data[i] = np.byteAt(i);"/>
+        </insert-template>
+    </template>
+<template name="core.write_with_byte[]_instead_of_char*_and_int">
+        <insert-template name="core.call_through_with_byte[]_instead_of_char*_and_int">
+            <replace from="%COPY_OUT" to=""/>
+            <replace from="%COPY_IN" to="for (int i=0; i&lt;data.length; ++i) np.setByteAt(i, data[i]);"/>
+        </insert-template>
+    </template>
+<template name="core.stream_operator_shift_right">
+        public final %STREAM_TYPE operator_shift_right(%TYPE array[]) {
+            QNativePointer np = new QNativePointer(QNativePointer.Type.%NATIVEPOINTER_TYPE);
+            for (int i=0; i&lt;array.length; ++i) {
+                operator_shift_right_%TYPE(np);
+                array[i] = np.%VALUE_FUNCTION();
+            }
+
+            return this;
+        }
+    </template>
+<template name="core.convert_primitive_array_to_java">
+        %JNITYPEArray %out = __jni_env-&gt;New%JAVATYPEArray((int) %len);
+        __jni_env-&gt;Set%JAVATYPEArrayRegion(%out, 0, (int) %len, (%JNITYPE *) %in);
+        %JNITYPE *__ptr = (%JNITYPE *) %in;
+        Q_UNUSED(__ptr);
+        %JNITYPEArray __array = %out;
+        Q_UNUSED(__array);
+    </template>
+<template name="core.cleanup_convert_primitive_array_to_java">
+        if (%len &gt; 0) __jni_env-&gt;Get%JAVATYPEArrayRegion(__array, 0, %len, __ptr);
+    </template>
+<template name="core.get_array_length">
+        int %out = __jni_env-&gt;GetArrayLength((jarray) %ARRAY);
+    </template>
+<template name="core.cleanup_convert_primitive_array_from_java">
+        __jni_env-&gt;Release%JAVATYPEArrayElements((%JNITYPEArray) %1, (%JNITYPE *) __ptr, 0);
+    </template>
+<template name="core.convert_primitive_array_from_java">
+        %CTYPE *%out = (%CTYPE *) __jni_env-&gt;Get%JAVATYPEArrayElements((%JNITYPEArray) %in, 0);
+        %CTYPE *__ptr = %out;
+    </template>
+
+<primitive-type name="bool" java-name="bool" jni-name="jboolean"/>
+<primitive-type name="double" jni-name="jdouble"/>
+<primitive-type name="float" jni-name="jfloat"/>
+
+    <primitive-type name="__int64" java-name="long" preferred-conversion="no" jni-name="jlong"/>
+    <primitive-type name="unsigned __int64" java-name="long" preferred-conversion="no" jni-name="jlong"/>
+    <primitive-type name="unsigned long long" java-name="ulong" preferred-conversion="no" jni-name="jlong"/>
+    <primitive-type name="long long" java-name="long" preferred-conversion="no" jni-name="jlong"/>
+    <primitive-type name="quintptr" preferred-conversion="no" java-name="ulong" jni-name="jlong" />
+
+    <primitive-type name="short" preferred-conversion="no" java-name="short" jni-name="jchar"/>
+    <primitive-type name="short" preferred-java-type="no" java-name="short" jni-name="jshort" />
+    <primitive-type name="signed short" java-name="short" preferred-conversion="no" jni-name="jchar"/>
+    <primitive-type name="unsigned short" java-name="ushort" preferred-conversion="no" jni-name="jchar"/>
+
+    <primitive-type name="char" java-name="char" jni-name="jbyte"/>
+    <primitive-type name="signed char" java-name="byte" preferred-conversion="no" jni-name="jbyte"/>
+    <primitive-type name="unsigned char" java-name="ubyte" preferred-conversion="no" jni-name="jbyte"/>
+
+    <primitive-type name="int" jni-name="jint"/>
+    <primitive-type name="signed int" java-name="int" preferred-conversion="no" jni-name="jint"/>
+    <primitive-type name="uint" java-name="uint" jni-name="jint"/>
+    <primitive-type name="ulong" java-name="ulong" preferred-conversion="no" jni-name="jint"/>
+    <primitive-type name="unsigned int" java-name="uint" preferred-conversion="no" jni-name="jint"/>
+    <primitive-type name="signed long" java-name="int" preferred-conversion="no" jni-name="jint"/>
+    <primitive-type name="long" java-name="int" preferred-conversion="no" jni-name="jint"/>
+    <primitive-type name="unsigned long" java-name="uint" preferred-conversion="no" jni-name="jint"/>
+
+    <primitive-type name="WId" java-name="long" preferred-conversion="no" jni-name="jlong"/>
+    <primitive-type name="Qt::HANDLE" java-name="long" preferred-conversion="no" jni-name="jlong"/>
+<!--    <primitive-type name="QVariant::Type" java-name="int" preferred-conversion="no" jni-name="jint"/> -->
+
+    <primitive-type name="QByteRef" java-name="byte" preferred-conversion="no" jni-name="jbyte"/>
+    <primitive-type name="QBitRef" java-name="bool" preferred-conversion="no" jni-name="jboolean"/>
+
+    <primitive-type name="QBool" java-name="bool" preferred-conversion="no" jni-name="bool"/>
+    <primitive-type name="QVariant" java-name="QVariant" jni-name="jVariant"/>
+
+<primitive-type name="jobject" java-name="java.lang.Object" jni-name="jobject"/>
+
+<template name="core.multiply-devide-add-subtract">
+    public final %TYPE multiply(double d) { operator_multiply_assign(d); return this; }
+    public final %TYPE divide(double d) { operator_divide_assign(d); return this; }
+    public final %TYPE add(%TYPE p) { operator_add_assign(p); return this; }
+    public final %TYPE subtract(%TYPE p) { operator_subtract_assign(p); return this; }
+    </template>
+<template name="convert_qtjambifuture_to_native">
+    QtJambiFuture %out = %in != 0 ? (const QtJambiFuture&amp; ) *(QtJambiFuture *)qtjambi_from_jlong(%in) : QtJambiFuture();
+  </template>
+<template name="convert_futurevoid_to_native">
+    QtJambiVoidFuture %out = %in != 0 ? (const QtJambiVoidFuture&amp; ) *(QtJambiVoidFuture *)qtjambi_from_jlong(%in) : QtJambiVoidFuture();
+  </template>
+<template name="future_function_in_futurewatcher">
+        extern "C" JNIEXPORT jobject JNICALL QTJAMBI_FUNCTION_PREFIX(Java_com_trolltech_qt_core_QFutureWatcher__1_1qt_1future__J)
+        (JNIEnv *__jni_env,
+         jobject,
+         jlong __this_nativeId)
+        {
+            QTJAMBI_DEBUG_TRACE("(native) entering: QFutureWatcher::future() const");
+            Q_UNUSED(__jni_env)
+            Q_UNUSED(__this_nativeId)
+            QtJambiShell_QFutureWatcher *__qt_this = (QtJambiShell_QFutureWatcher *) qtjambi_from_jlong(__this_nativeId);
+            QTJAMBI_EXCEPTION_CHECK(__jni_env);
+            Q_ASSERT(__qt_this);
+            QtJambiFuture  __qt_return_value = __qt_this-&gt;future();
+
+            jobject __java_return_value = qtjambi_from_object(__jni_env, &amp;__qt_return_value, "QFuture", "com/trolltech/qt/core/", true);
+
+            QTJAMBI_DEBUG_TRACE("(native) -&gt; leaving: QFutureWatcher::future() const");
+            return __java_return_value;
+        }
+  </template>
+<template name="futures_function_in_futuresynchronizer">
+        extern "C" JNIEXPORT jobject JNICALL QTJAMBI_FUNCTION_PREFIX(Java_com_trolltech_qt_core_QFutureSynchronizer__1_1qt_1futures__J)
+        (JNIEnv *__jni_env,
+        jobject,
+        jlong __this_nativeId)
+        {
+            QTJAMBI_DEBUG_TRACE("(native) entering: QFutureSynchronizer::futures() const");
+            Q_UNUSED(__jni_env)
+            Q_UNUSED(__this_nativeId)
+            QtJambiFutureSynchronizer *__qt_this = (QtJambiFutureSynchronizer *) qtjambi_from_jlong(__this_nativeId);
+            QTJAMBI_EXCEPTION_CHECK(__jni_env);
+            Q_ASSERT(__qt_this);
+            QList&lt;QtJambiFuture&gt;  __qt_return_value = __qt_this-&gt;futures();
+
+
+            jobject __java_return_value = qtjambi_arraylist_new(__jni_env, __qt_return_value.size());
+            QList&lt;QtJambiFuture&gt; ::const_iterator __qt_return_value_end_it = __qt_return_value.constEnd();
+            for (QList&lt;QtJambiFuture&gt; ::const_iterator __qt_return_value_it = __qt_return_value.constBegin(); __qt_return_value_it != __qt_return_value_end_it; ++__qt_return_value_it) {
+                QtJambiFuture  __qt_tmp = *__qt_return_value_it;
+                jobject __java_tmp = qtjambi_from_object(__jni_env, &amp;__qt_tmp, "QFuture", "com/trolltech/qt/core/", true);
+                QTJAMBI_EXCEPTION_CHECK(__jni_env);
+                qtjambi_collection_add(__jni_env, __java_return_value, __java_tmp);
+            }
+            QTJAMBI_EXCEPTION_CHECK(__jni_env);
+            QTJAMBI_EXCEPTION_CHECK(__jni_env);
+            QTJAMBI_DEBUG_TRACE("(native) -&gt; leaving: QFutureSynchronizer::futures() const");
+            return __java_return_value;
+        }
+  </template>
+
+  <rejection class="*" function-name="d_func"/>
+  <rejection class="*" function-name="data_ptr"/>
+  <rejection class="*" function-name="detach"/>
+  <rejection class="*" function-name="isDetached"/>
+
+  <rejection class="*" field-name="d_ptr"/>
+  <rejection class="*" field-name="d"/>
+
+  <rejection class="" enum-name="QtValidLicenseForTestModule"/>
+
+  <rejection class="" enum-name="QtValidLicenseForDBusModule"/>
+  <rejection class="" enum-name="QtValidLicenseForSqlModule"/>
+  <rejection class="" enum-name="QtValidLicenseForOpenGLModule"/>
+  <rejection class="" enum-name="enum_1"/>
+  <rejection class="" enum-name="QtValidLicenseForXmlModule"/>
+  <rejection class="" enum-name="QtValidLicenseForXmlPatternsModule"/>
+  <rejection class="" enum-name="QtValidLicenseForActiveQtModule"/>
+  <rejection class="" enum-name="QtValidLicenseForCoreModule"/>
+  <rejection class="" enum-name="QtValidLicenseForQt3SupportLightModule"/>
+  <rejection class="" enum-name="QtValidLicenseForQt3SupportModule"/>
+  <rejection class="" enum-name="QtValidLicenseForNetworkModule"/>
+  <rejection class="" enum-name="QtValidLicenseForSvgModule"/>
+  <rejection class="" enum-name="QtValidLicenseForGuiModule"/>
+  <rejection class="" enum-name="QtValidLicenseForScriptModule"/>
+  <rejection class="" enum-name="QtValidLicenseForHelpModule"/>
+  <rejection class="QtConcurrent" enum-name="enum_1"/>
+  <rejection class="QtConcurrent" function-name="operator|"/>
+
+  <rejection class="QFuture::const_iterator"/>
+  <rejection class="QFutureInterface"/>
+  <rejection class="QFutureInterfaceBase"/>
+  <rejection class="QtConcurrent::BlockSizeManager"/>
+  <rejection class="QtConcurrent::ConstMemberFunctionWrapper"/>
+  <rejection class="QtConcurrent::Exception"/>
+  <rejection class="QtConcurrent::FilterKernel"/>
+  <rejection class="QtConcurrent::FilteredEachKernel"/>
+  <rejection class="QtConcurrent::FilteredReducedKernel"/>
+  <rejection class="QtConcurrent::FunctionWrapper0"/>
+  <rejection class="QtConcurrent::FunctionWrapper1"/>
+  <rejection class="QtConcurrent::FunctionWrapper2"/>
+  <rejection class="QtConcurrent::IntermediateResults"/>
+  <rejection class="QtConcurrent::IterateKernel"/>
+  <rejection class="QtConcurrent::MapKernel"/>
+  <rejection class="QtConcurrent::MappedEachKernel"/>
+  <rejection class="QtConcurrent::MappedReducedKernel"/>
+  <rejection class="QtConcurrent::Median"/>
+  <rejection class="QtConcurrent::MemberFunctionWrapper"/>
+  <rejection class="QtConcurrent::MemberFunctionWrapper1"/>
+  <rejection class="QtConcurrent::ReduceKernel"/>
+  <rejection class="QtConcurrent::ResultItem"/>
+  <rejection class="QtConcurrent::ResultIterator"/>
+  <rejection class="QtConcurrent::ResultIteratorBase"/>
+  <rejection class="QtConcurrent::ResultReporter"/>
+  <rejection class="QtConcurrent::ResultStore"/>
+  <rejection class="QtConcurrent::ResultStoreBase"/>
+  <rejection class="QtConcurrent::RunFunctionTask"/>
+  <rejection class="QtConcurrent::RunFunctionTaskBase"/>
+  <rejection class="QtConcurrent::SelectSpecialization"/>
+  <rejection class="QtConcurrent::SelectStoredConstMemberFunctionCall0"/>
+  <rejection class="QtConcurrent::SelectStoredConstMemberFunctionCall1"/>
+  <rejection class="QtConcurrent::SelectStoredConstMemberFunctionCall2"/>
+  <rejection class="QtConcurrent::SelectStoredConstMemberFunctionCall3"/>
+  <rejection class="QtConcurrent::SelectStoredConstMemberFunctionCall4"/>
+  <rejection class="QtConcurrent::SelectStoredConstMemberFunctionCall5"/>
+  <rejection class="QtConcurrent::SelectStoredConstMemberFunctionPointerCall0"/>
+  <rejection class="QtConcurrent::SelectStoredConstMemberFunctionPointerCall1"/>
+  <rejection class="QtConcurrent::SelectStoredConstMemberFunctionPointerCall2"/>
+  <rejection class="QtConcurrent::SelectStoredConstMemberFunctionPointerCall3"/>
+  <rejection class="QtConcurrent::SelectStoredConstMemberFunctionPointerCall4"/>
+  <rejection class="QtConcurrent::SelectStoredConstMemberFunctionPointerCall5"/>
+  <rejection class="QtConcurrent::SelectStoredFunctorCall0"/>
+  <rejection class="QtConcurrent::SelectStoredFunctorCall1"/>
+  <rejection class="QtConcurrent::SelectStoredFunctorCall2"/>
+  <rejection class="QtConcurrent::SelectStoredFunctorCall3"/>
+  <rejection class="QtConcurrent::SelectStoredFunctorCall4"/>
+  <rejection class="QtConcurrent::SelectStoredFunctorCall5"/>
+  <rejection class="QtConcurrent::SelectStoredFunctorPointerCall0"/>
+  <rejection class="QtConcurrent::SelectStoredFunctorPointerCall1"/>
+  <rejection class="QtConcurrent::SelectStoredFunctorPointerCall2"/>
+  <rejection class="QtConcurrent::SelectStoredFunctorPointerCall3"/>
+  <rejection class="QtConcurrent::SelectStoredFunctorPointerCall4"/>
+  <rejection class="QtConcurrent::SelectStoredFunctorPointerCall5"/>
+  <rejection class="QtConcurrent::SelectStoredMemberFunctionCall0"/>
+  <rejection class="QtConcurrent::SelectStoredMemberFunctionCall1"/>
+  <rejection class="QtConcurrent::SelectStoredMemberFunctionCall2"/>
+  <rejection class="QtConcurrent::SelectStoredMemberFunctionCall3"/>
+  <rejection class="QtConcurrent::SelectStoredMemberFunctionCall4"/>
+  <rejection class="QtConcurrent::SelectStoredMemberFunctionCall5"/>
+  <rejection class="QtConcurrent::SelectStoredMemberFunctionPointerCall0"/>
+  <rejection class="QtConcurrent::SelectStoredMemberFunctionPointerCall1"/>
+  <rejection class="QtConcurrent::SelectStoredMemberFunctionPointerCall2"/>
+  <rejection class="QtConcurrent::SelectStoredMemberFunctionPointerCall3"/>
+  <rejection class="QtConcurrent::SelectStoredMemberFunctionPointerCall4"/>
+  <rejection class="QtConcurrent::SelectStoredMemberFunctionPointerCall5"/>
+  <rejection class="QtConcurrent::SequenceHolder1"/>
+  <rejection class="QtConcurrent::SequenceHolder2"/>
+  <rejection class="QtConcurrent::StoredConstMemberFunctionCall0"/>
+  <rejection class="QtConcurrent::StoredConstMemberFunctionCall1"/>
+  <rejection class="QtConcurrent::StoredConstMemberFunctionCall2"/>
+  <rejection class="QtConcurrent::StoredConstMemberFunctionCall3"/>
+  <rejection class="QtConcurrent::StoredConstMemberFunctionCall4"/>
+  <rejection class="QtConcurrent::StoredConstMemberFunctionCall5"/>
+  <rejection class="QtConcurrent::StoredConstMemberFunctionPointerCall0"/>
+  <rejection class="QtConcurrent::StoredConstMemberFunctionPointerCall1"/>
+  <rejection class="QtConcurrent::StoredConstMemberFunctionPointerCall2"/>
+  <rejection class="QtConcurrent::StoredConstMemberFunctionPointerCall3"/>
+  <rejection class="QtConcurrent::StoredConstMemberFunctionPointerCall4"/>
+  <rejection class="QtConcurrent::StoredConstMemberFunctionPointerCall5"/>
+  <rejection class="QtConcurrent::StoredFunctorCall0"/>
+  <rejection class="QtConcurrent::StoredFunctorCall1"/>
+  <rejection class="QtConcurrent::StoredFunctorCall2"/>
+  <rejection class="QtConcurrent::StoredFunctorCall3"/>
+  <rejection class="QtConcurrent::StoredFunctorCall4"/>
+  <rejection class="QtConcurrent::StoredFunctorCall5"/>
+  <rejection class="QtConcurrent::StoredFunctorPointerCall0"/>
+  <rejection class="QtConcurrent::StoredFunctorPointerCall1"/>
+  <rejection class="QtConcurrent::StoredFunctorPointerCall2"/>
+  <rejection class="QtConcurrent::StoredFunctorPointerCall3"/>
+  <rejection class="QtConcurrent::StoredFunctorPointerCall4"/>
+  <rejection class="QtConcurrent::StoredFunctorPointerCall5"/>
+  <rejection class="QtConcurrent::StoredMemberFunctionCall0"/>
+  <rejection class="QtConcurrent::StoredMemberFunctionCall1"/>
+  <rejection class="QtConcurrent::StoredMemberFunctionCall2"/>
+  <rejection class="QtConcurrent::StoredMemberFunctionCall3"/>
+  <rejection class="QtConcurrent::StoredMemberFunctionCall4"/>
+  <rejection class="QtConcurrent::StoredMemberFunctionCall5"/>
+  <rejection class="QtConcurrent::StoredMemberFunctionPointerCall0"/>
+  <rejection class="QtConcurrent::StoredMemberFunctionPointerCall1"/>
+  <rejection class="QtConcurrent::StoredMemberFunctionPointerCall2"/>
+  <rejection class="QtConcurrent::StoredMemberFunctionPointerCall3"/>
+  <rejection class="QtConcurrent::StoredMemberFunctionPointerCall4"/>
+  <rejection class="QtConcurrent::StoredMemberFunctionPointerCall5"/>
+  <rejection class="QtConcurrent::ThreadEngine"/>
+  <rejection class="QtConcurrent::ThreadEngineBase"/>
+  <rejection class="QtConcurrent::ThreadEngineSemaphore"/>
+  <rejection class="QtConcurrent::ThreadEngineStarter"/>
+  <rejection class="QtConcurrent::ThreadEngineStarterBase"/>
+  <rejection class="QtConcurrent::UnhandledException"/>
+  <rejection class="QtConcurrent::VoidStoredConstMemberFunctionCall0"/>
+  <rejection class="QtConcurrent::VoidStoredConstMemberFunctionCall1"/>
+  <rejection class="QtConcurrent::VoidStoredConstMemberFunctionCall2"/>
+  <rejection class="QtConcurrent::VoidStoredConstMemberFunctionCall3"/>
+  <rejection class="QtConcurrent::VoidStoredConstMemberFunctionCall4"/>
+  <rejection class="QtConcurrent::VoidStoredConstMemberFunctionCall5"/>
+  <rejection class="QtConcurrent::VoidStoredConstMemberFunctionPointerCall0"/>
+  <rejection class="QtConcurrent::VoidStoredConstMemberFunctionPointerCall1"/>
+  <rejection class="QtConcurrent::VoidStoredConstMemberFunctionPointerCall2"/>
+  <rejection class="QtConcurrent::VoidStoredConstMemberFunctionPointerCall3"/>
+  <rejection class="QtConcurrent::VoidStoredConstMemberFunctionPointerCall4"/>
+  <rejection class="QtConcurrent::VoidStoredConstMemberFunctionPointerCall5"/>
+  <rejection class="QtConcurrent::VoidStoredFunctorCall0"/>
+  <rejection class="QtConcurrent::VoidStoredFunctorCall1"/>
+  <rejection class="QtConcurrent::VoidStoredFunctorCall2"/>
+  <rejection class="QtConcurrent::VoidStoredFunctorCall3"/>
+  <rejection class="QtConcurrent::VoidStoredFunctorCall4"/>
+  <rejection class="QtConcurrent::VoidStoredFunctorCall5"/>
+  <rejection class="QtConcurrent::VoidStoredFunctorPointerCall0"/>
+  <rejection class="QtConcurrent::VoidStoredFunctorPointerCall1"/>
+  <rejection class="QtConcurrent::VoidStoredFunctorPointerCall2"/>
+  <rejection class="QtConcurrent::VoidStoredFunctorPointerCall3"/>
+  <rejection class="QtConcurrent::VoidStoredFunctorPointerCall4"/>
+  <rejection class="QtConcurrent::VoidStoredFunctorPointerCall5"/>
+  <rejection class="QtConcurrent::VoidStoredMemberFunctionCall0"/>
+  <rejection class="QtConcurrent::VoidStoredMemberFunctionCall1"/>
+  <rejection class="QtConcurrent::VoidStoredMemberFunctionCall2"/>
+  <rejection class="QtConcurrent::VoidStoredMemberFunctionCall3"/>
+  <rejection class="QtConcurrent::VoidStoredMemberFunctionCall4"/>
+  <rejection class="QtConcurrent::VoidStoredMemberFunctionCall5"/>
+  <rejection class="QtConcurrent::VoidStoredMemberFunctionPointerCall0"/>
+  <rejection class="QtConcurrent::VoidStoredMemberFunctionPointerCall1"/>
+  <rejection class="QtConcurrent::VoidStoredMemberFunctionPointerCall2"/>
+  <rejection class="QtConcurrent::VoidStoredMemberFunctionPointerCall3"/>
+  <rejection class="QtConcurrent::VoidStoredMemberFunctionPointerCall4"/>
+  <rejection class="QtConcurrent::VoidStoredMemberFunctionPointerCall5"/>
+
+  <rejection class="QModelIndex"/>
+  <rejection class="QSize"/>
+  <rejection class="QSizeF"/>
+  <rejection class="QPoint"/>
+  <rejection class="QPointF"/>
+
+  <rejection class="QMdi"/>
+  <rejection class="stdext"/>
+  <rejection class="QAlgorithmsPrivate"/>
+  <rejection class="QAtomic"/>
+  <rejection class="QAtomicPointer"/>
+  <rejection class="QAtomicInt"/>
+  <rejection class="QBasicAtomicInt"/>
+  <rejection class="QBasicAtomic"/>
+  <rejection class="QBasicAtomicPointer"/>
+  <rejection class="QBitRef"/>
+  <rejection class="QCache"/>
+  <rejection class="QCharRef"/>
+  <rejection class="QDebug"/>
+  <rejection class="QExplicitlySharedDataPointer"/>
+  <rejection class="QFlag"/>
+  <rejection class="QFlags"/>
+  <rejection class="QForeachContainer"/>
+  <rejection class="QForeachContainerBase"/>
+  <rejection class="QGlobalStatic"/>
+  <rejection class="QHash"/>
+  <rejection class="QHashData"/>
+  <rejection class="QHashDummyNode"/>
+  <rejection class="QHashDummyNode"/>
+  <rejection class="QHashDummyNode"/>
+  <rejection class="QHashDummyNode"/>
+  <rejection class="QHashDummyNode"/>
+  <rejection class="QHashDummyValue"/>
+  <rejection class="QHashIterator"/>
+  <rejection class="QHashNode"/>
+  <rejection class="QHashNode"/>
+  <rejection class="QHashNode"/>
+  <rejection class="QHashNode"/>
+  <rejection class="QHashNode"/>
+  <rejection class="QInternal"/>
+  <rejection class="QLibrary"/>
+  <rejection class="QLinkedList"/>
+  <rejection class="QLinkedListData"/>
+  <rejection class="QLinkedListIterator"/>
+  <rejection class="QLinkedListNode"/>
+  <rejection class="QListData"/>
+  <rejection class="QListIterator"/>
+  <rejection class="QMap"/>
+  <rejection class="QMapData"/>
+  <rejection class="QMapIterator"/>
+  <rejection class="QMetaType"/>
+  <rejection class="QMetaTypeId"/>
+  <rejection class="QMetaProperty"/>
+  <rejection class="QMetaObject"/>
+  <rejection class="QMetaClassInfo"/>
+  <rejection class="QMetaMethod"/>
+  <rejection class="QMetaEnum"/>
+  <rejection class="QMultiHash"/>
+  <rejection class="QMultiMap"/>
+  <rejection class="QMutableHashIterator"/>
+  <rejection class="QMutableLinkedListIterator"/>
+  <rejection class="QMutableListIterator"/>
+  <rejection class="QMutableMapIterator"/>
+  <rejection class="QMutableVectorIterator"/>
+  <rejection class="QMutexLocker"/>
+  <rejection class="QNoImplicitBoolCast"/>
+  <rejection class="QObjectCleanupHandler"/>
+  <rejection class="QObjectData"/>
+  <rejection class="QObjectUserData"/>
+  <rejection class="QPluginLoader"/>
+  <rejection class="QPointer"/>
+  <rejection class="QReadLocker"/>
+  <rejection class="QResource"/>
+  <rejection class="QSet"/>
+  <rejection class="QSetIterator"/>
+  <rejection class="QSharedData"/>
+  <rejection class="QSharedDataPointer"/>
+  <rejection class="QStack"/>
+  <rejection class="QSysInfo"/>
+  <rejection class="QTextStreamManipulator"/>
+  <rejection class="QThreadStorage"/>
+  <rejection class="QThreadStorageData"/>
+  <rejection class="QTypeInfo"/>
+  <rejection class="QTypeInfo"/>
+  <rejection class="QVFbKeyData"/>
+  <rejection class="QVariantComparisonHelper"/>
+  <rejection class="QVectorData"/>
+  <rejection class="QVectorIterator"/>
+  <rejection class="QVectorTypedData"/>
+  <rejection class="QWriteLocker"/>
+  <rejection class="QtPrivate"/>
+  <rejection class="qGreater"/>
+  <rejection class="qLess"/>
+  <rejection class="std"/>
+  <rejection class="QAbstractFileEngine::ExtensionOption"/>
+  <rejection class="QAbstractFileEngine::ExtensionReturn"/>
+  <rejection class="QByteArray::Data"/>
+  <rejection class="QIntForType"/>
+  <rejection class="QList::Node"/>
+  <rejection class="QList::const_iterator"/>
+  <rejection class="QList::iterator"/>
+  <rejection class="QMetaTypeId2"/>
+  <rejection class="QMutableSetIterator"/>
+  <rejection class="QSubString"/>
+  <rejection class="QUintForType"/>
+  <rejection class="QtConcurrent::internal"/>
+
+  <rejection class="QLocale::Data"/>
+  <rejection class="QGlobalStaticDeleter"/>
+  <rejection class="QSharedMemory"/> <!-- Temporarily until we know how to implement it in Java -->
+  <rejection class="QVarLengthArray"/>
+
+  <!-- DBus -->
+  <rejection class="QDBusAbstractAdaptor"/>
+  <rejection class="QDBusAbstractInterface"/>
+  <rejection class="QDBusArgument"/>
+  <rejection class="QDBusConnection"/>
+  <rejection class="QDBusConnectionInterface"/>
+  <rejection class="QDBusContext"/>
+  <rejection class="QDBusError"/>
+  <rejection class="QDBusInterface"/>
+  <rejection class="QDBusMessage"/>
+  <rejection class="QDBusMetaType"/>
+  <rejection class="QDBusObjectPath"/>
+  <rejection class="QDBusReply"/>
+  <rejection class="QDBusServer"/>
+  <rejection class="QDBusSignature"/>
+  <rejection class="QDBusVariant"/>
+
+  <rejection class="_Revbidit"/>
+  <rejection class="_complex"/>
+  <rejection class="_exception"/>
+  <rejection class="_iobuf"/>
+  <rejection class="_stat"/>
+  <rejection class="_wfinddata_t"/>
+  <rejection class="exception"/>
+  <rejection class="istreambuf_iterator"/>
+  <rejection class="ostreambuf_iterator"/>
+  <rejection class="reverse_bidirectional_iterator"/>
+  <rejection class="reverse_iterator"/>
+  <rejection class="stat"/>
+  <rejection class="tm"/>
+
+  <rejection class="QAbstractEventDispatcher" function-name="filterEvent"/>
+  <rejection class="QAbstractEventDispatcher" function-name="setEventFilter"/>
+  <rejection class="QAbstractFileEngine" function-name="beginEntryList"/>
+  <rejection class="QAbstractFileEngine" function-name="endEntryList"/>
+  <rejection class="QAbstractFileEngine" function-name="extension"/>
+  <rejection class="QCoreApplication" function-name="compressEvent"/>
+  <rejection class="QCoreApplication" function-name="eventFilter"/>
+  <rejection class="QCoreApplication" function-name="filterEvent"/>
+  <rejection class="QCoreApplication" function-name="setEventFilter"/>
+  <rejection class="QFile" function-name="setDecodingFunction"/>
+  <rejection class="QFile" function-name="setEncodingFunction"/>
+  <rejection class="QList" function-name="begin"/>
+  <rejection class="QList" function-name="constBegin"/>
+  <rejection class="QList" function-name="constEnd"/>
+  <rejection class="QList" function-name="end"/>
+  <rejection class="QList" function-name="erase"/>
+  <rejection class="QList" function-name="erase"/>
+  <rejection class="QList" function-name="free"/>
+  <rejection class="QList" function-name="fromList"/>
+  <rejection class="QList" function-name="fromSet"/>
+  <rejection class="QList" function-name="fromSet"/>
+  <rejection class="QList" function-name="insert"/>
+  <rejection class="QList" function-name="malloc"/>
+  <rejection class="QList" function-name="node_construct"/>
+  <rejection class="QList" function-name="node_copy"/>
+  <rejection class="QList" function-name="node_destruct"/>
+  <rejection class="QList" function-name="toSet"/>
+  <rejection class="QObject" function-name="receivers"/>
+  <rejection class="QObject" function-name="findChild"/>
+  <rejection class="QObject" function-name="findChildren"/>
+  <rejection class="QObject" function-name="setUserData"/>
+  <rejection class="QObject" function-name="userData"/>
+  <rejection class="QObject" function-name="destroyed"/>
+  <rejection class="QObject" function-name="connect"/>
+  <rejection class="QObject" function-name="connectNotify"/>
+  <rejection class="QObject" function-name="disconnect"/>
+  <rejection class="QObject" function-name="disconnectNotify"/>
+  <rejection class="QObject" function-name="registerUserData"/>
+  <rejection class="QObject" function-name="sender"/>
+  <rejection class="QTimer" function-name="singleShot"/>
+  <rejection class="QProcess" function-name="pid"/>
+  <rejection class="QRegion" function-name="cleanUp"/>
+  <rejection class="QSettings" function-name="registerFormat"/>
+  <rejection class="QVector" function-name="back"/>
+  <rejection class="QVector" function-name="begin"/>
+  <rejection class="QVector" function-name="constBegin"/>
+  <rejection class="QVector" function-name="constEnd"/>
+  <rejection class="QVector" function-name="end"/>
+  <rejection class="QVector" function-name="erase"/>
+  <rejection class="QVector" function-name="free"/>
+  <rejection class="QVector" function-name="front"/>
+  <rejection class="QVector" function-name="insert"/>
+  <rejection class="QVector" function-name="malloc"/>
+  <rejection class="QVector" function-name="alloc"/>
+  <rejection class="QVector" function-name="operator+="/>
+  <rejection class="QAbstractFileEngineIterator" function-name="entryInfo"/>
+
+  <rejection class="QAbstractFileEngineIterator" enum-name="EntryInfoType"/>
+  <rejection class="QDataStream" enum-name="ByteOrder"/>
+
+
+  <namespace-type name="Qt">
+    <modify-function signature="codecForHtml(const QByteArray &amp;)" remove="all"/>
+    <modify-function signature="mightBeRichText(const QString &amp;)" remove="all"/>
+    <modify-function signature="escape(const QString&amp;)" remove="all"/>
+    <modify-function signature="convertFromPlainText(const QString &amp;, Qt::WhiteSpaceMode)" remove="all"/>
+  </namespace-type>
+
+
+  <enum-type name="QtMsgType">
+    <reject-enum-value name="QtSystemMsg"/>
+  </enum-type>
+
+  <enum-type name="QReadWriteLock::RecursionMode"/>
+  <enum-type name="QSystemSemaphore::AccessMode"/>
+  <enum-type name="QSystemSemaphore::SystemSemaphoreError"/>
+  <enum-type name="QTextBoundaryFinder::BoundaryReason" flags="QTextBoundaryFinder::BoundaryReasons"/>
+  <enum-type name="QTextBoundaryFinder::BoundaryType"/>
+  <enum-type name="QAbstractFileEngine::Extension" extensible="yes"/>
+  <enum-type name="QAbstractFileEngine::FileFlag" flags="QAbstractFileEngine::FileFlags"/>
+  <enum-type name="QAbstractFileEngine::FileName"/>
+  <enum-type name="QAbstractFileEngine::FileOwner"/>
+  <enum-type name="QAbstractFileEngine::FileTime"/>
+  <enum-type name="QDataStream::Status"/>
+  <enum-type name="QDir::Filter" flags="QDir::Filters"/>
+  <enum-type name="QEvent::Type" extensible="yes">
+    <reject-enum-value name="ApplicationActivated"/>
+    <reject-enum-value name="ApplicationDeactivated"/>
+  </enum-type>
+  <enum-type name="QEventLoop::ProcessEventsFlag" flags="QEventLoop::ProcessEventsFlags"/>
+  <enum-type name="QFile::FileError"/>
+  <enum-type name="QFile::MemoryMapFlags"/>
+  <enum-type name="QFile::Permission" flags="QFile::Permissions"/>
+  <enum-type name="QIODevice::OpenModeFlag" flags="QIODevice::OpenMode"/>
+  <enum-type name="QLibraryInfo::LibraryLocation"/>
+  <enum-type name="QLocale::FormatType"/>
+  <enum-type name="QLocale::NumberOption" flags="QLocale::NumberOptions"/>
+  <enum-type name="QLocale::MeasurementSystem"/>
+  <enum-type name="QMutex::RecursionMode"/>
+  <enum-type name="QProcess::ExitStatus"/>
+  <enum-type name="QProcess::ProcessChannel"/>
+  <enum-type name="QProcess::ProcessChannelMode"/>
+  <enum-type name="QProcess::ProcessError"/>
+  <enum-type name="QProcess::ProcessState"/>
+  <enum-type name="QRegExp::CaretMode"/>
+  <enum-type name="QRegExp::PatternSyntax"/>
+  <enum-type name="QSettings::Format"/>
+  <enum-type name="QSettings::Scope"/>
+  <enum-type name="QSettings::Status"/>
+  <enum-type name="QSocketNotifier::Type"/>
+  <enum-type name="QSystemLocale::QueryType"/>
+  <enum-type name="QTextCodec::ConversionFlag" flags="QTextCodec::ConversionFlags"/>
+  <enum-type name="QTextStream::FieldAlignment"/>
+  <enum-type name="QTextStream::NumberFlag" flags="QTextStream::NumberFlags"/>
+  <enum-type name="QTextStream::RealNumberNotation"/>
+  <enum-type name="QTextStream::Status"/>
+  <enum-type name="QTimeLine::CurveShape"/>
+  <enum-type name="QTimeLine::Direction"/>
+  <enum-type name="QTimeLine::State"/>
+  <enum-type name="QUrl::FormattingOption" flags="QUrl::FormattingOptions"/>
+  <enum-type name="QUrl::ParsingMode"/>
+  <enum-type name="QUuid::Variant"/>
+  <enum-type name="QUuid::Version"/>
+  <enum-type name="Qt::SizeHint"/>
+  <enum-type name="Qt::SizeMode"/>
+  <enum-type name="Qt::WindowFrameSection"/>
+  <enum-type name="Qt::Axis"/>
+  <enum-type name="Qt::AnchorAttribute"/>
+  <enum-type name="Qt::ApplicationAttribute"/>
+  <enum-type name="Qt::ArrowType"/>
+  <enum-type name="Qt::AspectRatioMode"/>
+  <enum-type name="Qt::BGMode"/>
+  <enum-type name="Qt::BrushStyle"/>
+  <enum-type name="Qt::CaseSensitivity"/>
+  <enum-type name="Qt::CheckState"/>
+  <enum-type name="Qt::ClipOperation"/>
+  <enum-type name="Qt::ConnectionType"/>
+  <enum-type name="Qt::ContextMenuPolicy"/>
+  <enum-type name="Qt::Corner"/>
+  <enum-type name="Qt::DayOfWeek"/>
+  <enum-type name="Qt::DockWidgetAreaSizes"/>
+  <enum-type name="Qt::DropAction" flags="Qt::DropActions"/>
+  <enum-type name="Qt::FillRule"/>
+  <enum-type name="Qt::FocusPolicy"/>
+  <enum-type name="Qt::FocusReason"/>
+  <enum-type name="Qt::GlobalColor"/>
+  <enum-type name="Qt::HitTestAccuracy"/>
+  <enum-type name="Qt::InputMethodQuery"/>
+  <enum-type name="Qt::ItemFlag" flags="Qt::ItemFlags"/>
+  <enum-type name="Qt::ItemSelectionMode"/>
+  <enum-type name="Qt::KeyboardModifier" flags="Qt::KeyboardModifiers"/>
+  <enum-type name="Qt::LayoutDirection"/>
+  <enum-type name="Qt::MatchFlag" flags="Qt::MatchFlags"/>
+  <enum-type name="Qt::Modifier"/>
+  <enum-type name="Qt::MouseButton" flags="Qt::MouseButtons"/>
+  <enum-type name="Qt::Orientation" flags="Qt::Orientations"/>
+  <enum-type name="Qt::PenCapStyle"/>
+  <enum-type name="Qt::PenJoinStyle"/>
+  <enum-type name="Qt::PenStyle"/>
+  <enum-type name="Qt::ScrollBarPolicy"/>
+  <enum-type name="Qt::ShortcutContext"/>
+  <enum-type name="Qt::SortOrder"/>
+  <enum-type name="Qt::TextElideMode"/>
+  <enum-type name="Qt::TextFlag"/>
+  <enum-type name="Qt::TextFormat"/>
+  <enum-type name="Qt::TextInteractionFlag" flags="Qt::TextInteractionFlags"/>
+  <enum-type name="Qt::TimeSpec"/>
+  <enum-type name="Qt::ToolBarAreaSizes"/>
+  <enum-type name="Qt::ToolButtonStyle"/>
+  <enum-type name="Qt::TransformationMode"/>
+  <enum-type name="Qt::UIEffect"/>
+  <enum-type name="Qt::WhiteSpaceMode"/>
+  <enum-type name="Qt::WindowModality"/>
+  <enum-type name="Qt::WindowState" flags="Qt::WindowStates"/>
+  <enum-type name="Qt::WindowType" flags="Qt::WindowFlags"/>
+  <enum-type name="QDirIterator::IteratorFlag" flags="QDirIterator::IteratorFlags"/>
+  <enum-type name="Qt::EventPriority"/>
+  <enum-type name="Qt::MaskMode"/>
+  <enum-type name="QCryptographicHash::Algorithm"/>
+
+  <enum-type name="QtConcurrent::ReduceOption" flags="QtConcurrent::ReduceOptions"/>
+  <enum-type name="QtConcurrent::ThreadFunctionResult"/>
+
+  <enum-type name="QCoreApplication::Encoding">
+    <reject-enum-value name="DefaultCodec"/>
+  </enum-type>
+
+  <enum-type name="Qt::AlignmentFlag" flags="Qt::Alignment">
+    <reject-enum-value name="AlignLeading"/>
+    <reject-enum-value name="AlignTrailing"/>
+  </enum-type>
+
+  <enum-type name="Qt::CursorShape">
+    <reject-enum-value name="LastCursor"/>
+  </enum-type>
+
+  <enum-type name="Qt::DateFormat">
+    <reject-enum-value name="LocalDate"/>
+  </enum-type>
+
+
+  <enum-type name="Qt::ItemDataRole" force-integer="yes">
+    <reject-enum-value name="BackgroundColorRole"/>
+    <reject-enum-value name="TextColorRole"/>
+  </enum-type>
+
+
+  <enum-type name="QDataStream::Version">
+    <reject-enum-value name="Qt_4_1"/>
+    <reject-enum-value name="Qt_4_5"/>
+  </enum-type>
+
+  <enum-type name="QDir::SortFlag" flags="QDir::SortFlags">
+    <reject-enum-value name="Unsorted"/>
+  </enum-type>
+
+  <enum-type name="Qt::DockWidgetArea" flags="Qt::DockWidgetAreas">
+    <reject-enum-value name="AllDockWidgetAreas"/>
+  </enum-type>
+
+  <enum-type name="Qt::ImageConversionFlag" flags="Qt::ImageConversionFlags">
+    <reject-enum-value name="AutoDither"/>
+    <reject-enum-value name="ColorOnly"/>
+    <reject-enum-value name="DiffuseDither"/>
+    <reject-enum-value name="NoAlpha"/>
+    <reject-enum-value name="ThresholdAlphaDither"/>
+  </enum-type>
+
+  <enum-type name="Qt::Key">
+    <reject-enum-value name="Key_Any"/>
+  </enum-type>
+
+  <enum-type name="QLocale::Language">
+    <reject-enum-value name="LastLanguage"/>
+    <reject-enum-value name="NorwegianBokmal"/>
+    <reject-enum-value name="Nynorsk"/>
+  </enum-type>
+
+  <enum-type name="QLocale::Country">
+    <reject-enum-value name="LastCountry"/>
+  </enum-type>
+
+  <enum-type name="Qt::ToolBarArea" flags="Qt::ToolBarAreas">
+    <reject-enum-value name="AllToolBarAreas"/>
+  </enum-type>
+
+  <enum-type name="Qt::WidgetAttribute">
+    <reject-enum-value name="WA_ForceAcceptDrops"/>
+    <reject-enum-value name="WA_NoBackground"/>
+    <reject-enum-value name="WA_MacMetalStyle"/>
+  </enum-type>
+<!--
+  <value-type name="QVariant">
+    <modify-function signature="QVariant(const QLatin1String &amp;)" remove="all"/>
+  </value-type>
+  -->
+  <value-type name="QBasicTimer"/>
+  <value-type name="QByteArrayMatcher">
+    <modify-function signature="operator=(QByteArrayMatcher)" remove="all"/>
+  </value-type>
+
+  <value-type name="QDate">
+    <modify-function signature="julianToGregorian(uint,int&amp;,int&amp;,int&amp;)">
+        <remove/>
+    </modify-function>
+
+    <modify-function signature="setYMD(int, int, int)" remove="all"/> <!--### Obsolete in 4.3-->
+  
+        <inject-code>
+            <import-file name="typesystem_core-java.java" quote-after-line="class QDate___" quote-before-line="}// class"/>
+        </inject-code>
+
+        <modify-function signature="weekNumber(int*)const">
+            <access modifier="private"/>
+            <modify-argument index="1">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+
+    </value-type>
+
+  <value-type name="QDateTime">
+    <modify-function signature="operator=(QDateTime)" remove="all"/>
+  </value-type>
+
+  <value-type name="QDir">
+    <modify-function signature="QDir(QString,QString,QFlags&lt;QDir::SortFlag&gt;,QFlags&lt;QDir::Filter&gt;)">
+        <modify-argument index="3">
+            <replace-default-expression with="SortFlag.Name | SortFlag.IgnoreCase"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="operator=(QDir)" remove="all"/>
+    <modify-function signature="operator=(QString)" remove="all"/>
+    <modify-function signature="addResourceSearchPath(QString)" remove="all"/> <!--### Obsolete in 4.3-->
+  
+        <inject-code>
+            <import-file name="typesystem_core-java.java" quote-after-line="class QDir___" quote-before-line="}// class"/>
+        </inject-code>
+        <modify-function signature="operator[](int)const" access="private"/>
+
+    </value-type>
+
+  <value-type name="QPoint" wrap="struct">
+        <modify-function signature="operator*=(double)" access="private" associated-to="multiply(double d)"/>
+        <modify-function signature="operator/=(double)" access="private" associated-to="divide(double d)"/>
+        <modify-function signature="operator+=(QPoint)" access="private" associated-to="add(QPoint)"/>
+        <modify-function signature="operator-=(QPoint)" access="private" associated-to="subtract(QPoint)"/>
+        <modify-function signature="rx()"> <remove/> </modify-function>
+        <modify-function signature="ry()"> <remove/> </modify-function>
+        <inject-code>
+            <insert-template name="core.multiply-devide-add-subtract">
+                <replace from="%TYPE" to="QPoint"/>
+            </insert-template>
+        </inject-code>
+    </value-type>
+  <value-type name="QPointF" wrap="struct">
+        <modify-function signature="operator*=(double)" access="private" associated-to="multiply(double d)"/>
+        <modify-function signature="operator/=(double)" access="private" associated-to="divide(double d)"/>
+        <modify-function signature="operator+=(QPointF)" access="private" associated-to="add(QPointF p)"/>
+        <modify-function signature="operator-=(QPointF)" access="private" associated-to="subtract(QPointF p)"/>
+        <modify-function signature="rx()"> <remove/> </modify-function>
+        <modify-function signature="ry()"> <remove/> </modify-function>
+        <inject-code>
+            <insert-template name="core.multiply-devide-add-subtract">
+                <replace from="%TYPE" to="QPointF"/>
+            </insert-template>
+        </inject-code>
+    </value-type>
+
+  <value-type name="QRect">
+    <modify-function signature="getCoords(int*,int*,int*,int*)const"> <remove/> </modify-function>
+    <modify-function signature="getRect(int*,int*,int*,int*)const"> <remove/> </modify-function>
+    <modify-function signature="operator&amp;=(QRect)"> <remove/> </modify-function>
+    <modify-function signature="operator|=(QRect)"> <remove/> </modify-function>
+    <modify-function signature="operator&amp;(QRect)const"> <remove/> </modify-function>
+    <modify-function signature="operator|(QRect)const"> <remove/> </modify-function>
+
+    <modify-function signature="intersect(const QRect&amp;)const" remove="all"/> <!--### Obsolete in 4.3-->
+    <modify-function signature="unite(const QRect&amp;)const" remove="all"/> <!--### Obsolete in 4.3-->
+  </value-type>
+
+  <value-type name="QRectF">
+    <modify-function signature="getCoords(double*,double*,double*,double*)const"> <remove/> </modify-function>
+    <modify-function signature="getRect(double*,double*,double*,double*)const"> <remove/> </modify-function>
+    <modify-function signature="operator&amp;=(QRectF)"> <remove/> </modify-function>
+    <modify-function signature="operator|=(QRectF)"> <remove/> </modify-function>
+    <modify-function signature="operator&amp;(QRectF)const"> <remove/> </modify-function>
+    <modify-function signature="operator|(QRectF)const"> <remove/> </modify-function>
+
+    <modify-function signature="intersect(const QRectF&amp;)const" remove="all"/> <!--### Obsolete in 4.3-->
+    <modify-function signature="unite(const QRectF&amp;)const" remove="all"/> <!--### Obsolete in 4.3-->
+  </value-type>
+
+  <value-type name="QModelIndex" wrap="struct"/>
+
+  <value-type name="QSize" wrap="struct">
+    <modify-function signature="operator*=(double)"> <access modifier="private"/> </modify-function>
+    <modify-function signature="operator/=(double)"> <access modifier="private"/> </modify-function>
+    <modify-function signature="operator+=(QSize)"> <access modifier="private"/> </modify-function>
+    <modify-function signature="operator-=(QSize)"> <access modifier="private"/> </modify-function>
+    <modify-function signature="rheight()"> <remove/> </modify-function>
+    <modify-function signature="rwidth()"> <remove/> </modify-function>
+  
+        <inject-code>
+            <insert-template name="core.multiply-devide-add-subtract">
+                <replace from="%TYPE" to="QSize"/>
+            </insert-template>
+        </inject-code>
+    </value-type>
+
+  <value-type name="QSizeF" wrap="struct">
+    <modify-function signature="operator*=(double)"> <access modifier="private"/> </modify-function>
+    <modify-function signature="operator/=(double)"> <access modifier="private"/> </modify-function>
+    <modify-function signature="operator+=(QSizeF)"> <access modifier="private"/> </modify-function>
+    <modify-function signature="operator-=(QSizeF)"> <access modifier="private"/> </modify-function>
+    <modify-function signature="rheight()"> <remove/> </modify-function>
+    <modify-function signature="rwidth()"> <remove/> </modify-function>
+  
+        <inject-code>
+            <insert-template name="core.multiply-devide-add-subtract">
+                <replace from="%TYPE" to="QSizeF"/>
+            </insert-template>
+        </inject-code>
+    </value-type>
+
+  <value-type name="QStringMatcher">
+    <modify-function signature="operator=(QStringMatcher)" remove="all"/>
+  </value-type>
+
+  <value-type name="QTime"/>
+
+  <value-type name="QPersistentModelIndex">
+    <modify-function signature="operator=(QPersistentModelIndex)" remove="all"/>
+    <modify-function signature="operator=(QModelIndex)" remove="all"/>
+    <modify-function signature="internalPointer()const" remove="all"/>
+  </value-type>
+
+  <value-type name="QUuid">
+    <modify-function signature="QUuid(const char*)">
+        <remove/>
+    </modify-function>
+  </value-type>
+
+  <value-type name="QLocale">
+    <modify-function signature="toString(unsigned long long) const" remove="all"/>
+    <modify-function signature="toString(unsigned short) const" remove="all"/>
+    <modify-function signature="toString(unsigned int) const" remove="all"/>
+    <modify-function signature="toUInt(QString,bool*,int)const" remove="all"/>
+    <modify-function signature="toULongLong(QString,bool*,int)const" remove="all"/>
+    <modify-function signature="operator=(QLocale)" remove="all"/>
+
+<!--
+        <template name="core.qlocale_to_type_general">
+        public final %TYPE %FUNCTION_NAME(String s%EXTRA_ARGUMENTS) {
+            QNativePointer ok = new QNativePointer(QNativePointer.Type.Boolean);
+            %TYPE returned = (%TYPE) %FUNCTION_NAME(s, ok%EXTRA_CALL_ARGUMENTS);
+            if (!ok.booleanValue())
+                throw new NumberFormatException(s);
+            return returned;
+        }
+        </template>
+
+
+        <template name="core.qlocale_to_type_integer">
+            <insert-template name="core.qlocale_to_type_general">
+                <replace from="%EXTRA_ARGUMENTS" to=", int base"/>
+                <replace from="%EXTRA_CALL_ARGUMENTS" to=", base"/>
+            </insert-template>
+
+        public final %TYPE %FUNCTION_NAME(String s) {
+            return %FUNCTION_NAME(s, 0);
+        }
+        </template>
+
+        <template name="core.qlocale_to_type_float">
+            <insert-template name="core.qlocale_to_type_general">
+                <replace from="%EXTRA_ARGUMENTS" to=""/>
+                <replace from="%EXTRA_CALL_ARGUMENTS" to=""/>
+            </insert-template>
+        </template>
+
+        <modify-function signature="toDouble(QString,bool*)const">
+            <access modifier="private"/>
+            <modify-argument index="2">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+        <inject-code>
+            <insert-template name="core.qlocale_to_type_float">
+                <replace from="%TYPE" to="double"/>
+                <replace from="%FUNCTION_NAME" to="toDouble"/>
+            </insert-template>
+        </inject-code>
+
+        <modify-function signature="toFloat(QString,bool*)const">
+            <access modifier="private"/>
+            <modify-argument index="2">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+        <inject-code>
+            <insert-template name="core.qlocale_to_type_float">
+                <replace from="%TYPE" to="float"/>
+                <replace from="%FUNCTION_NAME" to="toFloat"/>
+            </insert-template>
+        </inject-code>
+
+        <modify-function signature="toInt(QString,bool*,int)const">
+            <access modifier="private"/>
+            <modify-argument index="2">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="3">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+        <inject-code>
+            <insert-template name="core.qlocale_to_type_integer">
+                <replace from="%TYPE" to="int"/>
+                <replace from="%FUNCTION_NAME" to="toInt"/>
+            </insert-template>
+        </inject-code>
+
+        <modify-function signature="toLongLong(QString,bool*,int)const">
+            <access modifier="private"/>
+            <rename to="toLong"/>
+            <modify-argument index="2">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="3">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+        <inject-code>
+            <insert-template name="core.qlocale_to_type_integer">
+                <replace from="%TYPE" to="long"/>
+                <replace from="%FUNCTION_NAME" to="toLong"/>
+            </insert-template>
+        </inject-code>
+
+        <modify-function signature="toShort(QString,bool*,int)const">
+            <access modifier="private"/>
+            <modify-argument index="2">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="3">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+        <inject-code>
+            <insert-template name="core.qlocale_to_type_integer">
+                <replace from="%TYPE" to="short"/>
+                <replace from="%FUNCTION_NAME" to="toShort"/>
+            </insert-template>
+        </inject-code>
+
+        <modify-function signature="toUShort(QString,bool*,int)const">
+            <access modifier="private"/>
+            <rename to="toChar"/>
+            <modify-argument index="2">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="3">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+        <inject-code>
+            <insert-template name="core.qlocale_to_type_integer">
+                <replace from="%TYPE" to="char"/>
+                <replace from="%FUNCTION_NAME" to="toChar"/>
+            </insert-template>
+        </inject-code>
+		-->
+    </value-type>
+
+
+  <value-type name="QBitArray">
+    <modify-function signature="operator[](int)" remove="all"/>
+    <modify-function signature="operator[](int)const" remove="all"/>
+    <modify-function signature="operator[](uint)const" remove="all"/>
+    <modify-function signature="operator[](uint)" remove="all"/>
+
+    <modify-function signature="operator&amp;=(QBitArray)" access="private"/>
+    <modify-function signature="operator=(QBitArray)" access="private"/>
+    <modify-function signature="operator^=(QBitArray)" access="private"/>
+    <modify-function signature="operator|=(QBitArray)" access="private"/>
+    <modify-function signature="operator~()const" access="private"/>
+  
+      <inject-code>
+          <import-file name="typesystem_core-java.java" quote-after-line="class QBitArray___" quote-before-line="}// class"/>
+      </inject-code>
+  </value-type>
+
+  <object-type name="QReadWriteLock"/>
+  <object-type name="QDirIterator"/>
+  <object-type name="QAbstractFileEngineIterator"/>
+  <object-type name="QAbstractItemModel">
+        <modify-function signature="parent()const" remove="java"/>
+        <extra-includes>
+            <include file-name="QStringList" location="global"/>
+            <include file-name="QSize" location="global"/>
+        </extra-includes>
+<!--        <modify-function signature="createIndex(int, int, int)const">
+            <remove/>
+        </modify-function> -->
+        <inject-code class="java">
+            <import-file name="typesystem_core-java.java" quote-after-line="class QAbstractItemModel___" quote-before-line="}// class"/>
+        </inject-code>
+<!--        <inject-code class="native">
+    extern "C" JNIEXPORT jboolean JNICALL QTJAMBI_FUNCTION_PREFIX(Java_com_trolltech_qt_core_QAbstractItemModel_setData_1native)
+    (JNIEnv *__jni_env,
+     jobject,
+     jlong __this_nativeId,
+     jint row, jint col, jobject value, jint role)
+    {
+        QtJambiShell_QAbstractItemModel *__qt_this =
+            (QtJambiShell_QAbstractItemModel *) qtjambi_from_jlong(__this_nativeId);
+        QVariant qt_value = qtjambi_to_qvariant(__jni_env, value);
+
+        QModelIndex index = __qt_this-&gt;index(row, col, QModelIndex());
+        return __qt_this-&gt;setData(index, qt_value, role);
+    }
+
+    extern "C" JNIEXPORT jobject JNICALL QTJAMBI_FUNCTION_PREFIX(Java_com_trolltech_qt_core_QAbstractItemModel_data_1native)
+    (JNIEnv *__jni_env,
+     jobject,
+     jlong __this_nativeId,
+     jint row, jint col, jint role)
+    {
+        QtJambiShell_QAbstractItemModel *__qt_this =
+            (QtJambiShell_QAbstractItemModel *) qtjambi_from_jlong(__this_nativeId);
+
+        QModelIndex index = __qt_this-&gt;index(row, col, QModelIndex());
+        return qtjambi_from_qvariant(__jni_env, __qt_this-&gt;data(index, role));
+    }
+        </inject-code>
+-->
+        <modify-function signature="mimeData(QList&lt;QModelIndex&gt;)const">
+            <modify-argument index="0">
+                <define-ownership class="shell" owner="c++"/>
+            </modify-argument>
+        </modify-function>
+    </object-type>
+
+  <object-type name="QAbstractListModel">
+    <extra-includes>
+        <include file-name="QStringList" location="global"/>
+        <include file-name="QSize" location="global"/>
+    </extra-includes>
+  </object-type>
+
+  <value-type name="QUrl">
+    <extra-includes>
+        <include file-name="QStringList" location="global"/>
+    </extra-includes>
+    <modify-function signature="operator=(QUrl)" remove="all"/>
+    <modify-function signature="operator=(QString)" remove="all"/>
+
+    <modify-function signature="encodedQueryItems()const" remove="all"/>
+    <modify-function signature="queryItems()const" remove="all"/>
+    <modify-function signature="setEncodedQueryItems(QList&lt;QPair&lt;QByteArray, QByteArray&gt; &gt;)" remove="all"/>
+    <modify-function signature="setQueryItems(QList&lt;QPair&lt;QString, QString&gt; &gt;)" remove="all"/>
+
+    <modify-function signature="fromPunycode(const QByteArray&amp;)" remove="all"/> <!--### Obsolete in 4.3-->
+    <modify-function signature="toPunycode(const QString&amp;)" remove="all"/> <!--### Obsolete in 4.3-->
+  </value-type>
+
+  <value-type name="QRegExp">
+    <extra-includes>
+        <include file-name="QStringList" location="global"/>
+    </extra-includes>
+    <modify-function signature="operator=(QRegExp)" remove="all"/>
+    <modify-function signature="cap(int)const" remove="all"/>
+    <modify-function signature="errorString()const" remove="all"/>
+    <modify-function signature="pos(int)const" remove="all"/>
+    <modify-function signature="capturedTexts()const" remove="all"/>
+
+  </value-type>
+
+  <value-type name="QFileInfo">
+    <extra-includes>
+        <include file-name="QDateTime" location="global"/>
+        <include file-name="QDir" location="global"/>
+    </extra-includes>
+    <modify-function signature="operator!=(const QFileInfo &amp;)const" remove="all"/>
+    <modify-function signature="operator==(const QFileInfo &amp;)const" remove="all"/>
+    <modify-function signature="operator=(QFileInfo)" remove="all"/>
+    <modify-function signature="setFile(QFile)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="readLink()const" remove="all"/> <!--### Obsolete in 4.3-->
+  </value-type>
+
+  <interface-type name="QFactoryInterface" java-name="QAbstractFactory"/>
+
+  <value-type name="QByteArray">
+
+    <extra-includes>
+        <include file-name="QNoImplicitBoolCast" location="global"/>
+    </extra-includes>
+
+    <!-- removed functions -->
+    <modify-function signature="begin()" remove="all"/>
+    <modify-function signature="begin()const" remove="all"/>
+    <modify-function signature="constBegin()const" remove="all"/>
+    <modify-function signature="constData()const" remove="all"/>
+    <modify-function signature="constEnd()const" remove="all"/>
+    <modify-function signature="count()const" remove="all"/>
+    <modify-function signature="data()const" remove="all"/>
+    <modify-function signature="end()" remove="all"/>
+    <modify-function signature="end()const" remove="all"/>
+    <modify-function signature="number(uint,int)" remove="all"/>
+    <modify-function signature="number(unsigned long long,int)" remove="all"/>
+    <modify-function signature="operator const char *()const" remove="all"/>
+    <modify-function signature="operator const void *()const" remove="all"/>
+    <modify-function signature="operator+=(const char*)" remove="all"/>
+    <modify-function signature="operator=(const char*)" remove="all"/>
+    <modify-function signature="operator[](int)" remove="all"/>
+    <modify-function signature="operator[](int)const" remove="all"/>
+    <modify-function signature="operator[](uint)" remove="all"/>
+    <modify-function signature="operator[](uint)const" remove="all"/>
+    <modify-function signature="push_back(char)" remove="all"/>
+    <modify-function signature="push_back(const QByteArray&amp;)" remove="all"/>
+    <modify-function signature="push_back(const char*)" remove="all"/>
+    <modify-function signature="push_front(char)" remove="all"/>
+    <modify-function signature="push_front(const QByteArray&amp;)" remove="all"/>
+    <modify-function signature="push_front(const char*)" remove="all"/>
+    <modify-function signature="setNum(uint,int)" remove="all"/>
+    <modify-function signature="setNum(unsigned long long,int)" remove="all"/>
+    <modify-function signature="setNum(unsigned short,int)" remove="all"/>
+    <modify-function signature="toLong(bool*, int) const" remove="all"/>
+    <modify-function signature="toLongLong(bool*, int) const" remove="all"/>
+    <modify-function signature="toShort(bool*, int) const" remove="all"/>
+    <modify-function signature="toUInt(bool*, int) const" remove="all"/>
+    <modify-function signature="toULong(bool*, int) const" remove="all"/>
+    <modify-function signature="toULongLong(bool*, int) const" remove="all"/>
+
+    <!-- functions made private... -->
+    <modify-function signature="operator=(QByteArray)" access="private"/>
+    <modify-function signature="operator+=(QByteArray)" remove="all"/>
+    <modify-function signature="operator+=(QString)" remove="all"/>
+    <modify-function signature="operator+=(char)" remove="all"/>
+<!--  qtd2
+        <inject-code class="java">
+            <import-file name="typesystem_core-java.java" quote-after-line="class QByteArray___" quote-before-line="}// class"/>
+
+            <template name="QByteArray::toType(base)">
+    public final %TYPE% %NAME%(int base) throws NumberFormatException{
+        qt.QNativePointer ok = new qt.QNativePointer(qt.QNativePointer.Type.Boolean);
+        %TYPE% res = %NAME%_private(ok, base);
+        if(!ok.booleanValue()){
+            throw new NumberFormatException();
+        }
+        return res;
+    }
+
+    public %TYPE% %NAME%(){
+        return %NAME%(10);
+    }
+            </template>
+
+            <insert-template name="QByteArray::toType(base)">
+                <replace from="%NAME%" to="toChar"/>
+                <replace from="%TYPE%" to="char"/>
+            </insert-template>
+
+            <insert-template name="QByteArray::toType(base)">
+                <replace from="%NAME%" to="toInt"/>
+                <replace from="%TYPE%" to="int"/>
+            </insert-template>
+
+            <template name="QByteArray::toType()">
+    public final %TYPE% %NAME%() throws NumberFormatException{
+        qt.QNativePointer ok = new qt.QNativePointer(qt.QNativePointer.Type.Boolean);
+        %TYPE% res = %NAME%_private(ok);
+        if(!ok.booleanValue()){
+            throw new NumberFormatException();
+        }
+        return res;
+    }
+            </template>
+
+            <insert-template name="QByteArray::toType()">
+                <replace from="%NAME%" to="toDouble"/>
+                <replace from="%TYPE%" to="double"/>
+            </insert-template>
+
+            <insert-template name="QByteArray::toType()">
+                <replace from="%NAME%" to="toFloat"/>
+                <replace from="%TYPE%" to="float"/>
+            </insert-template>
+
+        </inject-code>
+
+-->
+<!-- qtd
+   <modify-function signature="toUShort(bool*, int) const" rename="toChar_private" access="private">
+        <modify-argument index="1">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="2">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="toInt(bool*, int) const" rename="toInt_private" access="private">
+        <modify-argument index="1">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="2">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="toDouble(bool*) const">
+        <rename to="toDouble_private"/>
+        <access modifier="private"/>
+        <modify-argument index="1">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="toFloat(bool*) const">
+        <rename to="toFloat_private"/>
+        <access modifier="private"/>
+        <modify-argument index="1">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+-->
+    <modify-function signature="QByteArray(const char*)" remove="all"/>
+
+    <modify-function signature="QByteArray(const char*,int)">
+        <access modifier="private"/>
+    </modify-function>
+
+<!-- qtd
+    <modify-function signature="append(QString)">
+        <access modifier="private"/>
+        <rename to="append_private"/>
+    </modify-function>
+    <inject-code>
+        <insert-template name="core.unary_other_type">
+            <replace from="%IN_TYPE" to="String"/>
+            <replace from="%OUT_TYPE" to="QByteArray"/>
+            <replace from="%FUNCTION_NAME" to="append"/>
+        </insert-template>
+    </inject-code>
+-->
+    <modify-function signature="append(const char*)">
+        <remove/>
+    </modify-function>
+<!-- qtd
+    <modify-function signature="append(QByteArray)">
+        <access modifier="private"/>
+        <rename to="append_private"/>
+    </modify-function>
+    <inject-code>
+        <insert-template name="core.unary_self_type">
+            <replace from="%TYPE" to="QByteArray"/>
+            <replace from="%FUNCTION_NAME" to="append"/>
+        </insert-template>
+    </inject-code>
+
+    <modify-function signature="append(char)">
+        <access modifier="private"/>
+        <rename to="append_private"/>
+    </modify-function>
+    <inject-code>
+        <insert-template name="core.unary_other_type">
+            <replace from="%IN_TYPE" to="byte"/>
+            <replace from="%OUT_TYPE" to="QByteArray"/>
+            <replace from="%FUNCTION_NAME" to="append"/>
+        </insert-template>
+    </inject-code>
+-->
+    <modify-function signature="contains(const char*)const">
+        <remove/>
+    </modify-function>
+
+
+    <modify-function signature="count(const char*)const">
+        <remove/>
+    </modify-function>
+
+
+    <modify-function signature="endsWith(const char*)const">
+        <remove/>
+    </modify-function>
+
+<!-- qtd
+    <modify-function signature="fill(char,int)">
+        <access modifier="private"/>
+        <rename to="fill_private"/>
+        <modify-argument index="2">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+    <inject-code>
+        <insert-template name="core.private_function_return_self">
+            <replace from="%RETURN_TYPE" to="QByteArray"/>
+            <replace from="%FUNCTION_NAME" to="fill"/>
+            <replace from="%ARGUMENTS" to="byte b, int size"/>
+            <replace from="%ARGUMENT_NAMES" to="b, size"/>
+        </insert-template>
+
+        public QByteArray  fill(byte b) {
+            return fill(b, -1);
+        }
+
+    </inject-code>
+-->
+    <modify-function signature="indexOf(const char*,int)const">
+        <remove/>
+    </modify-function>
+<!-- qtd
+    <modify-function signature="insert(int,QByteArray)">
+        <access modifier="private"/>
+        <rename to="insert_private"/>
+    </modify-function>
+    <inject-code>
+        <insert-template name="core.private_function_return_self">
+            <replace from="%RETURN_TYPE" to="QByteArray"/>
+            <replace from="%FUNCTION_NAME" to="insert"/>
+            <replace from="%ARGUMENTS" to="int i, QByteArray ba"/>
+            <replace from="%ARGUMENT_NAMES" to="i, ba"/>
+        </insert-template>
+    </inject-code>
+
+    <modify-function signature="insert(int,char)">
+        <access modifier="private"/>
+        <rename to="insert_private"/>
+    </modify-function>
+    <inject-code>
+        <insert-template name="core.private_function_return_self">
+            <replace from="%RETURN_TYPE" to="QByteArray"/>
+            <replace from="%FUNCTION_NAME" to="insert"/>
+            <replace from="%ARGUMENTS" to="int i, byte b"/>
+            <replace from="%ARGUMENT_NAMES" to="i, b"/>
+        </insert-template>
+    </inject-code>
+
+    <modify-function signature="insert(int,QString)">
+        <access modifier="private"/>
+        <rename to="insert_private"/>
+    </modify-function>
+    <inject-code>
+        <insert-template name="core.private_function_return_self">
+            <replace from="%RETURN_TYPE" to="QByteArray"/>
+            <replace from="%FUNCTION_NAME" to="insert"/>
+            <replace from="%ARGUMENTS" to="int i, String str"/>
+            <replace from="%ARGUMENT_NAMES" to="i, str"/>
+        </insert-template>
+    </inject-code>
+-->
+    <modify-function signature="insert(int,const char*)" remove="all"/>
+    <modify-function signature="lastIndexOf(const char*,int)const" remove="all"/>
+<!-- qtd
+    <modify-function signature="prepend(QByteArray)">
+        <access modifier="private"/>
+        <rename to="prepend_private"/>
+    </modify-function>
+    <inject-code>
+        <insert-template name="core.unary_self_type">
+            <replace from="%TYPE" to="QByteArray"/>
+            <replace from="%FUNCTION_NAME" to="prepend"/>
+        </insert-template>
+    </inject-code>
+
+    <modify-function signature="prepend(char)">
+        <access modifier="private"/>
+        <rename to="prepend_private"/>
+    </modify-function>
+    <inject-code>
+        <insert-template name="core.unary_other_type">
+            <replace from="%OUT_TYPE" to="QByteArray"/>
+            <replace from="%IN_TYPE" to="byte"/>
+            <replace from="%FUNCTION_NAME" to="prepend"/>
+        </insert-template>
+    </inject-code>
+-->
+    <modify-function signature="prepend(const char*)">
+        <remove/>
+    </modify-function>
+
+<!-- qtd
+    <modify-function signature="remove(int,int)">
+        <access modifier="private"/>
+        <rename to="remove_private"/>
+    </modify-function>
+    <inject-code>
+        <insert-template name="core.private_function_return_self">
+            <replace from="%RETURN_TYPE" to="QByteArray"/>
+            <replace from="%FUNCTION_NAME" to="remove"/>
+            <replace from="%ARGUMENTS" to="int pos, int len"/>
+            <replace from="%ARGUMENT_NAMES" to="pos, len"/>
+        </insert-template>
+    </inject-code>
+-->
+    <modify-function signature="replace(QByteArray,const char*)">
+        <remove/>
+    </modify-function>
+
+
+    <template name="core.qbytearray_replace">
+        <insert-template name="core.private_function_return_self">
+            <replace from="%RETURN_TYPE" to="QByteArray"/>
+            <replace from="%FUNCTION_NAME" to="replace"/>
+            <replace from="%ARGUMENTS" to="%BEFORE_TYPE before, %AFTER_TYPE after"/>
+            <replace from="%ARGUMENT_NAMES" to="before, after"/>
+        </insert-template>
+    </template>
+<!-- qtd
+    <modify-function signature="replace(char,QByteArray)">
+        <access modifier="private"/>
+        <rename to="replace_private"/>
+    </modify-function>
+    <inject-code>
+        <insert-template name="core.qbytearray_replace">
+            <replace from="%BEFORE_TYPE" to="byte"/>
+            <replace from="%AFTER_TYPE" to="QByteArray"/>
+        </insert-template>
+    </inject-code>
+-->
+    <modify-function signature="replace(QString,const char*)">
+        <remove/>
+    </modify-function>
+
+
+    <modify-function signature="replace(int,int,const char*)">
+        <remove/>
+    </modify-function>
+
+    <modify-function signature="replace(const char*,const char*)">
+        <remove/>
+    </modify-function>
+
+    <modify-function signature="replace(const char*,QByteArray)">
+        <remove/>
+    </modify-function>
+<!-- qtd
+    <modify-function signature="replace(int,int,QByteArray)">
+        <access modifier="private"/>
+        <rename to="replace_private"/>
+    </modify-function>
+    <inject-code>
+        <insert-template name="core.private_function_return_self">
+            <replace from="%RETURN_TYPE" to="QByteArray"/>
+            <replace from="%FUNCTION_NAME" to="replace"/>
+            <replace from="%ARGUMENTS" to="int pos, int len, QByteArray after"/>
+            <replace from="%ARGUMENT_NAMES" to="pos, len, after"/>
+        </insert-template>
+    </inject-code>
+-->
+    <modify-function signature="replace(char,const char*)">
+        <remove/>
+    </modify-function>
+<!-- qtd
+    <modify-function signature="replace(char,QString)">
+        <access modifier="private"/>
+        <rename to="replace_private"/>
+    </modify-function>
+    <inject-code>
+        <insert-template name="core.qbytearray_replace">
+            <replace from="%BEFORE_TYPE" to="byte"/>
+            <replace from="%AFTER_TYPE" to="String"/>
+        </insert-template>
+    </inject-code>
+
+    <modify-function signature="replace(char,char)">
+        <access modifier="private"/>
+        <rename to="replace_private"/>
+    </modify-function>
+    <inject-code>
+        <insert-template name="core.qbytearray_replace">
+            <replace from="%BEFORE_TYPE" to="byte"/>
+            <replace from="%AFTER_TYPE" to="byte"/>
+        </insert-template>
+    </inject-code>
+
+    <modify-function signature="replace(QByteArray,QByteArray)">
+        <access modifier="private"/>
+        <rename to="replace_private"/>
+    </modify-function>
+    <inject-code>
+        <insert-template name="core.qbytearray_replace">
+            <replace from="%BEFORE_TYPE" to="QByteArray"/>
+            <replace from="%AFTER_TYPE" to="QByteArray"/>
+        </insert-template>
+    </inject-code>
+
+    <modify-function signature="replace(QString,QByteArray)">
+        <access modifier="private"/>
+        <rename to="replace_private"/>
+    </modify-function>
+    <inject-code>
+        <insert-template name="core.qbytearray_replace">
+            <replace from="%BEFORE_TYPE" to="String"/>
+            <replace from="%AFTER_TYPE" to="QByteArray"/>
+        </insert-template>
+    </inject-code>
+
+    <modify-function signature="setNum(int,int)">
+        <access modifier="private"/>
+        <rename to="setNum_private"/>
+        <modify-argument index="2">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+-->
+    <template name="core.qbytearray_setNum_integer">
+        <insert-template name="core.private_function_return_self">
+            <replace from="%RETURN_TYPE" to="QByteArray"/>
+            <replace from="%FUNCTION_NAME" to="setNum"/>
+            <replace from="%ARGUMENTS" to="%INTEGER_TYPE n, int base"/>
+            <replace from="%ARGUMENT_NAMES" to="n, base"/>
+        </insert-template>
+
+        public QByteArray setNum(%INTEGER_TYPE n) {
+            return setNum(n, 10);
+        }
+    </template>
+    <template name="core.qbytearray_setNum_float">
+        <insert-template name="core.private_function_return_self">
+            <replace from="%RETURN_TYPE" to="QByteArray"/>
+            <replace from="%FUNCTION_NAME" to="setNum"/>
+            <replace from="%ARGUMENTS" to="%FLOAT_TYPE n, char f, int prec"/>
+            <replace from="%ARGUMENT_NAMES" to="n, (byte) f, prec"/>
+        </insert-template>
+
+        public final QByteArray setNum(%FLOAT_TYPE n, char f) {
+            return setNum(n, f, 6);
+        }
+
+        public final QByteArray setNum(%FLOAT_TYPE n) {
+            return setNum(n, 'g');
+        }
+    </template>
+<!-- qtd
+    <inject-code>
+        <insert-template name="core.qbytearray_setNum_integer">
+            <replace from="%INTEGER_TYPE" to="int"/>
+        </insert-template>
+    </inject-code>
+
+    <inject-code>
+        <insert-template name="core.qbytearray_setNum_integer">
+            <replace from="%INTEGER_TYPE" to="char"/>
+        </insert-template>
+    </inject-code>
+
+
+    <modify-function signature="setNum(float,char,int)">
+        <access modifier="private"/>
+        <rename to="setNum_private"/>
+        <modify-argument index="2">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="3">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+    <inject-code>
+        <insert-template name="core.qbytearray_setNum_float">
+            <replace from="%FLOAT_TYPE" to="float"/>
+        </insert-template>
+    </inject-code>
+
+    <modify-function signature="setNum(long long,int)">
+        <access modifier="private"/>
+        <rename to="setNum_private"/>
+        <modify-argument index="2">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+    <inject-code>
+        <insert-template name="core.qbytearray_setNum_integer">
+            <replace from="%INTEGER_TYPE" to="long"/>
+        </insert-template>
+    </inject-code>
+
+    <modify-function signature="setNum(double,char,int)">
+        <access modifier="private"/>
+        <rename to="setNum_private"/>
+        <modify-argument index="2">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="3">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+    <inject-code>
+        <insert-template name="core.qbytearray_setNum_float">
+            <replace from="%FLOAT_TYPE" to="double"/>
+        </insert-template>
+    </inject-code>
+
+    <modify-function signature="setNum(short,int)">
+        <access modifier="private"/>
+        <rename to="setNum_private"/>
+        <modify-argument index="2">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+    <inject-code>
+    <insert-template name="core.qbytearray_setNum_integer">
+            <replace from="%INTEGER_TYPE" to="short"/>
+        </insert-template>
+    </inject-code>
+-->
+    <modify-function signature="startsWith(const char*)const">
+        <remove/>
+    </modify-function>
+
+
+    <modify-function signature="fromRawData(const char*,int)">
+        <remove/>
+    </modify-function>
+
+    </value-type>
+
+  <value-type name="QTextBoundaryFinder">
+    <modify-function signature="QTextBoundaryFinder(QTextBoundaryFinder::BoundaryType,const QChar*,int,unsigned char*,int)" remove="all"/>
+    <modify-function signature="operator=(QTextBoundaryFinder)" remove="all"/>
+  </value-type>
+
+  <object-type name="QXmlStreamEntityResolver"/>
+  <object-type name="QAbstractEventDispatcher"/>
+  <object-type name="QEventLoop"/>
+  <object-type name="QFile">
+    <modify-function signature="readLink()const" remove="all"/> <!--### Obsolete in 4.3-->
+    <modify-function signature="readLink(QString)" remove="all"/> <!--### Obsolete in 4.3-->
+    <modify-function signature="map(long long,long long,QFile::MemoryMapFlags)" remove="all"/> <!-- Can't provide same API and performance -->
+    <modify-function signature="unmap(unsigned char*)" remove="all"/> <!-- Can't provide same API and performance -->
+  
+        <inject-code>
+            <import-file name="typesystem_core-java.java" quote-after-line="class QFile___" quote-before-line="}// class"/>
+        </inject-code>
+        <modify-function signature="decodeName(const char*)">
+            <access modifier="private"/>
+        </modify-function>
+
+    </object-type>
+
+  <object-type name="QIODevice">
+        <inject-code>
+            <import-file name="typesystem_core-java.java" quote-after-line="class QIODevice___" quote-before-line="}// class"/>
+        </inject-code>
+
+        <modify-function signature="putChar(char)" rename="putByte"/>
+        <modify-function signature="ungetChar(char)" rename="ungetByte"/>
+        <modify-function signature="getChar(char*)">
+            <access modifier="private"/>
+            <rename to="getByte"/>
+        </modify-function>
+
+<!--
+        <modify-function signature="peek(char*,long long)">
+            <access modifier="private"/>
+        </modify-function>
+        <inject-code>
+            <insert-template name="core.read_with_byte[]_instead_of_char*_and_int">
+                <replace from="%FUNCTION_NAME" to="peek"/>
+            </insert-template>
+        </inject-code>
+
+        <modify-function signature="read(char*,long long)">
+            <access modifier="private"/>
+        </modify-function>
+        <inject-code>
+            <insert-template name="core.read_with_byte[]_instead_of_char*_and_int">
+                <replace from="%FUNCTION_NAME" to="read"/>
+            </insert-template>
+        </inject-code>
+
+        <modify-function signature="readLine(char*,long long)">
+            <access modifier="private"/>
+        </modify-function>
+        <inject-code>
+            <insert-template name="core.read_with_byte[]_instead_of_char*_and_int">
+                <replace from="%FUNCTION_NAME" to="readLine"/>
+            </insert-template>
+        </inject-code>
+
+        <modify-function signature="write(const char*,long long)">
+            <access modifier="private"/>
+        </modify-function>
+        <inject-code>
+            <insert-template name="core.write_with_byte[]_instead_of_char*_and_int">
+                <replace from="%FUNCTION_NAME" to="write"/>
+            </insert-template>
+        </inject-code>
+-->
+        <template name="core.iodevice_convert_char*_to_byte[]">
+            <insert-template name="core.convert_primitive_array_to_java">
+                <replace from="%JNITYPE" to="jbyte"/>
+                <replace from="%JAVATYPE" to="Byte"/>
+            </insert-template>
+        </template>
+
+        <template name="core.iodevice_cleanup_to_java">
+            <insert-template name="core.cleanup_convert_primitive_array_to_java">
+                <replace from="%JNITYPE" to="jbyte"/>
+                <replace from="%JAVATYPE" to="Byte"/>
+            </insert-template>
+        </template>
+
+
+        <template name="core.iodevice_cleanup">
+            jint %out = (jint) %in;
+            <insert-template name="core.cleanup_convert_primitive_array_from_java">
+                <replace from="%JAVATYPE" to="Byte"/>
+                <replace from="%JNITYPE" to="jbyte"/>
+            </insert-template>
+
+        </template>
+
+        <template name="core.iodevice_convert_byte[]_to_char*">
+            <insert-template name="core.convert_primitive_array_from_java">
+                <replace from="%CTYPE" to="char"/>
+                <replace from="%JAVATYPE" to="Byte"/>
+                <replace from="%JNITYPE" to="jbyte"/>
+            </insert-template>
+        </template>
+<!--
+        <modify-function signature="readData(char*,long long)">
+            <modify-argument index="0">
+                <replace-type modified-type="int"/>
+                <conversion-rule class="native">
+                    <insert-template name="core.iodevice_cleanup"/>
+                </conversion-rule>
+                <conversion-rule class="shell">
+                    qint64 %out = %in;
+                    <insert-template name="core.iodevice_cleanup_to_java">
+                        <replace from="%len" to="(int) %in"/>
+                    </insert-template>
+                </conversion-rule>
+            </modify-argument>
+
+            <modify-argument index="1">
+                <replace-type modified-type="byte[]"/>
+                <conversion-rule class="shell">
+                    <insert-template name="core.iodevice_convert_char*_to_byte[]">
+                        <replace from="%len" to="%2"/>
+                    </insert-template>
+                </conversion-rule>
+                <conversion-rule class="native">
+                    <insert-template name="core.iodevice_convert_byte[]_to_char*"/>
+                </conversion-rule>
+            </modify-argument>
+
+            <modify-argument index="2">
+                <remove-argument/>
+                <conversion-rule class="shell">
+                    // nothing
+                </conversion-rule>
+                <conversion-rule class="native">
+                <insert-template name="core.get_array_length">
+                    <replace from="%ARRAY" to="%1"/>
+                </insert-template>
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="writeData(const char*,long long)">
+            <modify-argument index="1">
+                <replace-type modified-type="byte[]"/>
+                <conversion-rule class="shell">
+                    <insert-template name="core.iodevice_convert_char*_to_byte[]">
+                        <replace from="%len" to="%2"/>
+                    </insert-template>
+                </conversion-rule>
+                <conversion-rule class="native">
+                    <insert-template name="core.iodevice_convert_byte[]_to_char*"/>
+                </conversion-rule>
+            </modify-argument>
+
+            <modify-argument index="2">
+                <remove-argument/>
+                <conversion-rule class="shell">
+                    // nothing
+                </conversion-rule>
+                <conversion-rule class="native">
+                    <insert-template name="core.get_array_length">
+                        <replace from="%ARRAY" to="%1"/>
+                    </insert-template>
+                </conversion-rule>
+            </modify-argument>
+
+            <modify-argument index="0">
+                <replace-type modified-type="int"/>
+                <conversion-rule class="native">
+                    <insert-template name="core.iodevice_cleanup"/>
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="readLineData(char*,long long)">
+            <modify-argument index="1">
+                <replace-type modified-type="byte[]"/>
+                <conversion-rule class="shell">
+                    <insert-template name="core.iodevice_convert_char*_to_byte[]">
+                        <replace from="%len" to="%2"/>
+                    </insert-template>
+                </conversion-rule>
+                <conversion-rule class="native">
+                    <insert-template name="core.iodevice_convert_byte[]_to_char*"/>
+                </conversion-rule>
+            </modify-argument>
+
+            <modify-argument index="2">
+                <remove-argument/>
+                <conversion-rule class="shell">
+                    // nothing
+                </conversion-rule>
+                <conversion-rule class="native">
+                    <insert-template name="core.get_array_length">
+                        <replace from="%ARRAY" to="%1"/>
+                    </insert-template>
+                </conversion-rule>
+            </modify-argument>
+
+            <modify-argument index="0">
+                <replace-type modified-type="int"/>
+                <conversion-rule class="native">
+                    <insert-template name="core.iodevice_cleanup"/>
+                </conversion-rule>
+                <conversion-rule class="shell">
+                    qint64 %out = %in;
+                    <insert-template name="core.iodevice_cleanup_to_java">
+                        <replace from="%len" to="(int) %in"/>
+                    </insert-template>
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+		-->
+    </object-type>
+
+  <value-type name="QLine"/>
+  <value-type name="QLineF">
+        <inject-code>
+            <import-file name="typesystem_core-java.java" quote-after-line="class QLineF___" quote-before-line="}// class"/>
+        </inject-code>
+        <modify-function signature="intersect(QLineF,QPointF*)const  ">
+            <access modifier="private"/>
+        </modify-function>
+
+    </value-type>
+
+  <object-type name="QCryptographicHash">
+        <inject-code>
+            <import-file name="typesystem_core-java.java" quote-after-line="class QCryptographicHash___" quote-before-line="}// class"/>
+        </inject-code>
+        <modify-function signature="addData(const char*,int)">
+            <access modifier="private"/>
+        </modify-function>
+
+    </object-type>
+  <object-type name="QLibraryInfo"/>
+  <object-type name="QMutex"/>
+  <object-type name="QSemaphore"/>
+  <object-type name="QSocketNotifier"/>
+  <object-type name="QSystemLocale"/>
+  <object-type name="QTemporaryFile">
+    <modify-function signature="fileName()const" rename="uniqueFilename"/>
+  </object-type>
+  <object-type name="QMimeData">
+    <extra-includes>
+        <include file-name="QStringList" location="global"/>
+        <include file-name="QUrl" location="global"/>
+    </extra-includes>
+  </object-type>
+  <object-type name="QTextCodec">
+
+    <modify-function signature="setCodecForTr(QTextCodec*)">
+        <access modifier="private"/>
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcCodecForTr"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setCodecForCStrings(QTextCodec*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcCodecForCStrings"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setCodecForLocale(QTextCodec*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcCodecForLocale"/>
+        </modify-argument>
+    </modify-function>
+
+
+    <modify-function signature="codecForTr()">
+        <remove/>
+    </modify-function>
+
+    <modify-function signature="QTextCodec()">
+        <modify-argument index="-1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="fromUnicode(const QChar*,int,QTextCodec::ConverterState*)const">
+        <remove/>
+    </modify-function>
+
+    <modify-function signature="toUnicode(const char*,int,QTextCodec::ConverterState*)const">
+        <remove/>
+    </modify-function>
+
+    <modify-function signature="toUnicode(const char*)const">
+        <remove/>
+    </modify-function>
+  
+        <inject-code>
+            <import-file name="typesystem_core-java.java" quote-after-line="class QTextCodec___" quote-before-line="}// class"/>
+        </inject-code>
+
+        <modify-function signature="convertFromUnicode(const QChar*,int,QTextCodec::ConverterState*)const">
+            <modify-argument index="3" invalidate-after-use="yes"/>
+            <modify-argument index="1">
+                <replace-type modified-type="string"/>
+                <conversion-rule class="shell">
+                    // Convert directly QChar * -&gt; ushort *
+                    <insert-template name="core.convert_primitive_array_to_java">
+                        <replace from="%JNITYPE" to="jchar"/>
+                        <replace from="%JAVATYPE" to="Char"/>
+                        <replace from="%len" to="%2"/>
+                    </insert-template>
+                </conversion-rule>
+                <conversion-rule class="native">
+                    // Convert directly ushort * -&gt; QChar *
+                    <insert-template name="core.convert_primitive_array_from_java">
+                        <replace from="%CTYPE" to="ushort"/>
+                        <replace from="%JAVATYPE" to="Char"/>
+                        <replace from="%JNITYPE" to="jchar"/>
+                    </insert-template>
+                </conversion-rule>
+            </modify-argument>
+
+            <modify-argument index="0">
+                <conversion-rule class="native">
+                    jobject %out = qtjambi_from_object(__jni_env, &amp;%in, "QByteArray", "com/trolltech/qt/core/", true);
+                    <insert-template name="core.cleanup_convert_primitive_array_from_java">
+                        <replace from="%JNITYPE" to="jchar"/>
+                        <replace from="%JAVATYPE" to="Char"/>
+                    </insert-template>
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="convertToUnicode(const char*,int,QTextCodec::ConverterState*)const">
+            <modify-argument index="3" invalidate-after-use="yes"/>
+            <modify-argument index="1">
+                <replace-type modified-type="byte[]"/>
+                <conversion-rule class="shell">
+                    <insert-template name="core.convert_primitive_array_to_java">
+                        <replace from="%JNITYPE" to="jbyte"/>
+                        <replace from="%JAVATYPE" to="Byte"/>
+                        <replace from="%len" to="%2"/>
+                    </insert-template>
+                </conversion-rule>
+                <conversion-rule class="native">
+                    <insert-template name="core.convert_primitive_array_from_java">
+                        <replace from="%CTYPE" to="char"/>
+                        <replace from="%JAVATYPE" to="Byte"/>
+                        <replace from="%JNITYPE" to="jbyte"/>
+                    </insert-template>
+                </conversion-rule>
+            </modify-argument>
+
+            <modify-argument index="0">
+                <conversion-rule class="native">
+                    jstring %out = qtjambi_from_qstring(__jni_env, %in);
+                    <insert-template name="core.cleanup_convert_primitive_array_from_java">
+                        <replace from="%JNITYPE" to="jbyte"/>
+                        <replace from="%JAVATYPE" to="Byte"/>
+                    </insert-template>
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="codecForName(const char*)  ">
+            <access modifier="private"/>
+        </modify-function>
+
+    </object-type>
+
+  <object-type name="QTextDecoder">
+    <modify-function signature="toUnicode(const char*,int)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="toUnicode(QString*,const char*,int)" remove="all"/>
+  </object-type>
+  <object-type name="QTextEncoder">
+    <modify-function signature="fromUnicode(const QChar*,int)">
+        <remove/>
+    </modify-function>
+  </object-type>
+  <object-type name="QTimeLine"/>
+  <object-type name="QTranslator">
+    <modify-function signature="translate(const char*,const char*,const char*,int)const">
+        <remove/>
+    </modify-function>
+  
+        <extra-includes>
+            <include file-name="QTextCodec" location="global"/>
+         </extra-includes>
+        <modify-function signature="load(const unsigned char*,int)">
+            <access modifier="private"/>
+        </modify-function>
+        <inject-code>
+            <import-file name="typesystem_core-java.java" quote-after-line="class QTranslator___" quote-before-line="}// class"/>
+        </inject-code>
+
+        <modify-function signature="translate(const char*,const char*,const char*)const">
+            <modify-argument index="1">
+                <replace-type modified-type="string"/>
+                <conversion-rule class="shell">
+        QTextCodec *codec = QTextCodec::codecForName("UTF-8");
+        QByteArray b1;
+        if (%in != 0)
+            b1 = codec-&gt;fromUnicode(%in);
+
+        jobject %out = qtjambi_from_qstring(__jni_env, QString(b1));
+                </conversion-rule>
+
+                <conversion-rule class="native">
+        const char* %out = %in;
+                </conversion-rule>
+            </modify-argument>
+            <modify-argument index="2">
+                <replace-type modified-type="string"/>
+                <conversion-rule class="shell">
+        QByteArray b2;
+        if (%in != 0)
+            b2 = codec-&gt;fromUnicode(%in);
+
+        jobject %out = qtjambi_from_qstring(__jni_env, QString(b2));
+                </conversion-rule>
+                <conversion-rule class="native">
+        const char* %out = %in;
+                </conversion-rule>
+
+            </modify-argument>
+            <modify-argument index="3">
+                <replace-type modified-type="string"/>
+                <conversion-rule class="shell">
+        QByteArray b3;
+        if (%in != 0)
+            b3 = codec-&gt;fromUnicode(%in);
+
+        jobject %out = qtjambi_from_qstring(__jni_env, QString(b3));
+                </conversion-rule>
+                <conversion-rule class="native">
+        const char* %out = %in;
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+    </object-type>
+
+  <object-type name="QWaitCondition">
+        <modify-function signature="wait(QMutex *, unsigned long)">
+            <modify-argument index="2">
+                <replace-default-expression with="0xffffffff"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="wait(QReadWriteLock *, unsigned long)">
+            <modify-argument index="2">
+                <replace-default-expression with="0xffffffff"/>
+            </modify-argument>
+        </modify-function>
+    </object-type>
+
+  <object-type name="QFileSystemWatcher">
+    <extra-includes>
+      <include file-name="QStringList" location="global"/>
+    </extra-includes>
+  </object-type>
+
+  <object-type name="QTextCodec::ConverterState">
+    <include file-name="QTextCodec" location="global"/>
+  </object-type>
+
+  <object-type name="QBuffer">
+    <modify-function signature="buffer()">
+        <remove/>
+    </modify-function>
+  
+        <inject-code>
+            <import-file name="typesystem_core-java.java" quote-after-line="class QBuffer___" quote-before-line="}// class"/>
+        </inject-code>
+        <extra-includes>
+            <include file-name="qt.QNativePointer" location="java"/>
+        </extra-includes>
+
+
+        <modify-function signature="QBuffer(QByteArray*,QObject*)">
+            <access modifier="private"/>
+            <modify-argument index="2">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+
+
+        <modify-function signature="setBuffer(QByteArray*)">
+            <access modifier="private"/>
+        </modify-function>
+
+
+        <modify-function signature="setData(const char*,int)">
+            <access modifier="private"/>
+        </modify-function>
+
+    </object-type>
+
+  <object-type name="QTimer">
+<!--        <inject-code class="java">
+            <import-file name="typesystem_core-java.java" quote-after-line="class QTimer___" quote-before-line="}// class"/>
+        </inject-code>-->
+    </object-type>
+
+  <object-type name="QAbstractFileEngineHandler">
+    <modify-function signature="create(const QString &amp;) const">
+        <modify-argument index="return">
+            <define-ownership owner="c++" class="shell"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+
+  <object-type name="QAbstractFileEngine::MapExtensionOption"/>
+  <object-type name="QAbstractFileEngine::MapExtensionReturn">
+    <modify-field name="address">
+        <access modifier="private"/>
+        <rename to="address_private"/>
+    </modify-field>
+    <inject-code>
+        <import-file name="typesystem_core-java.java" quote-after-line="class QAbstractFileEngine_MapExtensionReturn___" quote-before-line="}// class"/>
+    </inject-code>
+  </object-type>
+  <object-type name="QAbstractFileEngine::UnMapExtensionOption">
+    <modify-field name="address">
+        <access modifier="private"/>
+        <rename to="address_private"/>
+    </modify-field>
+    <inject-code>
+        <import-file name="typesystem_core-java.java" quote-after-line="class QAbstractFileEngine_UnMapExtensionOption___" quote-before-line="}// class"/>
+    </inject-code>
+  </object-type>
+  <object-type name="QAbstractFileEngine">
+    <extra-includes>
+        <include file-name="QDateTime" location="global"/>
+    </extra-includes>
+    <modify-function signature="map(long long,long long,QFile::MemoryMapFlags)" remove="all"/>
+    <modify-function signature="unmap(unsigned char*)" remove="all"/>
+  
+    <inject-code>
+        <import-file name="typesystem_core-java.java" quote-after-line="class QAbstractFileEngine___" quote-before-line="}// class"/>
+    </inject-code>
+  </object-type>
+
+  <object-type name="QProcess">
+    <modify-function signature="readChannelMode()const" remove="all"/> <!--### Obsolete in 4.3-->
+    <modify-function signature="setReadChannelMode(QProcess::ProcessChannelMode)" remove="all"/> <!--### Obsolete in 4.3-->
+  
+        <modify-function signature="finished(int, QProcess::ExitStatus)">
+            <rename to="finishedWithStatusCode"/>
+        </modify-function>
+        <modify-function signature="setStandardOutputProcess(QProcess*)">
+            <modify-argument index="1">
+                <reference-count action="set" variable-name="__rcStandardOutputProcess"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="startDetached(QString,QStringList&lt;QString&gt;,QString,long long*)">
+            <access modifier="private"/>
+            <modify-argument index="4">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+        <inject-code>
+             <import-file name="typesystem_core-java.java" quote-after-line="class QProcess___" quote-before-line="}// class"/>
+        </inject-code>
+  </object-type>
+
+  <object-type name="QSignalMapper">
+    <modify-function signature="mapped(const QString &amp;)">
+        <rename to="mappedString"/>
+    </modify-function>
+    <modify-function signature="mapped(int)">
+        <rename to="mappedInteger"/>
+    </modify-function>
+    <modify-function signature="mapped(QObject *)">
+        <rename to="mappedQObject"/>
+    </modify-function>
+    <modify-function signature="mapped(QWidget *)" remove="all"/>
+
+    <modify-function signature="mapping(QWidget*)const" remove="all"/>
+
+    <modify-function signature="setMapping(QObject*,QWidget*)" remove="all"/>
+  
+        <inject-code>
+            <import-file name="typesystem_core-java.java" quote-after-line="class QSignalMapper___" quote-before-line="}// class"/>
+        </inject-code>
+
+
+      <modify-function signature="removeMappings(QObject*)">
+          <modify-argument index="1">
+              <reference-count action="remove" variable-name="__rcMappings"/>
+          </modify-argument>
+          <inject-code class="java" position="end">
+              <argument-map index="1" meta-name="%1"/>
+            if (__rcObjectForObject.containsKey(%1)) __rcObjectForObject.remove(%1);
+            if (__rcWidgetForObject.containsKey(%1)) __rcWidgetForObject.remove(%1);
+          </inject-code>
+      </modify-function>
+
+      <modify-function signature="setMapping(QObject*,QObject*)">
+          <modify-argument index="1">
+              <reference-count action="add" variable-name="__rcMappings"/>
+          </modify-argument>
+          <inject-code class="java" position="end">
+              <argument-map index="1" meta-name="%1"/>
+              <argument-map index="2" meta-name="%2"/>
+              if (%2 == null)
+                __rcObjectForObject.remove(%1);
+              else
+                __rcObjectForObject.put(%1,%2);
+          </inject-code>
+      </modify-function>
+
+      <modify-function signature="setMapping(QObject*,QString)">
+          <modify-argument index="1">
+              <reference-count action="add" variable-name="__rcMappings"/>
+          </modify-argument>
+      </modify-function>
+
+      <modify-function signature="setMapping(QObject*,int)">
+          <modify-argument index="1">
+              <reference-count action="add" variable-name="__rcMappings"/>
+          </modify-argument>
+      </modify-function>
+  </object-type>
+
+  <object-type name="QObject">
+    <modify-function signature="childEvent(QChildEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="customEvent(QEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="event(QEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="eventFilter(QObject*,QEvent*)">
+        <modify-argument index="2" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="timerEvent(QTimerEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+
+    <modify-function signature="installEventFilter(QObject*)">
+        <modify-argument index="1">
+            <reference-count action="add" variable-name="__rcEventFilters"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="removeEventFilter(QObject*)">
+        <modify-argument index="1">
+            <reference-count action="remove" variable-name="__rcEventFilters"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setParent(QObject*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+        <inject-code class="java" position="beginning">
+            <argument-map index="1" meta-name="%1"/>
+            if (%1 is null &amp;&amp; !__gc_managed) {
+                remove(__gc_ref_list, this);
+                __gc_managed = true;
+            } else if (%1 !is null &amp;&amp; __gc_managed) {
+                __gc_ref_list ~= this;
+                __gc_managed = false;
+            }
+        </inject-code>
+    </modify-function>
+
+    <modify-function signature="deleteLater()">
+        <rename to="disposeLater"/>
+    </modify-function>
+
+    <modify-function signature="inherits(const char*)const">
+        <remove/>
+    </modify-function>
+
+    <modify-function signature="property(const char*)const">
+        <access modifier="private"/>
+    </modify-function>
+
+    <modify-function signature="setProperty(const char*,QVariant)">
+        <access modifier="private"/>
+    </modify-function>
+
+
+    <extra-includes>
+        <include file-name="QVarLengthArray" location="global"/>
+    </extra-includes>
+
+  
+      <inject-code class="java">
+          <import-file name="typesystem_core-java.java" quote-after-line="class QObject___" quote-before-line="}// class"/>
+      </inject-code>
+  </object-type>
+
+  <object-type name="QCoreApplication">
+    <extra-includes>
+        <include file-name="QStringList" location="global"/>
+    </extra-includes>
+
+    <extra-includes>
+        <include file-name="qt.qtd.Str" location="java"/>
+    </extra-includes>
+
+    <modify-function signature="argv()" remove="all"/> <!-- Obsolete -->
+    <modify-function signature="argc()" remove="all"/> <!-- Obsolete -->
+
+    <modify-function signature="notify(QObject*,QEvent*)">
+        <modify-argument index="2" invalidate-after-use="yes"/>
+    </modify-function>
+
+
+    <modify-function signature="QCoreApplication(int &amp;, char  **)">
+      <access modifier="private"/>
+    </modify-function>
+    <modify-function signature="removePostedEvents(QObject*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="removePostedEvents(QObject*,int)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="installTranslator(QTranslator *)">
+        <modify-argument index="1">
+            <reference-count action="add" variable-name="__rcTranslators"/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="removeTranslator(QTranslator *)">
+        <modify-argument index="1">
+            <reference-count action="remove" variable-name="__rcTranslators"/>
+        </modify-argument>
+    </modify-function>
+
+
+    <modify-function signature="postEvent(QObject*,QEvent*)">
+        <modify-argument index="2">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+  
+      <modify-function signature="QCoreApplication(int &amp;, char  **)">
+          <inject-code class="shell">
+              // qtjambi_register_variant_handler();
+          </inject-code>
+      </modify-function>
+      <modify-function signature="translate(const char*,const char*,const char*,QCoreApplication::Encoding)">
+          <access modifier="private"/>
+          <modify-argument index="3">
+              <remove-default-expression/>
+          </modify-argument>
+          <modify-argument index="4">
+              <remove-default-expression/>
+          </modify-argument>
+      </modify-function>
+      <inject-code>
+          <import-file name="typesystem_core-java.java" quote-after-line="class QCoreApplication___" quote-before-line="}// class"/>
+      </inject-code>
+
+      <modify-function signature="translate(const char*,const char*,const char*,QCoreApplication::Encoding,int)">
+          <access modifier="private"/>
+      </modify-function>
+  </object-type>
+
+  <object-type name="QSettings">
+    <extra-includes>
+        <include file-name="QStringList" location="global"/>
+    </extra-includes>
+
+    <modify-function signature="setSystemIniPath(const QString&amp;)" remove="all"/> <!--### Obsolete in 4.3-->
+    <modify-function signature="setUserIniPath(const QString&amp;)" remove="all"/> <!--### Obsolete in 4.3-->
+  </object-type>
+
+  <object-type name="QEvent" polymorphic-base="yes" polymorphic-id-expression="%1-&gt;type() == QEvent::None"/>
+  <object-type name="QChildEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::ChildAdded || %1-&gt;type() == QEvent::ChildPolished || %1-&gt;type() == QEvent::ChildRemoved">
+    <modify-field name="c" read="false" write="false"/>
+  </object-type>
+  <object-type name="QTimerEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Timer"/>
+
+  <object-type name="QDynamicPropertyChangeEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::DynamicPropertyChange"/>
+
+  <object-type name="QDataStream">
+  <!-- qtd2 -->
+  <modify-function signature="device() const" remove="all"/>
+  
+    <modify-function signature="setDevice(QIODevice*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcDevice"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="unsetDevice()">
+        <inject-code position="end">
+            __rcDevice = null;
+        </inject-code>
+    </modify-function>
+    <modify-function signature="version() const">
+        <rename to="version_"/>
+    </modify-function>
+
+    <modify-function signature="operator&lt;&lt;(const char*)"> <remove/> </modify-function>
+    <modify-function signature="operator&lt;&lt;(unsigned char)"> <remove/> </modify-function>
+    <modify-function signature="operator&lt;&lt;(unsigned int)"> <remove/> </modify-function>
+    <modify-function signature="operator&lt;&lt;(unsigned long long)"> <remove/> </modify-function>
+    <modify-function signature="operator&lt;&lt;(unsigned short)"> <remove/> </modify-function>
+
+    <modify-function signature="operator&gt;&gt;(char &amp;*)"> <remove/> </modify-function>
+    <modify-function signature="operator&gt;&gt;(uint&amp;)"> <remove/> </modify-function>
+    <modify-function signature="operator&gt;&gt;(unsigned char&amp;)"> <remove/> </modify-function>
+    <modify-function signature="operator&gt;&gt;(unsigned long long&amp;)"> <remove/> </modify-function>
+
+    <modify-function signature="readRawData(char*,int)"> <remove/> </modify-function>
+    <modify-function signature="readBytes(char&amp;*,uint&amp;)"> <remove/> </modify-function>
+    <modify-function signature="writeRawData(const char*,int)"> <remove/> </modify-function>
+    <modify-function signature="writeBytes(const char*,uint)"> <remove/> </modify-function>
+  
+      <template name="core.datastream_operator_shift_right">
+          <insert-template name="core.stream_operator_shift_right">
+              <replace from="%STREAM_TYPE" to="QDataStream"/>
+          </insert-template>
+      </template>
+
+      <template name="core.datastream_operator_shift_right_primitive">
+          <insert-template name="core.datastream_operator_shift_right">
+              <replace from="%VALUE_FUNCTION" to="%TYPEValue"/>
+          </insert-template>
+      </template>
+
+      <modify-function signature="operator&lt;&lt;(bool)">
+          <rename to="writeBoolean"/>
+          <modify-argument index="0" replace-value="this"/>
+      </modify-function>
+      <modify-function signature="operator&lt;&lt;(signed char)">
+          <rename to="writeByte"/>
+          <modify-argument index="0" replace-value="this"/>
+      </modify-function>
+      <modify-function signature="operator&lt;&lt;(int)">
+          <rename to="writeInt"/>
+          <modify-argument index="0" replace-value="this"/>
+      </modify-function>
+      <modify-function signature="operator&lt;&lt;(long long)">
+          <rename to="writeLong"/>
+          <modify-argument index="0" replace-value="this"/>
+      </modify-function>
+      <modify-function signature="operator&lt;&lt;(float)">
+          <rename to="writeFloat"/>
+          <modify-argument index="0" replace-value="this"/>
+      </modify-function>
+      <modify-function signature="operator&lt;&lt;(double)">
+          <rename to="writeDouble"/>
+          <modify-argument index="0" replace-value="this"/>
+      </modify-function>
+      <modify-function signature="operator&lt;&lt;(short)">
+          <rename to="writeShort_char"/>
+          <access modifier="private"/>
+          <modify-argument index="0" replace-value="this"/>
+      </modify-function>
+
+      <modify-function signature="operator&gt;&gt;(int&amp;)">
+          <rename to="operator_shift_right_int"/>
+          <modify-argument index="0" replace-value="this"/>
+          <access modifier="private"/>
+      </modify-function>
+
+      <modify-function signature="operator&gt;&gt;(bool&amp;)">
+          <rename to="operator_shift_right_boolean"/>
+          <modify-argument index="0" replace-value="this"/>
+          <access modifier="private"/>
+      </modify-function>
+
+      <modify-function signature="operator&gt;&gt;(short&amp;)">
+          <rename to="operator_shift_right_short"/>
+          <modify-argument index="0" replace-value="this"/>
+          <access modifier="private"/>
+      </modify-function>
+
+      <modify-function signature="operator&gt;&gt;(long long&amp;)">
+          <rename to="operator_shift_right_long"/>
+          <modify-argument index="0" replace-value="this"/>
+          <access modifier="private"/>
+      </modify-function>
+
+      <modify-function signature="operator&gt;&gt;(signed char&amp;)">
+          <rename to="operator_shift_right_byte"/>
+          <modify-argument index="0" replace-value="this"/>
+          <access modifier="private"/>
+      </modify-function>
+
+      <modify-function signature="operator&gt;&gt;(unsigned short&amp;)">
+          <rename to="operator_shift_right_char"/>
+          <modify-argument index="0" replace-value="this"/>
+          <access modifier="private"/>
+      </modify-function>
+
+      <modify-function signature="operator&gt;&gt;(float&amp;)">
+          <rename to="operator_shift_right_float"/>
+          <modify-argument index="0" replace-value="this"/>
+          <access modifier="private"/>
+      </modify-function>
+
+      <modify-function signature="operator&gt;&gt;(double&amp;)">
+          <rename to="operator_shift_right_double"/>
+          <modify-argument index="0" replace-value="this"/>
+          <access modifier="private"/>
+      </modify-function>
+
+      <inject-code>
+          <import-file name="typesystem_core-java.java" quote-after-line="class QDataStream___" quote-before-line="}// class"/>
+      </inject-code>
+
+      <inject-code class="native">
+/*        extern "C" jstring qtd_QDataStream_readString_private
+        (void* __this_nativeId)
+        {
+            QTJAMBI_DEBUG_TRACE("(native) entering: QDataStream::%FUNCTION_NAME%_native");
+            QDataStream *qtStream = (QDataStream *) qtjambi_from_jlong(stream);
+
+            jstring returned = 0;
+            if (qtStream != 0) {
+                QString qtString;
+                operator&gt;&gt;(*qtStream, qtString);
+
+                returned = qtjambi_from_qstring(env, qtString);
+            }
+
+            return returned;
+        }
+
+        extern "C" JNIEXPORT void JNICALL QTJAMBI_FUNCTION_PREFIX(Java_com_trolltech_qt_core_QDataStream_writeString_1private)
+        (JNIEnv *env, jobject, jlong stream, jstring string)
+        {
+            QTJAMBI_DEBUG_TRACE("(native) entering: QDataStream::%FUNCTION_NAME%_native");
+            QDataStream *qtStream = (QDataStream *) qtjambi_from_jlong(stream);
+
+            if (qtStream != 0) {
+                QString qtString = qtjambi_to_qstring(env, string);
+                operator&lt;&lt;(*qtStream, qtString);
+            }
+        }
+*/
+      </inject-code>
+
+      <template name="core.stream_constructor_bytearray">
+/*        // Hold reference to byte array which goes away when the stream dies
+        private QByteArray byteArray = null;
+        public %CLASSNAME(QByteArray a, QIODevice.OpenMode mode) {
+            this(a.nativePointer(), mode);
+            byteArray = a;
+        }
+
+        public %CLASSNAME(QByteArray a, QIODevice.OpenModeFlag ... mode) {
+            this(a.nativePointer(), mode);
+            byteArray = a;
+        } */
+      </template>
+
+      <modify-function signature="QDataStream(QByteArray*,QFlags&lt;QIODevice::OpenModeFlag&gt;)">
+          <access modifier="private"/>
+      </modify-function>
+      <inject-code>
+          <insert-template name="core.stream_constructor_bytearray">
+              <replace from="%CLASSNAME" to="QDataStream"/>
+          </insert-template>
+      </inject-code>
+
+      <template name="core.qdatastream_readorwrite_bytes">
+        extern "C" JNIEXPORT jint JNICALL QTJAMBI_FUNCTION_PREFIX(Java_com_trolltech_qt_core_QDataStream_%FUNCTION_NAME%)
+        (JNIEnv *env, jobject, jlong stream, jbyteArray array, jint length)
+        {
+            QTJAMBI_DEBUG_TRACE("(native) entering: QDataStream::%FUNCTION_NAME%");
+            char *rawBuffer = (char *) env-&gt;GetByteArrayElements(array, 0);
+
+            QDataStream *qtStream = (QDataStream *) qtjambi_from_jlong(stream);
+            int count = qtStream-&gt;%QT_FUNCTION_NAME%(rawBuffer, length);
+
+            env-&gt;ReleaseByteArrayElements(array, (jbyte *) rawBuffer, 0);
+            QTJAMBI_DEBUG_TRACE("(native) -&gt; leaving: QDataStream::%FUNCTION_NAME%");
+            return qMin(count, (int) length);
+        }
+      </template>
+<!--
+      <inject-code class="native">
+          <insert-template name="core.qdatastream_readorwrite_bytes">
+              <replace from="%FUNCTION_NAME%" to="readBytes"/>
+              <replace from="%QT_FUNCTION_NAME%" to="readRawData"/>
+          </insert-template>
+          <insert-template name="core.qdatastream_readorwrite_bytes">
+              <replace from="%FUNCTION_NAME%" to="writeBytes"/>
+              <replace from="%QT_FUNCTION_NAME%" to="writeRawData"/>
+          </insert-template>
+      </inject-code> -->
+  </object-type>
+
+  <object-type name="QFSFileEngine">
+    <extra-includes>
+           <include file-name="QDateTime" location="global"/>
+        </extra-includes>
+  </object-type>
+
+  <object-type name="QTextStream">
+  
+      <modify-function signature="setCodec(QTextCodec *)" remove="all"/>
+      <modify-function signature="codec() const" remove="all"/>
+  
+    <modify-function signature="QTextStream(QByteArray *, QFlags&lt;QIODevice::OpenModeFlag&gt;)"> <remove/> </modify-function>
+    <modify-function signature="QTextStream(QString*,QFlags&lt;QIODevice::OpenModeFlag&gt;)"> <remove/> </modify-function>
+    <modify-function signature="operator&gt;&gt;(QChar&amp;)"> <remove/> </modify-function>
+    <modify-function signature="operator&lt;&lt;(const void*)"> <remove/> </modify-function>
+    <modify-function signature="operator&lt;&lt;(unsigned int)"> <remove/> </modify-function>
+    <modify-function signature="operator&lt;&lt;(unsigned long long)"> <remove/> </modify-function>
+    <modify-function signature="operator&lt;&lt;(const QChar &amp;)"> <remove/> </modify-function>
+    <modify-function signature="operator&lt;&lt;(unsigned long)"> <remove/> </modify-function>
+    <modify-function signature="operator&lt;&lt;(signed long)"> <remove/> </modify-function>
+    <modify-function signature="operator&lt;&lt;(const char*)"> <remove/> </modify-function>
+    <modify-function signature="operator&lt;&lt;(unsigned short)"> <remove/> </modify-function>
+    <modify-function signature="operator&lt;&lt;(const QByteArray&amp;)"> <remove/> </modify-function>
+    <modify-function signature="operator&gt;&gt;(unsigned long long&amp;)"> <remove/> </modify-function>
+    <modify-function signature="operator&gt;&gt;(uint&amp;)"> <remove/> </modify-function>
+    <modify-function signature="operator&gt;&gt;(ulong&amp;)"> <remove/> </modify-function>
+    <modify-function signature="setString(QString*,QFlags&lt;QIODevice::OpenModeFlag&gt;)"> <remove/> </modify-function>
+    <modify-function signature="string()const"> <remove/> </modify-function>
+    <modify-function signature="operator&gt;&gt;(signed long&amp;)"> <remove/> </modify-function>
+    <modify-function signature="operator&gt;&gt;(char*)"> <remove/> </modify-function>
+    <modify-function signature="operator&gt;&gt;(QByteArray&amp;)"> <remove/> </modify-function>
+    <modify-function signature="operator&gt;&gt;(QString&amp;)"> <remove/> </modify-function>
+    <modify-function signature="operator&gt;&gt;(unsigned short&amp;)"> <remove/> </modify-function>
+    <modify-function signature="operator&lt;&lt;(const QString&amp;)"> <remove/> </modify-function>
+
+<!--
+    <modify-function signature="setCodec(QTextCodec *)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcCodec"/>
+        </modify-argument>
+    </modify-function>
+-->
+    <modify-function signature="QTextStream(QIODevice *)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcDevice"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setDevice(QIODevice *)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcDevice"/>
+        </modify-argument>
+    </modify-function>
+
+      <template name="core.textstream_operator_shift_right">
+          <insert-template name="core.stream_operator_shift_right">
+              <replace from="%STREAM_TYPE" to="QTextStream"/>
+          </insert-template>
+      </template>
+
+      <template name="core.textstream_operator_shift_right_primitive">
+          <insert-template name="core.textstream_operator_shift_right">
+              <replace from="%VALUE_FUNCTION" to="%TYPEValue"/>
+          </insert-template>
+      </template>
+
+      <modify-function signature="operator&lt;&lt;(QBool)">
+          <rename to="writeBoolean"/>
+          <modify-argument index="0" replace-value="this"/>
+      </modify-function>
+      <modify-function signature="operator&lt;&lt;(char)">
+          <modify-argument index="0" replace-value="this"/>
+          <rename to="writeByte"/>
+      </modify-function>
+      <modify-function signature="operator&lt;&lt;(signed int)">
+          <rename to="writeInt"/>
+          <modify-argument index="0" replace-value="this"/>
+      </modify-function>
+      <modify-function signature="operator&lt;&lt;(long long)">
+          <rename to="writeLong"/>
+          <modify-argument index="0" replace-value="this"/>
+      </modify-function>
+      <modify-function signature="operator&lt;&lt;(float)">
+          <rename to="writeFloat"/>
+          <modify-argument index="0" replace-value="this"/>
+      </modify-function>
+      <modify-function signature="operator&lt;&lt;(double)">
+          <rename to="writeDouble"/>
+          <modify-argument index="0" replace-value="this"/>
+      </modify-function>
+      <modify-function signature="operator&lt;&lt;(signed short)">
+          <rename to="writeShort_char"/>
+          <modify-argument index="0" replace-value="this"/>
+          <access modifier="private"/>
+      </modify-function>
+
+      <modify-function signature="operator&gt;&gt;(char&amp;)">
+          <access modifier="private"/>
+          <modify-argument index="0" replace-value="this"/>
+          <rename to="operator_shift_right_byte"/>
+      </modify-function>
+      <modify-function signature="operator&gt;&gt;(signed short&amp;)">
+          <access modifier="private"/>
+          <modify-argument index="0" replace-value="this"/>
+          <rename to="operator_shift_right_short"/>
+      </modify-function>
+      <modify-function signature="operator&gt;&gt;(signed int&amp;)">
+          <access modifier="private"/>
+          <modify-argument index="0" replace-value="this"/>
+          <rename to="operator_shift_right_int"/>
+      </modify-function>
+      <modify-function signature="operator&gt;&gt;(long long&amp;)">
+          <access modifier="private"/>
+          <modify-argument index="0" replace-value="this"/>
+          <rename to="operator_shift_right_long"/>
+      </modify-function>
+      <modify-function signature="operator&gt;&gt;(float&amp;)">
+          <access modifier="private"/>
+          <modify-argument index="0" replace-value="this"/>
+          <rename to="operator_shift_right_float"/>
+      </modify-function>
+      <modify-function signature="operator&gt;&gt;(double&amp;)">
+          <access modifier="private"/>
+          <modify-argument index="0" replace-value="this"/>
+          <rename to="operator_shift_right_double"/>
+      </modify-function>
+
+      <modify-function signature="setCodec(const char*)">
+          <access modifier="private"/>
+      </modify-function>
+      <inject-code>
+          <import-file name="typesystem_core-java.java" quote-after-line="class QTextStream___" quote-before-line="}// class"/>
+      </inject-code>
+<!--
+      <inject-code class="native">
+        extern "C" JNIEXPORT jstring JNICALL QTJAMBI_FUNCTION_PREFIX(Java_com_trolltech_qt_core_QTextStream_readString_1native)
+        (JNIEnv *env, jobject, jlong id)
+        {
+            QTJAMBI_DEBUG_TRACE("(native) entering: QTextStream::readString()");
+            QTextStream *stream = (QTextStream *) qtjambi_from_jlong(id);
+            QString str;
+            (*stream) &gt;&gt; str;
+            jstring s = qtjambi_from_qstring(env, str);
+            QTJAMBI_DEBUG_TRACE("(native) -&gt; leaving: QTextStream::readString()");
+            return s;
+        }
+
+        extern "C" JNIEXPORT void JNICALL QTJAMBI_FUNCTION_PREFIX(Java_com_trolltech_qt_core_QTextStream_writeString_1native)
+        (JNIEnv *env, jobject, jlong id, jstring str)
+        {
+            QTJAMBI_DEBUG_TRACE("(native) entering: QTextStream::writeString()");
+            QString qstr = qtjambi_to_qstring(env, str);
+            QTextStream *stream = (QTextStream *) qtjambi_from_jlong(id);
+            (*stream) &lt;&lt; qstr;
+            QTJAMBI_DEBUG_TRACE("(native) -&gt; leaving: QTextStream::readString()");
+        }
+      </inject-code>-->
+  </object-type>
+
+  <object-type name="QSystemSemaphore"/>
+
+  <namespace-type name="QtConcurrent" target-type="class">
+    <inject-code class="java">
+        <import-file name="typesystem_core-java.java" quote-after-line="class QtConcurrent___" quote-before-line="}// class"/>
+    </inject-code>
+  </namespace-type>
+
+  <value-type name="QFuture" generate="no">
+    <modify-function signature="operator T() const" remove="all"/>
+    <modify-function signature="operator=(const QFuture &amp;)" remove="all"/>
+  
+    <modify-function signature="operator==(const QFuture &amp;)const">
+        <modify-argument index="1">
+            <replace-type modified-type="qt.core.QFuture"/>
+            <conversion-rule class="native">
+                <insert-template name="convert_qtjambifuture_to_native"/>
+            </conversion-rule>
+        </modify-argument>
+    </modify-function>
+  </value-type>
+  <value-type name="QtJambiVoidFuture" java-name="QFutureVoid">
+    <modify-function signature="resultCount()const" remove="all"/>
+    <modify-function signature="isResultReadyAt(int)const" remove="all"/>
+  
+    <modify-function signature="QFuture(const QFuture &amp;)">
+        <modify-argument index="1">
+            <replace-type modified-type="qt.core.QFutureVoid"/>
+            <conversion-rule class="native">
+                <insert-template name="convert_futurevoid_to_native"/>
+            </conversion-rule>
+        </modify-argument>
+    </modify-function>
+  </value-type>
+  <value-type name="QtJambiFuture" java-name="QFuture" generic-class="yes">
+    <modify-function signature="QFuture(const QFuture &amp;)">
+        <modify-argument index="1">
+            <replace-type modified-type="qt.core.QFuture&lt;T&gt;"/>
+            <conversion-rule class="native">
+                <insert-template name="convert_qtjambifuture_to_native"/>
+            </conversion-rule>
+        </modify-argument>
+    </modify-function>
+  </value-type>
+
+  <object-type name="QFutureWatcherBase">
+    <modify-function signature="connectNotify(const char *)" remove="all"/>
+    <modify-function signature="disconnectNotify(const char *)" remove="all"/>
+  
+    <inject-code class="shell-declaration">
+
+        // private, pure virtual and considered internal
+        // we need to reimplement them so it will compile
+        QFutureInterfaceBase dummyBase;
+        virtual const QFutureInterfaceBase &amp;futureInterface() const { return dummyBase; }
+        virtual QFutureInterfaceBase &amp;futureInterface() { return dummyBase; }
+    </inject-code>
+  </object-type>
+  <object-type name="QtJambiVoidFutureWatcher" java-name="QFutureWatcherVoid">
+    <modify-function signature="setFuture(const QFuture &amp;)">
+        <modify-argument index="1">
+            <replace-type modified-type="qt.core.QFutureVoid"/>
+            <conversion-rule class="native">
+                <insert-template name="convert_futurevoid_to_native"/>
+            </conversion-rule>
+        </modify-argument>
+    </modify-function>
+    <inject-code>
+        <import-file name="typesystem_core-java.java" quote-after-line="class QFutureWatcherVoid___" quote-before-line="}// class"/>
+    </inject-code>
+    <inject-code class="native">
+        <insert-template name="future_function_in_futurewatcher">
+            <replace from="QFutureWatcher" to="QFutureWatcherVoid"/>
+            <replace from="QtJambiFuture" to="QtJambiVoidFuture"/>
+            <replace from="&quot;QFuture&quot;" to="&quot;QFutureVoid&quot;"/>
+        </insert-template>
+    </inject-code>
+  </object-type>
+
+  <object-type name="QFutureWatcher" generate="no">
+    <modify-function signature="future()const" remove="all"/>
+  
+    <modify-function signature="setFuture(const QFuture &amp;)">
+        <modify-argument index="1">
+            <replace-type modified-type="qt.core.QFuture&lt;T&gt;"/>
+            <conversion-rule class="native">
+                <insert-template name="convert_qtjambifuture_to_native"/>
+            </conversion-rule>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+  <object-type name="QtJambiFutureWatcher" java-name="QFutureWatcher" generic-class="yes">
+    <inject-code>
+        <import-file name="typesystem_core-java.java" quote-after-line="class QFutureWatcher___" quote-before-line="}// class"/>
+    </inject-code>
+    <inject-code class="native">
+        <insert-template name="future_function_in_futurewatcher"/>
+    </inject-code>
+  </object-type>
+
+  <object-type name="QFutureSynchronizer" generate="no"/>
+  <object-type name="QtJambiFutureSynchronizer" generic-class="yes" java-name="QFutureSynchronizer">
+      <modify-function signature="QFutureSynchronizer(const QFuture &amp;)">
+        <modify-argument index="1">
+            <replace-type modified-type="qt.core.QFuture&lt;T&gt;"/>
+            <conversion-rule class="native">
+                <insert-template name="convert_qtjambifuture_to_native"/>
+            </conversion-rule>
+        </modify-argument>
+      </modify-function>
+      <modify-function signature="addFuture(const QFuture &amp;)">
+        <modify-argument index="1">
+            <replace-type modified-type="qt.core.QFuture&lt;T&gt;"/>
+            <conversion-rule class="native">
+                <insert-template name="convert_qtjambifuture_to_native"/>
+            </conversion-rule>
+        </modify-argument>
+      </modify-function>
+      <modify-function signature="setFuture(const QFuture &amp;)">
+        <modify-argument index="1">
+            <replace-type modified-type="qt.core.QFuture&lt;T&gt;"/>
+            <conversion-rule class="native">
+                <insert-template name="convert_qtjambifuture_to_native"/>
+            </conversion-rule>
+        </modify-argument>
+      </modify-function>
+      <modify-function signature="futures()const" remove="all"/>
+      <inject-code class="native">
+        <insert-template name="futures_function_in_futuresynchronizer"/>
+      </inject-code>
+      <inject-code class="java">
+        <import-file name="typesystem_core-java.java" quote-after-line="class QFutureSynchronizer___" quote-before-line="}// class"/>
+      </inject-code>
+  </object-type>
+  <object-type name="QtJambiVoidFutureSynchronizer" java-name="QFutureSynchronizerVoid">
+      <modify-function signature="QFutureSynchronizer(const QFuture &amp;)">
+        <modify-argument index="1">
+            <replace-type modified-type="qt.core.QFutureVoid"/>
+            <conversion-rule class="native">
+                <insert-template name="convert_futurevoid_to_native"/>
+            </conversion-rule>
+        </modify-argument>
+      </modify-function>
+      <modify-function signature="addFuture(const QFuture &amp;)">
+        <modify-argument index="1">
+            <replace-type modified-type="qt.core.QFutureVoid"/>
+            <conversion-rule class="native">
+                <insert-template name="convert_futurevoid_to_native"/>
+            </conversion-rule>
+        </modify-argument>
+      </modify-function>
+      <modify-function signature="setFuture(const QFuture &amp;)">
+        <modify-argument index="1">
+            <replace-type modified-type="qt.core.QFutureVoid"/>
+            <conversion-rule class="native">
+                <insert-template name="convert_futurevoid_to_native"/>
+            </conversion-rule>
+        </modify-argument>
+      </modify-function>
+      <modify-function signature="futures()const" remove="all"/>
+      <inject-code class="native">
+        <insert-template name="futures_function_in_futuresynchronizer">
+            <replace from="QFutureSynchronizer" to="QFutureSynchronizerVoid"/>
+            <replace from="QtJambiFutureSynchronizer" to="QtJambiVoidFutureSynchronizer"/>
+            <replace from="QtJambiFuture" to="QtJambiVoidFuture"/>
+            <replace from="&quot;QFuture&quot;" to="&quot;QFutureVoid&quot;"/>
+        </insert-template>
+      </inject-code>
+      <inject-code class="java">
+        <import-file name="typesystem_core-java.java" quote-after-line="class QFutureSynchronizerVoid___" quote-before-line="}// class"/>
+      </inject-code>
+  </object-type>
+  <object-type name="QThreadPool"/>
+
+  <object-type name="QFutureIterator" generate="no">
+      <modify-function signature="operator=(const QFuture&amp;)" remove="all"/>
+  </object-type>
+  <object-type name="QtJambiFutureIterator" generic-class="yes" java-name="QFutureIterator">
+    <modify-function signature="QFutureIterator(const QFuture &amp;)">
+        <modify-argument index="1">
+            <replace-type modified-type="qt.core.QFuture&lt;T&gt;"/>
+            <conversion-rule class="native">
+                <insert-template name="convert_qtjambifuture_to_native"/>
+            </conversion-rule>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+  <object-type name="QRunnable"/>
+
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'std::*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type '*Private\*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type '*Private&amp;'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QMetaObject'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'FILE\*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QByteArray::Data\*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QTSMFC'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QTSMFI'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QAbstractFileEngine::ExtensionOption const\*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QAbstractFileEngine::Iterator\*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QDataStream::ByteOrder'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: visibility of function '*' modified in class '*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: hiding of function '*' in class '*'"/>
+  <suppress-warning text="WARNING(CppImplGenerator) :: protected function '*' in final class '*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QPointer&lt;*&gt;'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QVector&lt;*&gt;'"/>
+  <suppress-warning text="* private virtual function '*' in 'QAbstractListModel'"/>
+  <suppress-warning text="* private virtual function '*' in 'QAbstractTableModel'"/>
+  <suppress-warning text="* private virtual function '*' in 'QListWidget'"/>
+  <suppress-warning text="* private virtual function '*' in 'QTreeWidget'"/>
+  <suppress-warning text="* private virtual function '*' in 'QFontDialog'"/>
+  <suppress-warning text="* private virtual function '*' in 'QTableWidget'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QDateTime' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QPersistentModelIndex' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QUuid' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QRect' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QTime' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QLocale' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QDir' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QPointF' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QSize' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QFileInfo' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QSizeF' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QRegExp' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QRectF' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QDate' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QPoint' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QUrl' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QFutureWatcherBase::futureInterface', unmatched return type 'QFutureInterfaceBase&amp;'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QFutureWatcherBase::futureInterface', unmatched return type 'QFutureInterfaceBase const&amp;'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QFutureWatcher::futureInterface', unmatched return type 'QFutureInterfaceBase&amp;'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QFutureWatcher::futureInterface', unmatched return type 'QFutureInterfaceBase const&amp;'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QFuture' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: unknown operator 'T'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QFutureVoid' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QFuture::constBegin', unmatched return type 'const_iterator'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QFuture::end', unmatched return type 'const_iterator'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QFuture::constEnd', unmatched return type 'const_iterator'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QFuture::QFuture', unmatched parameter type 'QFutureInterface&lt;T&gt;*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QFuture::begin', unmatched return type 'const_iterator'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::blockingMapped', unmatched return type 'Sequence'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::blockingMapped', unmatched return type 'QList&lt;U&gt;'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::blockingMapped', unmatched return type 'QList&lt;MapFunctor::result_type&gt;'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::blockingMapped', unmatched return type 'OutputSequence'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::filtered', unmatched parameter type 'Iterator'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::filtered', unmatched parameter type 'Sequence const&amp;'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::filter', unmatched parameter type 'Sequence&amp;'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::startFiltered', unmatched return type 'ThreadEngineStarter&lt;Sequence::value_type&gt;'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::startFiltered', unmatched return type 'ThreadEngineStarter&lt;Iterator::value_type&gt;'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::blockingMappedReduced', unmatched return type 'V'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::blockingMappedReduced', unmatched return type 'W'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::blockingMappedReduced', unmatched return type 'ResultType'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::blockingMappedReduced', unmatched return type 'U'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::blockingFiltered', unmatched return type 'OutputSequence'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::blockingFiltered', unmatched return type 'Sequence'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::startMappedReduced', unmatched return type 'ThreadEngineStarter&lt;ResultType&gt;'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::blockingFilteredReduced', unmatched return type 'U'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::blockingFilteredReduced', unmatched return type 'V'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::blockingFilteredReduced', unmatched return type 'ResultType'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::startMap', unmatched return type 'ThreadEngineStarter&lt;void&gt;'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::startThreadEngine', unmatched return type 'ThreadEngineStarter&lt;ThreadEngine::ResultType&gt;'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::mappedReduced', unmatched parameter type 'Iterator'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::mappedReduced', unmatched parameter type 'Sequence const&amp;'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::filteredReduced', unmatched parameter type 'Iterator'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::filteredReduced', unmatched parameter type 'Sequence const&amp;'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::map', unmatched parameter type 'Iterator'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::map', unmatched parameter type 'Sequence&amp;'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::filterInternal', unmatched return type 'ThreadEngineStarter&lt;void&gt;'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::createFunctor', unmatched return type 'QtConcurrent::SelectMemberFunctor0lt;T,Class&gt;::type'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::createFunctor', unmatched return type 'SelectFunctor0&lt;T,T&gt;::type'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::mapped', unmatched parameter type 'Iterator'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::mapped', unmatched parameter type 'Sequence const&amp;'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::blockingMap', unmatched parameter type 'Iterator'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::blockingMap', unmatched parameter type 'Sequence&amp;'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::startMapped', unmatched return type 'QtConcurrent::ThreadEngineStarter&lt;T&gt;'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::startFilteredReduced', unmatched return type 'ThreadEngineStarter&lt;ResultType&gt;'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::run', unmatched parameter type 'Class const*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::run', unmatched parameter type 'Class*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::run', unmatched parameter type 'Class const&amp;'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::run', unmatched parameter type 'FunctionObject*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::run', unmatched parameter type 'FunctionObject'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::run', unmatched parameter type 'T'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::blockingFilter', unmatched parameter type 'Sequence&amp;'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::createFunctor', unmatched return type 'QtConcurrent::SelectMemberFunctor0&lt;T,Class&gt;::type'"/>
+
+  <suppress-warning text="WARNING(Parser) :: ** WARNING scope not found for function definition:QFuture&lt;void&gt;::operator= - definition *ignored*"/>
+  <suppress-warning text="WARNING(Parser) :: ** WARNING scope not found for function definition:QFutureInterface&lt;void&gt;::future - definition *ignored*"/>
+  <suppress-warning text="WARNING(Parser) :: ** WARNING scope not found for function definition:QFutureWatcher&lt;void&gt;::setFuture - definition *ignored*"/>
+
+
+</typesystem>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/typesystem_designer-common.xml	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,48 @@
+<typesystem>
+
+  <rejection class="QAbstractExtensionFactory" />
+  <rejection class="QAbstractExtensionManager" />
+  <rejection class="QAbstractFormBuilder" />
+  <rejection class="QDesignerActionEditorInterface" />
+  <rejection class="QDesignerBrushManagerInterface" />
+  <rejection class="QDesignerContainerExtension" />
+  <rejection class="QDesignerCustomWidgetCollectionInterface" />
+  <rejection class="QDesignerCustomWidgetInterface" />
+  <rejection class="QDesignerDnDItemInterface" />
+  <rejection class="QDesignerExtraInfoExtension" />
+  <rejection class="QDesignerFormEditorInterface" />
+  <rejection class="QDesignerFormEditorPluginInterface" />
+  <rejection class="QDesignerFormWindowCursorInterface" />
+  <rejection class="QDesignerFormWindowInterface" />
+  <rejection class="QDesignerFormWindowManagerInterface" />
+  <rejection class="QDesignerFormWindowToolInterface" />
+  <rejection class="QDesignerIconCacheInterface" />
+  <rejection class="QDesignerIntegrationInterface" />
+  <rejection class="QDesignerLanguageExtension" />
+  <rejection class="QDesignerLayoutDecorationExtension" />
+  <rejection class="QDesignerMetaDataBaseInterface" />
+  <rejection class="QDesignerMetaDataBaseItemInterface" />
+  <rejection class="QDesignerObjectInspectorInterface" />
+  <rejection class="QDesignerPropertyEditorInterface" />
+  <rejection class="QDesignerTaskMenuExtension" />
+  <rejection class="QDesignerWidgetBoxInterface" />
+  <rejection class="QDesignerWidgetDataBaseInterface" />
+  <rejection class="QDesignerWidgetDataBaseItemInterface" />
+  <rejection class="QDesignerWidgetFactoryInterface" />
+  <rejection class="QExtensionManager" />
+  <rejection class="QFormBuilder" />
+  <rejection class="QDesignerDynamicPropertySheetExtension" />
+  <rejection class="QDesignerPromotionInterface" />
+  <rejection class="QDesignerScriptExtension" />
+  <rejection class="QDesignerPropertySheetExtension" />
+  <rejection class="JambiPropertySheet" />
+  <rejection class="QDesignerMemberSheetExtension" />
+  <rejection class="JambiMemberSheet" />
+
+  <object-type name="QDesignerResourceBrowserInterface">
+    <include file-name="abstractresourcebrowser.h" location="global"/>
+  </object-type>
+
+  <object-type name="JambiResourceBrowser" />
+
+</typesystem>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/typesystem_designer-java.xml	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,16 @@
+<typesystem package=qt.tools.designer" default-superclass="qt.QtJambiObject">
+
+    <inject-code>
+        qt.Utilities.loadQtLibrary("QtCore");
+        qt.Utilities.loadQtLibrary("QtGui");
+        qt.Utilities.loadQtLibrary("QtXml");
+        qt.Utilities.loadQtLibrary("QtSvg");
+        qt.Utilities.loadQtLibrary("QtScript");
+        qt.Utilities.loadQtLibrary("QtDesigner");
+        qt.Utilities.loadQtLibrary("QtDesignerComponents");
+    </inject-code>
+
+    <primitive-type name="qdesigner_internal::FlagType" java-name="int" preferred-conversion="no" jni-name="jint" />
+    <primitive-type name="qdesigner_internal::EnumType" java-name="int" preferred-conversion="no" jni-name="jint" />
+
+</typesystem>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/typesystem_designer.xml	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<typesystem package="qt.tools.designer" default-superclass="qt.QtJambiObject">
+<inject-code>
+        qt.Utilities.loadQtLibrary("QtCore");
+        qt.Utilities.loadQtLibrary("QtGui");
+        qt.Utilities.loadQtLibrary("QtXml");
+        qt.Utilities.loadQtLibrary("QtSvg");
+        qt.Utilities.loadQtLibrary("QtScript");
+        qt.Utilities.loadQtLibrary("QtDesigner");
+        qt.Utilities.loadQtLibrary("QtDesignerComponents");
+    </inject-code>
+<primitive-type name="qdesigner_internal::FlagType" java-name="int" preferred-conversion="no" jni-name="jint"/>
+<primitive-type name="qdesigner_internal::EnumType" java-name="int" preferred-conversion="no" jni-name="jint"/>
+
+  <rejection class="QAbstractExtensionFactory"/>
+  <rejection class="QAbstractExtensionManager"/>
+  <rejection class="QAbstractFormBuilder"/>
+  <rejection class="QDesignerActionEditorInterface"/>
+  <rejection class="QDesignerBrushManagerInterface"/>
+  <rejection class="QDesignerContainerExtension"/>
+  <rejection class="QDesignerCustomWidgetCollectionInterface"/>
+  <rejection class="QDesignerCustomWidgetInterface"/>
+  <rejection class="QDesignerDnDItemInterface"/>
+  <rejection class="QDesignerExtraInfoExtension"/>
+  <rejection class="QDesignerFormEditorInterface"/>
+  <rejection class="QDesignerFormEditorPluginInterface"/>
+  <rejection class="QDesignerFormWindowCursorInterface"/>
+  <rejection class="QDesignerFormWindowInterface"/>
+  <rejection class="QDesignerFormWindowManagerInterface"/>
+  <rejection class="QDesignerFormWindowToolInterface"/>
+  <rejection class="QDesignerIconCacheInterface"/>
+  <rejection class="QDesignerIntegrationInterface"/>
+  <rejection class="QDesignerLanguageExtension"/>
+  <rejection class="QDesignerLayoutDecorationExtension"/>
+  <rejection class="QDesignerMetaDataBaseInterface"/>
+  <rejection class="QDesignerMetaDataBaseItemInterface"/>
+  <rejection class="QDesignerObjectInspectorInterface"/>
+  <rejection class="QDesignerPropertyEditorInterface"/>
+  <rejection class="QDesignerTaskMenuExtension"/>
+  <rejection class="QDesignerWidgetBoxInterface"/>
+  <rejection class="QDesignerWidgetDataBaseInterface"/>
+  <rejection class="QDesignerWidgetDataBaseItemInterface"/>
+  <rejection class="QDesignerWidgetFactoryInterface"/>
+  <rejection class="QExtensionManager"/>
+  <rejection class="QFormBuilder"/>
+  <rejection class="QDesignerDynamicPropertySheetExtension"/>
+  <rejection class="QDesignerPromotionInterface"/>
+  <rejection class="QDesignerScriptExtension"/>
+  <rejection class="QDesignerPropertySheetExtension"/>
+  <rejection class="JambiPropertySheet"/>
+  <rejection class="QDesignerMemberSheetExtension"/>
+  <rejection class="JambiMemberSheet"/>
+
+  <object-type name="QDesignerResourceBrowserInterface">
+    <include file-name="abstractresourcebrowser.h" location="global"/>
+  </object-type>
+
+  <object-type name="JambiResourceBrowser"/>
+
+</typesystem>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/typesystem_gui-common.xml	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,5010 @@
+<?xml version="1.0"?>
+<typesystem>
+
+  <rejection class="*" function-name="d_func"/>
+
+  <rejection class="*" field-name="d_ptr"/>
+  <rejection class="*" field-name="d"/>
+
+  <rejection class="QWindowsCEStyle" />
+  <rejection class="QWindowsMobileStyle" />
+  <rejection class="QAbstractUndoItem"/>
+  <rejection class="QAccessibleApplication"/>
+  <rejection class="QBrushData"/>
+  <rejection class="QImageTextKeyLang"/>
+  <rejection class="QItemEditorCreator"/>
+  <rejection class="QLibrary"/>
+  <rejection class="QLinkedList"/>
+  <rejection class="QLinkedListData"/>
+  <rejection class="QLinkedListIterator"/>
+  <rejection class="QLinkedListNode"/>
+  <rejection class="QMimeSource"/>
+  <rejection class="QPainterPathPrivate"/>
+  <rejection class="QRegionData"/>
+  <rejection class="QStandardItemEditorCreator"/>
+  <rejection class="QStyleOptionQ3DockWindow"/>
+  <rejection class="QStyleOptionQ3ListView"/>
+  <rejection class="QStyleOptionQ3ListViewItem"/>
+  <rejection class="QTextFrameLayoutData"/>
+  <rejection class="QUpdateLaterEvent"/>
+  <rejection class="QVFbHeader"/>
+  <rejection class="QWidgetData"/>
+  <rejection class="QWindowSurface"/>
+  <rejection class="QWindowsXPStyle"/>
+  <rejection class="QWindowsVistaStyle"/>
+  <rejection class="QWSEmbedWidget"/>
+  <rejection class="QRegion::QRegionData"/>
+  <rejection class="JObject_key" />
+  <rejection class="QAccessibleEditableTextInterface"/>
+  <rejection class="QAccessibleSimpleEditableTextInterface"/>
+  <rejection class="QAccessibleTextInterface"/>
+  <rejection class="QAccessibleValueInterface"/>
+  <rejection class="QIconEngineFactoryInterface"/>
+  <rejection class="QIconEnginePlugin"/>
+  <rejection class="QWidgetItemV2" />
+  <rejection class="QAbstractItemDelegate" function-name="operator="/>
+  <rejection class="QAccessible" function-name="installFactory"/>
+  <rejection class="QAccessible" function-name="installRootObjectHandler"/>
+  <rejection class="QAccessible" function-name="installUpdateHandler"/>
+  <rejection class="QAccessible" function-name="removeFactory"/>
+  <rejection class="QApplication" function-name="compressEvent"/>
+  <rejection class="QBrush" function-name="cleanUp"/>
+  <rejection class="QPictureIO" function-name="defineIOHandler"/>
+  <rejection class="QPolygon" function-name="putPoints"/>
+  <rejection class="QPolygon" function-name="setPoints"/>
+  <rejection class="QPolygon" function-name="setPoint"/>
+  <rejection class="QPolygon" function-name="points"/>
+  <rejection class="QPolygon" function-name="point"/>
+  <rejection class="QPrinter" function-name="printerSelectionOption"/>
+  <rejection class="QPrinter" function-name="setPrinterSelectionOption"/>
+  <rejection class="QWidget" function-name="create"/>
+  <rejection class="QWidget" function-name="find"/>
+  <rejection class="QWidget" function-name="handle"/>
+  <rejection class="QWidget" function-name="styleChange"/>
+  <rejection class="QWidget" function-name="internalWinId"/>
+  <rejection class="QActionGroup" function-name="selected"/>
+  <rejection class="QPaintEngine" function-name="fix_neg_rect"/>
+  <rejection class="QTreeModel" function-name="node"/>
+  <rejection class="QTreeModel" function-name="initializeNode"/>
+  <rejection class="QTreeModel" function-name="queryChildren"/>
+  <rejection class="QAccessible" function-name="cast_helper"/>
+  <rejection class="QAccessible2"/>
+  <rejection class="QAccessibleInterface" function-name="backgroundColor"/>
+  <rejection class="QAccessibleInterface" function-name="foregroundColor"/>
+  <rejection class="QAccessibleInterface" function-name="textInterface"/>
+  <rejection class="QAccessibleInterface" function-name="valueInterface"/>
+  <rejection class="QAccessibleInterface" function-name="tableInterface"/>
+  <rejection class="QAccessibleInterface" function-name="editableTextInterface"/>
+  <rejection class="QAccessibleInterface" function-name="cast_helper"/>
+  <rejection class="QAccessibleInterfaceEx" function-name="interface_cast"/>
+  <rejection class="QAccessibleBridgePlugin" />
+  <rejection class="QAccessibleBridgeFactoryInterface" />
+  <rejection class="QTabletEvent" field-name="mExtra"/>
+  <rejection class="QWidgetItem" field-name="wid" />
+  <rejection class="QFont" enum-name="ResolveProperties" />
+
+  <enum-type name="QAbstractItemDelegate::EndEditHint"/>
+  <enum-type name="QAbstractItemView::CursorAction"/>
+  <enum-type name="QAbstractItemView::DragDropMode"/>
+  <enum-type name="QAbstractItemView::DropIndicatorPosition"/>
+  <enum-type name="QAbstractItemView::EditTrigger" flags="QAbstractItemView::EditTriggers"/>
+  <enum-type name="QAbstractItemView::ScrollHint"/>
+  <enum-type name="QAbstractItemView::ScrollMode"/>
+  <enum-type name="QAbstractItemView::SelectionBehavior"/>
+  <enum-type name="QAbstractItemView::SelectionMode"/>
+  <enum-type name="QAbstractItemView::State"/>
+  <enum-type name="QAbstractPrintDialog::PrintDialogOption" flags="QAbstractPrintDialog::PrintDialogOptions"/>
+  <enum-type name="QAbstractPrintDialog::PrintRange"/>
+  <enum-type name="QAbstractSlider::SliderAction"/>
+  <enum-type name="QAbstractSlider::SliderChange"/>
+  <enum-type name="QAbstractSpinBox::ButtonSymbols"/>
+  <enum-type name="QAbstractSpinBox::CorrectionMode"/>
+  <enum-type name="QAbstractSpinBox::StepEnabledFlag" flags="QAbstractSpinBox::StepEnabled"/>
+  <enum-type name="QAccessible::Event"/>
+  <enum-type name="QAccessible::Method"/>
+  <enum-type name="QAccessible::RelationFlag" flags="QAccessible::Relation"/>
+  <enum-type name="QAccessible::Role"/>
+  <enum-type name="QAccessible::StateFlag" flags="QAccessible::State"/>
+  <enum-type name="QAccessible::Text"/>
+  <enum-type name="QDesktopServices::StandardLocation" />
+  <enum-type name="QDirModel::Roles"/>
+  <enum-type name="QFont::Capitalization" />
+  <enum-type name="QFont::SpacingType" />
+  <enum-type name="QGraphicsItem::CacheMode" />
+  <enum-type name="QMdiArea::AreaOption" flags="QMdiArea::AreaOptions"/>
+  <enum-type name="QMdiArea::WindowOrder"/>
+  <enum-type name="QMdiArea::ViewMode" />
+  <enum-type name="QFileSystemModel::Roles" />
+  <enum-type name="QFormLayout::FieldGrowthPolicy" />
+  <enum-type name="QFormLayout::FormStyle" />
+  <enum-type name="QFormLayout::ItemRole" />
+  <enum-type name="QFormLayout::RowWrapPolicy" />
+  <enum-type name="QGraphicsProxyWidget::enum_1" />
+  <enum-type name="QGraphicsWidget::enum_1" />
+  <enum-type name="QPlainTextEdit::LineWrapMode" />
+  <enum-type name="QPrintPreviewWidget::ViewMode" />
+  <enum-type name="QPrintPreviewWidget::ZoomMode" />
+  <enum-type name="QStyleOptionViewItemV4::StyleOptionVersion" />
+  <enum-type name="QStyleOptionViewItemV4::ViewItemPosition" />
+
+  <enum-type name="QMdiSubWindow::SubWindowOption" flags="QMdiSubWindow::SubWindowOptions"/>
+
+  <enum-type name="QAction::ActionEvent"/>
+  <enum-type name="QAction::MenuRole"/>
+  <enum-type name="QApplication::ColorSpec"/>
+  <enum-type name="QApplication::Type"/>
+  <enum-type name="QCalendarWidget::HorizontalHeaderFormat"/>
+  <enum-type name="QCalendarWidget::SelectionMode"/>
+  <enum-type name="QCalendarWidget::VerticalHeaderFormat"/>
+  <enum-type name="QColor::Spec"/>
+  <enum-type name="QColormap::Mode"/>
+  <enum-type name="QComboBox::InsertPolicy"/>
+  <enum-type name="QComboBox::SizeAdjustPolicy"/>
+  <enum-type name="QCompleter::CompletionMode"/>
+  <enum-type name="QCompleter::ModelSorting"/>
+  <enum-type name="QContextMenuEvent::Reason"/>
+  <enum-type name="QDataWidgetMapper::SubmitPolicy"/>
+  <enum-type name="QDateTimeEdit::Section" flags="QDateTimeEdit::Sections"/>
+  <enum-type name="QDialog::DialogCode"/>
+  <enum-type name="QDialogButtonBox::ButtonLayout"/>
+  <enum-type name="QDialogButtonBox::ButtonRole"/>
+  <enum-type name="QFileDialog::AcceptMode"/>
+  <enum-type name="QFileDialog::DialogLabel"/>
+  <enum-type name="QFileDialog::FileMode"/>
+  <enum-type name="QFileDialog::Option" flags="QFileDialog::Options"/>
+  <enum-type name="QFileDialog::ViewMode"/>
+  <enum-type name="QFileIconProvider::IconType"/>
+  <enum-type name="QFont::Stretch"/>
+  <enum-type name="QFont::Style"/>
+  <enum-type name="QFont::StyleStrategy"/>
+  <enum-type name="QFont::Weight"/>
+  <enum-type name="QFontComboBox::FontFilter" flags="QFontComboBox::FontFilters"/>
+  <enum-type name="QFrame::Shadow" extensible="yes"/>
+  <enum-type name="QFrame::Shape"/>
+  <enum-type name="QFrame::StyleMask"/>
+  <enum-type name="QGradient::CoordinateMode"/>
+  <enum-type name="QGradient::Spread" lower-bound="QGradient.PadSpread" upper-bound="QGradient.RepeatSpread"/>
+  <enum-type name="QGradient::Type"/>
+  <enum-type name="QGraphicsEllipseItem::enum_1"/>
+  <enum-type name="QGraphicsItem::Extension"/>
+  <enum-type name="QGraphicsItem::GraphicsItemChange"/>
+  <enum-type name="QGraphicsItem::GraphicsItemFlag" flags="QGraphicsItem::GraphicsItemFlags"/>
+  <enum-type name="QGraphicsItem::enum_1"/>
+  <enum-type name="QGraphicsItemGroup::enum_1"/>
+  <enum-type name="QGraphicsLineItem::enum_1"/>
+  <enum-type name="QGraphicsPathItem::enum_1"/>
+  <enum-type name="QGraphicsPixmapItem::ShapeMode"/>
+  <enum-type name="QGraphicsPixmapItem::enum_1"/>
+  <enum-type name="QGraphicsPolygonItem::enum_1"/>
+  <enum-type name="QGraphicsRectItem::enum_1"/>
+  <enum-type name="QGraphicsScene::ItemIndexMethod"/>
+  <enum-type name="QGraphicsSceneContextMenuEvent::Reason"/>
+  <enum-type name="QGraphicsSimpleTextItem::enum_1"/>
+  <enum-type name="QGraphicsTextItem::enum_1"/>
+  <enum-type name="QGraphicsView::CacheModeFlag" flags="QGraphicsView::CacheMode"/>
+  <enum-type name="QGraphicsView::DragMode"/>
+  <enum-type name="QGraphicsView::OptimizationFlag" flags="QGraphicsView::OptimizationFlags"/>
+  <enum-type name="QGraphicsView::ViewportAnchor"/>
+  <enum-type name="QGraphicsView::ViewportUpdateMode"/>
+  <enum-type name="QIcon::Mode"/>
+  <enum-type name="QIcon::State"/>
+  <enum-type name="QImage::Format"/>
+  <enum-type name="QImage::InvertMode"/>
+  <enum-type name="QImageIOHandler::ImageOption"/>
+  <enum-type name="QImageReader::ImageReaderError"/>
+  <enum-type name="QImageWriter::ImageWriterError"/>
+  <enum-type name="QInputContext::StandardFormat"/>
+  <enum-type name="QInputMethodEvent::AttributeType"/>
+  <enum-type name="QItemSelectionModel::SelectionFlag" flags="QItemSelectionModel::SelectionFlags"/>
+  <enum-type name="QKeySequence::SequenceFormat"/>
+  <enum-type name="QKeySequence::SequenceMatch"/>
+  <enum-type name="QKeySequence::StandardKey"/>
+  <enum-type name="QLCDNumber::Mode"/>
+  <enum-type name="QLCDNumber::SegmentStyle"/>
+  <enum-type name="QLayout::SizeConstraint"/>
+  <enum-type name="QLineEdit::EchoMode"/>
+  <enum-type name="QListView::Flow"/>
+  <enum-type name="QListView::LayoutMode"/>
+  <enum-type name="QListView::Movement"/>
+  <enum-type name="QListView::ResizeMode"/>
+  <enum-type name="QListView::ViewMode"/>
+  <enum-type name="QListWidgetItem::ItemType"/>
+  <enum-type name="QMainWindow::DockOption" flags="QMainWindow::DockOptions"/>
+  <enum-type name="QMessageBox::ButtonRole"/>
+  <enum-type name="QMessageBox::Icon"/>
+  <enum-type name="QMovie::CacheMode"/>
+  <enum-type name="QMovie::MovieState"/>
+  <enum-type name="QPaintDevice::PaintDeviceMetric"/>
+  <enum-type name="QPaintEngine::DirtyFlag" flags="QPaintEngine::DirtyFlags"/>
+  <enum-type name="QPaintEngine::PaintEngineFeature" flags="QPaintEngine::PaintEngineFeatures"/>
+  <enum-type name="QPaintEngine::PolygonDrawMode"/>
+  <enum-type name="QPaintEngine::Type"/>
+  <enum-type name="QPageSetupDialog::PageSetupDialogOption" flags="QPageSetupDialog::PageSetupDialogOptions" />
+  <enum-type name="QPainter::CompositionMode"/>
+  <enum-type name="QPainter::RenderHint" flags="QPainter::RenderHints"/>
+  <enum-type name="QPainterPath::ElementType"/>
+  <enum-type name="QPrintEngine::PrintEnginePropertyKey">
+    <reject-enum-value name="PPK_PaperSize" />
+  </enum-type>
+  <enum-type name="QPrinter::ColorMode"/>
+  <enum-type name="QPrinter::Orientation"/>
+  <enum-type name="QPrinter::OutputFormat"/>
+  <enum-type name="QPrinter::PageOrder"/>
+  <enum-type name="QPrinter::PaperSource"/>
+  <enum-type name="QPrinter::PrintRange"/>
+  <enum-type name="QPrinter::PrinterMode"/>
+  <enum-type name="QPrinter::PrinterState"/>
+  <enum-type name="QPrinter::Unit" />
+  <enum-type name="QPrinter::DuplexMode" />
+  <enum-type name="QProgressBar::Direction"/>
+  <enum-type name="QRegion::RegionType"/>
+  <enum-type name="QRubberBand::Shape"/>
+  <enum-type name="QSessionManager::RestartHint"/>
+  <enum-type name="QSizePolicy::Policy"/>
+  <enum-type name="QSizePolicy::PolicyFlag"/>
+  <enum-type name="QSizePolicy::ControlType" flags="QSizePolicy::ControlTypes"/>
+  <enum-type name="QStandardItem::ItemType"/>
+  <enum-type name="QStyle::SubControl" flags="QStyle::SubControls" extensible="yes" force-integer="yes"/>
+  <enum-type name="QStyle::ComplexControl" extensible="yes"/>
+  <enum-type name="QStyle::ContentsType" extensible="yes"/>
+  <enum-type name="QStyle::ControlElement" extensible="yes"/>
+  <enum-type name="QStyle::PixelMetric" extensible="yes">
+    <reject-enum-value name="PM_MDIFrameWidth"/>
+    <reject-enum-value name="PM_MDIMinimizedWidth"/>
+  </enum-type>
+  <enum-type name="QStyle::PrimitiveElement" extensible="yes">
+    <reject-enum-value name="PE_IndicatorItemViewItemCheck" />
+    <reject-enum-value name="PE_FrameStatusBarItem" />
+  </enum-type>
+  <enum-type name="QStyle::StandardPixmap" extensible="yes"/>
+  <enum-type name="QStyle::StateFlag" flags="QStyle::State"/>
+  <enum-type name="QStyle::SubElement" extensible="yes">
+    <reject-enum-value name="SE_ItemViewItemCheckIndicator" />
+  </enum-type>
+  <enum-type name="QStyleHintReturn::HintReturnType"/>
+  <enum-type name="QStyleHintReturn::StyleOptionType"/>
+  <enum-type name="QStyleHintReturn::StyleOptionVersion"/>
+  <enum-type name="QStyleHintReturnVariant::StyleOptionType"/>
+  <enum-type name="QStyleHintReturnVariant::StyleOptionVersion"/>
+
+  <enum-type name="QStyleHintReturnMask::StyleOptionType"/>
+  <enum-type name="QStyleHintReturnMask::StyleOptionVersion"/>
+  <enum-type name="QStyleOption::StyleOptionType"/>
+  <enum-type name="QStyleOption::OptionType" extensible="yes"/>
+  <enum-type name="QStyleOption::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionButton::ButtonFeature" flags="QStyleOptionButton::ButtonFeatures"/>
+  <enum-type name="QStyleOptionButton::StyleOptionType"/>
+  <enum-type name="QStyleOptionButton::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionComboBox::StyleOptionType"/>
+  <enum-type name="QStyleOptionComboBox::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionComplex::StyleOptionType"/>
+  <enum-type name="QStyleOptionComplex::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionDockWidget::StyleOptionType"/>
+  <enum-type name="QStyleOptionDockWidget::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionDockWidgetV2::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionFocusRect::StyleOptionType"/>
+  <enum-type name="QStyleOptionFocusRect::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionFrame::StyleOptionType"/>
+  <enum-type name="QStyleOptionFrame::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionFrameV2::FrameFeature" flags="QStyleOptionFrameV2::FrameFeatures"/>
+  <enum-type name="QStyleOptionFrameV2::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionGraphicsItem::StyleOptionType"/>
+  <enum-type name="QStyleOptionGraphicsItem::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionGroupBox::StyleOptionType"/>
+  <enum-type name="QStyleOptionGroupBox::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionHeader::SectionPosition"/>
+  <enum-type name="QStyleOptionHeader::SelectedPosition"/>
+  <enum-type name="QStyleOptionHeader::SortIndicator"/>
+  <enum-type name="QStyleOptionHeader::StyleOptionType"/>
+  <enum-type name="QStyleOptionHeader::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionMenuItem::CheckType"/>
+  <enum-type name="QStyleOptionMenuItem::MenuItemType"/>
+  <enum-type name="QStyleOptionMenuItem::StyleOptionType"/>
+  <enum-type name="QStyleOptionMenuItem::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionProgressBar::StyleOptionType"/>
+  <enum-type name="QStyleOptionProgressBar::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionProgressBarV2::StyleOptionType"/>
+  <enum-type name="QStyleOptionProgressBarV2::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionRubberBand::StyleOptionType"/>
+  <enum-type name="QStyleOptionRubberBand::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionSizeGrip::StyleOptionType"/>
+  <enum-type name="QStyleOptionSizeGrip::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionSlider::StyleOptionType"/>
+  <enum-type name="QStyleOptionSlider::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionSpinBox::StyleOptionType"/>
+  <enum-type name="QStyleOptionSpinBox::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionTab::CornerWidget" flags="QStyleOptionTab::CornerWidgets"/>
+  <enum-type name="QStyleOptionTab::SelectedPosition"/>
+  <enum-type name="QStyleOptionTab::StyleOptionType"/>
+  <enum-type name="QStyleOptionTab::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionTab::TabPosition"/>
+  <enum-type name="QStyleOptionTabBarBase::StyleOptionType"/>
+  <enum-type name="QStyleOptionTabBarBase::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionTabV2::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionTabWidgetFrame::StyleOptionType"/>
+  <enum-type name="QStyleOptionTabWidgetFrame::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionTitleBar::StyleOptionType"/>
+  <enum-type name="QStyleOptionTitleBar::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionToolBar::StyleOptionType"/>
+  <enum-type name="QStyleOptionToolBar::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionToolBar::ToolBarFeature" flags="QStyleOptionToolBar::ToolBarFeatures"/>
+  <enum-type name="QStyleOptionToolBar::ToolBarPosition"/>
+  <enum-type name="QStyleOptionToolBox::StyleOptionType"/>
+  <enum-type name="QStyleOptionToolBox::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionToolButton::StyleOptionType"/>
+  <enum-type name="QStyleOptionToolButton::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionToolButton::ToolButtonFeature" flags="QStyleOptionToolButton::ToolButtonFeatures">
+    <reject-enum-value name="MenuButtonPopup"/>
+  </enum-type>
+  <enum-type name="QStyleOptionViewItem::Position"/>
+  <enum-type name="QStyleOptionViewItem::StyleOptionType"/>
+  <enum-type name="QStyleOptionViewItem::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionViewItemV2::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionViewItemV2::ViewItemFeature" flags="QStyleOptionViewItemV2::ViewItemFeatures"/>
+  <enum-type name="QSystemTrayIcon::ActivationReason"/>
+  <enum-type name="QSystemTrayIcon::MessageIcon"/>
+  <enum-type name="QTabBar::Shape"/>
+  <enum-type name="QTabWidget::TabPosition"/>
+  <enum-type name="QTabWidget::TabShape"/>
+  <enum-type name="QTableWidgetItem::ItemType"/>
+  <enum-type name="QTabletEvent::PointerType"/>
+  <enum-type name="QTabletEvent::TabletDevice"/>
+  <enum-type name="QTextCharFormat::UnderlineStyle"/>
+  <enum-type name="QTextCharFormat::VerticalAlignment"/>
+  <enum-type name="QTextCursor::MoveMode"/>
+  <enum-type name="QTextCursor::MoveOperation"/>
+  <enum-type name="QTextCursor::SelectionType"/>
+  <enum-type name="QTextDocument::FindFlag" flags="QTextDocument::FindFlags"/>
+  <enum-type name="QTextDocument::MetaInformation"/>
+  <enum-type name="QTextDocument::ResourceType"/>
+  <enum-type name="QTextEdit::AutoFormattingFlag" flags="QTextEdit::AutoFormatting"/>
+  <enum-type name="QTextEdit::LineWrapMode"/>
+  <enum-type name="QTextFormat::ObjectTypes"/>
+  <enum-type name="QTextFormat::PageBreakFlag" flags="QTextFormat::PageBreakFlags"/>
+  <enum-type name="QTextFrameFormat::Position"/>
+  <enum-type name="QTextFrameFormat::BorderStyle"/>
+  <enum-type name="QTextItem::RenderFlag" flags="QTextItem::RenderFlags"/>
+  <enum-type name="QTextLayout::CursorMode"/>
+  <enum-type name="QTextLength::Type"/>
+  <enum-type name="QTextLine::CursorPosition"/>
+  <enum-type name="QTextLine::Edge"/>
+  <enum-type name="QTextListFormat::Style"/>
+  <enum-type name="QTextOption::Flag" flags="QTextOption::Flags"/>
+  <enum-type name="QTextOption::WrapMode"/>
+  <enum-type name="QTextOption::TabType" />
+  <enum-type name="QToolButton::ToolButtonPopupMode"/>
+  <enum-type name="QTreeWidgetItem::ItemType"/>
+  <enum-type name="QTreeWidgetItemIterator::IteratorFlag" flags="QTreeWidgetItemIterator::IteratorFlags"/>
+  <enum-type name="QValidator::State"/>
+  <enum-type name="QWidget::RenderFlag" flags="QWidget::RenderFlags"/>
+  <enum-type name="QWorkspace::WindowOrder"/>
+  <enum-type name="QDoubleValidator::Notation"/>
+  <enum-type name="QGraphicsScene::SceneLayer" flags="QGraphicsScene::SceneLayers"/>
+  <enum-type name="QStyleOptionToolBoxV2::SelectedPosition"/>
+  <enum-type name="QStyleOptionToolBoxV2::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionToolBoxV2::TabPosition"/>
+  <enum-type name="QStyleOptionViewItemV3::StyleOptionVersion"/>
+  <enum-type name="QTransform::TransformationType"/>
+  <enum-type name="QTreeWidgetItem::ChildIndicatorPolicy"/>
+  <enum-type name="QWizard::WizardOption" flags="QWizard::WizardOptions"/>
+  <enum-type name="QWizard::WizardPixmap"/>
+  <enum-type name="QWizard::WizardStyle"/>
+  <enum-type name="QImageIOPlugin::Capability" flags="QImageIOPlugin::Capabilities" />
+  <enum-type name="QStackedLayout::StackingMode" />
+
+  <enum-type name="QWizard::WizardButton">
+    <reject-enum-value name="NStandardButtons"/>
+    <reject-enum-value name="NButtons"/>
+  </enum-type>
+
+  <enum-type name="QAccessible::Action">
+    <reject-enum-value name="FirstStandardAction"/>
+    <reject-enum-value name="LastStandardAction"/>
+  </enum-type>
+
+  <enum-type name="QBoxLayout::Direction">
+    <reject-enum-value name="Down"/>
+    <reject-enum-value name="Up"/>
+  </enum-type>
+
+
+  <enum-type name="QClipboard::Mode">
+    <reject-enum-value name="LastMode"/>
+  </enum-type>
+
+  <enum-type name="QDialogButtonBox::StandardButton" flags="QDialogButtonBox::StandardButtons">
+    <reject-enum-value name="FirstButton"/>
+    <reject-enum-value name="LastButton"/>
+    <reject-enum-value name="YesAll"/>
+    <reject-enum-value name="NoAll"/>
+    <reject-enum-value name="Default"/>
+    <reject-enum-value name="Escape"/>
+    <reject-enum-value name="FlagMask"/>
+    <reject-enum-value name="ButtonMask"/>
+  </enum-type>
+
+  <enum-type name="QDockWidget::DockWidgetFeature" flags="QDockWidget::DockWidgetFeatures"/>
+
+  <enum-type name="QFont::StyleHint">
+    <reject-enum-value name="SansSerif"/>
+    <reject-enum-value name="Serif"/>
+    <reject-enum-value name="TypeWriter"/>
+    <reject-enum-value name="Decorative"/>
+  </enum-type>
+
+  <enum-type name="QFontDatabase::WritingSystem">
+    <reject-enum-value name="Other"/>
+  </enum-type>
+
+  <enum-type name="QHeaderView::ResizeMode">
+    <reject-enum-value name="Custom"/>
+  </enum-type>
+
+
+  <enum-type name="QMessageBox::StandardButton" flags="QMessageBox::StandardButtons">
+    <reject-enum-value name="FirstButton"/>
+    <reject-enum-value name="LastButton"/>
+    <reject-enum-value name="YesAll"/>
+    <reject-enum-value name="NoAll"/>
+  </enum-type>
+
+  <enum-type name="QPalette::ColorGroup">
+    <reject-enum-value name="Normal"/>
+  </enum-type>
+
+  <enum-type name="QPalette::ColorRole">
+    <reject-enum-value name="NColorRoles"/>
+    <reject-enum-value name="Foreground"/>
+    <reject-enum-value name="Background"/>
+  </enum-type>
+
+  <enum-type name="QPrinter::PageSize">
+    <reject-enum-value name="NPageSize"/>
+    <reject-enum-value name="NPaperSize"/>
+  </enum-type>
+
+  <enum-type name="QSlider::TickPosition">
+    <reject-enum-value name="TicksLeft"/>
+    <reject-enum-value name="TicksRight"/>
+  </enum-type>
+
+  <enum-type name="QStyle::StyleHint" extensible="yes">
+    <reject-enum-value name="SH_ScrollBar_StopMouseOverSlider"/>
+  </enum-type>
+
+
+  <enum-type name="QTextFormat::FormatType"/>
+
+  <enum-type name="QTextFormat::Property">
+    <reject-enum-value name="FontSizeIncrement"/>
+    <reject-enum-value name="FirstFontProperty"/>
+    <reject-enum-value name="LastFontProperty"/>
+  </enum-type>
+
+  <value-type name="QTransform">
+    <modify-function signature="operator=(QTransform)" remove="all"/>
+    <modify-function signature="map(int,int,int*,int*)const" remove="all"/>
+    <modify-function signature="map(double,double,double*,double*)const" remove="all"/>
+
+    <modify-function signature="operator*=(double)" access="private"/>
+    <modify-function signature="operator+=(double)" access="private"/>
+    <modify-function signature="operator-=(double)" access="private"/>
+    <modify-function signature="operator/=(double)" access="private"/>
+    <modify-function signature="operator*(QTransform)const" rename="multiplied" />
+    <modify-function signature="operator*=(QTransform)" access="private"/>
+  </value-type>
+
+  <value-type name="QStyleOption" delete-in-main-thread="yes" polymorphic-base="yes" polymorphic-id-expression="%1-&gt;type == QStyleOption::SO_Default">
+      <modify-function signature="operator=(QStyleOption)" remove="all"/>
+      <modify-function signature="init(const QWidget*)" remove="all"/> <!--### Obsolete in 4.3-->
+  </value-type>
+  <value-type name="QStyleOptionGraphicsItem" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionGraphicsItem::Type &amp;&amp; %1-&gt;version == QStyleOptionGraphicsItem::Version"/>
+  <value-type name="QStyleOptionSizeGrip" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionSizeGrip::Type &amp;&amp; %1-&gt;version == QStyleOptionSizeGrip::Version"/>
+  <value-type name="QStyleOptionButton" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionButton::Type &amp;&amp; %1-&gt;version == QStyleOptionButton::Version"/>
+  <value-type name="QStyleOptionComboBox" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionComboBox::Type &amp;&amp; %1-&gt;version == QStyleOptionComboBox::Version"/>
+  <value-type name="QStyleOptionComplex" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionComplex::Type &amp;&amp; %1-&gt;version == QStyleOptionComplex::Version"/>
+  <value-type name="QStyleOptionDockWidget" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionDockWidget::Type &amp;&amp; %1-&gt;version == QStyleOptionDockWidget::Version"/>
+  <value-type name="QStyleOptionDockWidgetV2" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionDockWidgetV2::Type &amp;&amp; %1-&gt;version == QStyleOptionDockWidgetV2::Version">
+      <modify-function signature="operator=(QStyleOptionDockWidget)" remove="all"/>
+  </value-type>
+  <value-type name="QStyleOptionFocusRect" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionFocusRect::Type &amp;&amp; %1-&gt;version == QStyleOptionFocusRect::Version"/>
+  <value-type name="QStyleOptionFrame" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionFrame::Type &amp;&amp; %1-&gt;version == QStyleOptionFrame::Version"/>
+
+  <value-type name="QStyleOptionFrameV2" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionFrameV2::Type &amp;&amp; %1-&gt;version == QStyleOptionFrameV2::Version">
+    <modify-function signature="operator=(QStyleOptionFrame)" remove="all"/>
+  </value-type>
+
+  <value-type name="QStyleOptionGroupBox" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionGroupBox::Type &amp;&amp; %1-&gt;version == QStyleOptionGroupBox::Version"/>
+  <value-type name="QStyleOptionHeader" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionHeader::Type &amp;&amp; %1-&gt;version == QStyleOptionHeader::Version"/>
+  <value-type name="QStyleOptionMenuItem" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionMenuItem::Type &amp;&amp; %1-&gt;version == QStyleOptionMenuItem::Version"/>
+  <value-type name="QStyleOptionProgressBar" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionProgressBar::Type &amp;&amp; %1-&gt;version == QStyleOptionProgressBar::Version"/>
+
+  <value-type name="QStyleOptionProgressBarV2" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionProgressBarV2::Type &amp;&amp; %1-&gt;version == QStyleOptionProgressBarV2::Version">
+    <modify-function signature="operator=(QStyleOptionProgressBar)" remove="all"/>
+  </value-type>
+
+  <value-type name="QStyleOptionRubberBand" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionRubberBand::Type &amp;&amp; %1-&gt;version == QStyleOptionRubberBand::Version"/>
+  <value-type name="QStyleOptionSlider" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionSlider::Type &amp;&amp; %1-&gt;version == QStyleOptionSlider::Version"/>
+  <value-type name="QStyleOptionSpinBox" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionSpinBox::Type &amp;&amp; %1-&gt;version == QStyleOptionSpinBox::Version"/>
+  <value-type name="QStyleOptionTab" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionTab::Type &amp;&amp; %1-&gt;version == QStyleOptionTab::Version"/>
+  <value-type name="QStyleOptionTabV2" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionTabV2::Type &amp;&amp; %1-&gt;version == QStyleOptionTabV2::Version">
+    <modify-function signature="operator=(const QStyleOptionTab &amp;)" remove="all"/>
+  </value-type>
+  <value-type name="QStyleOptionTabBarBase" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionTabBarBase::Type &amp;&amp; %1-&gt;version == QStyleOptionTabBarBase::Version"/>
+  <value-type name="QStyleOptionTabWidgetFrame" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionTabWidgetFrame::Type &amp;&amp; %1-&gt;version == QStyleOptionTabWidgetFrame::Version"/>
+  <value-type name="QStyleOptionTitleBar" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionTitleBar::Type &amp;&amp; %1-&gt;version == QStyleOptionTitleBar::Version"/>
+  <value-type name="QStyleOptionToolBar" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionToolBar::Type &amp;&amp; %1-&gt;version == QStyleOptionToolBar::Version"/>
+  <value-type name="QStyleOptionToolBox" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionToolBox::Type &amp;&amp; %1-&gt;version == QStyleOptionToolBox::Version"/>
+  <value-type name="QStyleOptionToolBoxV2" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionToolBoxV2::Type &amp;&amp; %1-&gt;version == QStyleOptionToolBoxV2::Version">
+    <modify-function signature="operator=(QStyleOptionToolBox)" remove="all"/>
+  </value-type>
+  <value-type name="QStyleOptionToolButton" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionToolButton::Type &amp;&amp; %1-&gt;version == QStyleOptionToolButton::Version"/>
+  <value-type name="QStyleOptionViewItem" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionViewItem::Type &amp;&amp; %1-&gt;version == QStyleOptionViewItem::Version"/>
+  <value-type name="QStyleOptionViewItemV2" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionViewItemV2::Type &amp;&amp; %1-&gt;version == QStyleOptionViewItemV2::Version">
+    <modify-function signature="operator=(QStyleOptionViewItem)" remove="all"/>
+  </value-type>
+  <value-type name="QStyleOptionViewItemV3" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionViewItemV3::Type &amp;&amp; %1-&gt;version == QStyleOptionViewItemV3::Version">
+    <modify-function signature="operator=(QStyleOptionViewItem)" remove="all"/>
+  </value-type>
+  <value-type name="QStyleOptionViewItemV4" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionViewItemV4::Type &amp;&amp; %1-&gt;version == QStyleOptionViewItemV4::Version">
+    <modify-function signature="operator=(QStyleOptionViewItem)" remove="all" />
+  </value-type>
+  <value-type name="QTextFragment" delete-in-main-thread="yes">
+    <modify-function signature="operator=(QTextFragment)" remove="all"/>
+  </value-type>
+  <value-type name="QBitmap" delete-in-main-thread="yes">
+    <modify-function signature="operator=(const QPixmap &amp;)" remove="all"/>
+    <modify-function signature="QBitmap(QString,const char*)" access="private">
+        <modify-argument index="2"> <remove-default-expression/> </modify-argument>
+    </modify-function>
+
+    <modify-function signature="fromData(QSize,const unsigned char*,QImage::Format)">
+        <access modifier="private"/>
+        <modify-argument index="3">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+  </value-type>
+  <value-type name="QTextInlineObject" delete-in-main-thread="yes"/>
+  <value-type name="QSizePolicy"/>
+  <value-type name="QTableWidgetSelectionRange"/>
+  <value-type name="QTextDocumentFragment" delete-in-main-thread="yes">
+    <modify-function signature="operator=(QTextDocumentFragment)" remove="all"/>
+  </value-type>
+  <value-type name="QTextOption" delete-in-main-thread="yes">
+    <modify-function signature="operator=(const QTextOption &amp;)" remove="all"/>
+  </value-type>
+  <value-type name="QTextLine" delete-in-main-thread="yes">
+    <modify-function signature="cursorToX(int*,QTextLine::Edge)const">
+        <remove/>
+    </modify-function>
+  </value-type>
+  <value-type name="QTextTableFormat" delete-in-main-thread="yes"/>
+  <value-type name="QTextImageFormat" delete-in-main-thread="yes"/>
+  <value-type name="QTextFrameFormat" delete-in-main-thread="yes">
+    <modify-function signature="isValid()const" access="non-final"/>
+  </value-type>
+  <value-type name="QTextLength" delete-in-main-thread="yes"/>
+  <value-type name="QItemSelectionRange">
+      <modify-function signature="intersect(QItemSelectionRange)const" remove="all"/> <!--### Obsolete in 4.3-->
+  </value-type>
+
+  <value-type name="QPainterPath">
+    <modify-function signature="operator=(QPainterPath)" remove="all"/>
+  </value-type>
+  <value-type name="QPalette">
+    <modify-function signature="operator=(const QPalette&amp;)" remove="all"/>
+
+      <modify-function signature="QPalette(QColor, QColor, QColor, QColor, QColor, QColor, QColor)" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="background()const" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="foreground()const" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="serialNumber()const" remove="all"/> <!--### Obsolete in 4.3-->
+  </value-type>
+  <value-type name="QKeySequence">
+    <modify-function signature="operator=(QKeySequence)" remove="all"/>
+    <modify-function signature="operator int()const" access="private"/>
+    <modify-function signature="operator[](uint)const" access="private"/>
+  </value-type>
+
+  <value-type name="QPicture" delete-in-main-thread="yes">
+    <modify-function signature="operator=(QPicture)" remove="all"/>
+    <modify-function signature="pictureFormat(QString)">
+        <remove/>
+    </modify-function>
+
+    <modify-function signature="inputFormatList()" remove="all"/> <!--### Obsolete in 4.3-->
+    <modify-function signature="inputFormats()" remove="all"/> <!--### Obsolete in 4.3-->
+    <modify-function signature="outputFormatList()" remove="all"/> <!--### Obsolete in 4.3-->
+    <modify-function signature="outputFormats()" remove="all"/> <!--### Obsolete in 4.3-->
+  </value-type>
+
+  <value-type name="QRegion" expense-limit="4096">
+    <modify-function signature="operator=(QRegion)" remove="all"/>
+    <modify-function signature="operator&amp;=(QRegion)" remove="all"/>
+    <modify-function signature="operator+=(QRegion)" remove="all"/>
+    <modify-function signature="operator-=(QRegion)" remove="all"/>
+    <modify-function signature="operator^=(QRegion)" remove="all"/>
+    <modify-function signature="operator|=(QRegion)" remove="all"/>
+    <modify-function signature="operator&amp;(QRegion)const" remove="all"/>
+    <modify-function signature="operator+(QRegion)const" remove="all"/>
+    <modify-function signature="operator-(QRegion)const" remove="all"/>
+    <modify-function signature="operator^(QRegion)const" remove="all"/>
+    <modify-function signature="operator|(QRegion)const" remove="all"/>
+    <modify-function signature="eor(QRegion)const" remove="all"/> <!--### Obsolete in 4.3-->
+    <modify-function signature="intersect(QRegion)const" remove="all"/> <!--### Obsolete in 4.3-->
+    <modify-function signature="subtract(QRegion)const" remove="all"/> <!--### Obsolete in 4.3-->
+    <modify-function signature="unite(QRegion)const" remove="all"/> <!--### Obsolete in 4.3-->
+    <modify-function signature="operator&amp;=(QRect)" remove="all" />
+    <modify-function signature="operator+=(QRect)" remove="all" />
+
+  </value-type>
+
+  <value-type name="QTextBlock" delete-in-main-thread="yes">
+    <modify-function signature="operator=(QTextBlock)" remove="all"/>
+    <modify-function signature="setUserData(QTextBlockUserData *)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+     </modify-function>
+  </value-type>
+  <value-type name="QTextBlockFormat" delete-in-main-thread="yes"/>
+  <value-type name="QTextTableCellFormat" delete-in-main-thread="yes" />
+  <value-type name="QTextCharFormat" delete-in-main-thread="yes">
+    <modify-function signature="isValid()const" access="non-final"/>
+
+      <modify-function signature="anchorName()const" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="setAnchorName(QString)" remove="all"/> <!--### Obsolete in 4.3-->
+  </value-type>
+  <value-type name="QTextFormat" delete-in-main-thread="yes">
+    <modify-function signature="operator=(QTextFormat)" remove="all"/>
+    <modify-function signature="isValid()const" access="non-final"/>
+
+  </value-type>
+
+  <value-type name="QTextListFormat" delete-in-main-thread="yes"/>
+  <value-type name="QPolygon">
+    <modify-function signature="QPolygon(int, const int *)" remove="all"/>
+    <modify-function signature="operator+(QVector&lt;QPoint&gt;)const" remove="all"/>
+    <modify-function signature="operator&lt;&lt;(QPoint)" remove="all"/>
+    <modify-function signature="operator&lt;&lt;(QVector&lt;QPoint&gt;)" remove="all"/>
+
+
+  </value-type>
+
+  <value-type name="QPolygonF">
+    <modify-function signature="operator+(QVector&lt;QPointF&gt;)const" remove="all"/>
+    <modify-function signature="operator&lt;&lt;(QPointF)" remove="all"/>
+    <modify-function signature="operator&lt;&lt;(QVector&lt;QPointF&gt;)" remove="all"/>
+  </value-type>
+
+  <value-type name="QIcon" delete-in-main-thread="yes">
+    <modify-function signature="operator=(QIcon)" remove="all"/>
+    <modify-function signature="serialNumber()const" remove="all"/> <!--### Obsolete in 4.3-->
+    <modify-function signature="QIcon(QIconEngineV2 *)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++" />
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="QIcon(QIconEngine *)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++" />
+        </modify-argument>
+    </modify-function>
+  </value-type>
+
+  <value-type name="QTextFrame::iterator" delete-in-main-thread="yes">
+    <include file-name="QTextFrame" location="global"/>
+    <modify-function signature="operator++(int)" remove="all"/>
+    <modify-function signature="operator--(int)" remove="all"/>
+    <modify-function signature="operator=(QTextFrame::iterator)" remove="all"/>
+    <modify-function signature="operator++()" access="private"/>
+    <modify-function signature="operator--()" access="private"/>
+  </value-type>
+
+  <value-type name="QTreeWidgetItemIterator" delete-in-main-thread="yes">
+    <custom-constructor>
+    return new QTreeWidgetItemIterator(*copy);
+    </custom-constructor>
+    <custom-destructor>
+    delete copy;
+    </custom-destructor>
+    <modify-function signature="operator=(QTreeWidgetItemIterator)" remove="all"/>
+    <modify-function signature="operator++(int)" remove="all"/>
+    <modify-function signature="operator--(int)" remove="all"/>
+    <modify-function signature="operator+=(int)" access="private"/>
+    <modify-function signature="operator-=(int)" access="private"/>
+    <modify-function signature="operator++()" access="private"/>
+    <modify-function signature="operator--()" access="private"/>
+    <modify-function signature="operator*()const" access="private"/>
+   </value-type>
+
+  <value-type name="QTextBlock::iterator" delete-in-main-thread="yes">
+    <include file-name="QTextBlock" location="global"/>
+
+    <modify-function signature="operator++()" access="private"/>
+    <modify-function signature="operator--()" access="private"/>
+    <modify-function signature="operator++(int)" remove="all"/>
+    <modify-function signature="operator--(int)" remove="all"/>
+   </value-type>
+
+  <value-type name="QAbstractTextDocumentLayout::PaintContext" delete-in-main-thread="yes">
+    <include file-name="QAbstractTextDocumentLayout" location="global"/>
+  </value-type>
+  <value-type name="QAbstractTextDocumentLayout::Selection" delete-in-main-thread="yes"/>
+
+  <value-type name="QPixmap" delete-in-main-thread="yes">
+    <modify-function signature="operator=(QPixmap)" remove="all"/>
+    <modify-function signature="operator!()const" remove="all"/>
+    <modify-function signature="QPixmap(const char **)" access="private"/>
+    <modify-function signature="serialNumber()const" remove="all"/> <!--### Obsolete in 4.3-->
+  </value-type>
+
+  <value-type name="QTextCursor" delete-in-main-thread="yes">
+    <extra-includes>
+        <include file-name="QTextBlock" location="global"/>
+        <include file-name="QTextDocumentFragment" location="global"/>
+    </extra-includes>
+    <modify-function signature="operator=(QTextCursor)" remove="all"/>
+    <modify-function signature="selectedTableCells(int*,int*,int*,int*)const">
+        <access modifier="private"/>
+    </modify-function>
+  </value-type>
+
+  <value-type name="QTextLayout::FormatRange">
+    <include file-name="QTextLayout" location="global"/>
+  </value-type>
+
+  <value-type name="QInputMethodEvent::Attribute">
+    <include file-name="QInputMethodEvent" location="global"/>
+    <custom-constructor>
+    return new QInputMethodEvent::Attribute(copy-&gt;type, copy-&gt;start, copy-&gt;length, copy-&gt;value);
+    </custom-constructor>
+    <custom-destructor>
+    delete copy;
+    </custom-destructor>
+  </value-type>
+
+  <value-type name="QItemSelection" delete-in-main-thread="yes">
+
+    <modify-function signature="operator+(const QList&lt;QItemSelectionRange&gt;&amp;)const" remove="all"/>
+    <modify-function signature="operator+=(const QList&lt;QItemSelectionRange&gt;&amp;)" remove="all"/>
+    <modify-function signature="operator+=(const QItemSelectionRange&amp;)" remove="all"/>
+    <modify-function signature="operator&lt;&lt;(const QList&lt;QItemSelectionRange&gt;&amp;)" remove="all"/>
+    <modify-function signature="operator&lt;&lt;(QItemSelectionRange)" remove="all"/>
+  </value-type>
+
+  <value-type name="QMatrix">
+      <extra-includes>
+        <include file-name="QPainterPath" location="global"/>
+      </extra-includes>
+
+      <modify-function signature="map(int,int,int*,int*)const" remove="all"/>
+      <modify-function signature="map(double,double,double*,double*)const" remove="all"/>
+      <modify-function signature="operator=(QMatrix)" remove="all"/>
+
+      <modify-function signature="operator*(QMatrix)const" access="private"/>
+      <modify-function signature="operator*=(QMatrix)" access="private"/>
+      <modify-function signature="rotate(double)" access="private" rename="rotate_private"/>
+      <modify-function signature="scale(double,double)" access="private" rename="scale_private"/>
+      <modify-function signature="shear(double,double)" access="private" rename="shear_private"/>
+      <modify-function signature="translate(double,double)" access="private" rename="translate_private"/>
+
+      <modify-function signature="inverted(bool*)const">
+        <access modifier="private"/>
+        <modify-argument index="1">
+            <remove-default-expression/>
+        </modify-argument>
+      </modify-function>
+
+    <inject-code>
+      <insert-template name="core.unary_other_type">
+        <replace from="%FUNCTION_NAME" to="rotate"/>
+        <replace from="%OUT_TYPE" to="QMatrix"/>
+        <replace from="%IN_TYPE" to="double"/>
+      </insert-template>
+
+      <insert-template name="core.private_function_return_self">
+        <replace from="%RETURN_TYPE" to="QMatrix"/>
+        <replace from="%FUNCTION_NAME" to="scale"/>
+        <replace from="%ARGUMENTS" to="double sx, double sy"/>
+        <replace from="%ARGUMENT_NAMES" to="sx, sy"/>
+      </insert-template>
+
+      <insert-template name="core.private_function_return_self">
+        <replace from="%RETURN_TYPE" to="QMatrix"/>
+        <replace from="%FUNCTION_NAME" to="shear"/>
+        <replace from="%ARGUMENTS" to="double sh, double sv"/>
+        <replace from="%ARGUMENT_NAMES" to="sh, sv"/>
+      </insert-template>
+
+      <insert-template name="core.private_function_return_self">
+        <replace from="%RETURN_TYPE" to="QMatrix"/>
+        <replace from="%FUNCTION_NAME" to="translate"/>
+        <replace from="%ARGUMENTS" to="double dx, double dy"/>
+        <replace from="%ARGUMENT_NAMES" to="dx, dy"/>
+      </insert-template>
+    </inject-code>
+  </value-type>
+
+  <value-type name="QConicalGradient" polymorphic-id-expression="%1-&gt;type() == QGradient::ConicalGradient">
+    <custom-constructor>
+    return new QConicalGradient(copy-&gt;center(), copy-&gt;angle());
+    </custom-constructor>
+    <custom-destructor>
+    delete copy;
+    </custom-destructor>
+  </value-type>
+
+  <value-type name="QFontInfo" delete-in-main-thread="yes" expense-cost="1" expense-limit="1000">
+    <custom-constructor>
+    return new QFontInfo(*copy);
+    </custom-constructor>
+    <custom-destructor>
+    delete copy;
+    </custom-destructor>
+    <modify-function signature="operator=(QFontInfo)" remove="all"/>
+
+  </value-type>
+
+  <value-type name="QRadialGradient" polymorphic-id-expression="%1-&gt;type() == QGradient::RadialGradient">
+    <custom-constructor>
+    return new QRadialGradient(copy-&gt;center(), copy-&gt;radius(), copy-&gt;focalPoint());
+    </custom-constructor>
+    <custom-destructor>
+    delete copy;
+    </custom-destructor>
+  </value-type>
+
+  <value-type name="QPainterPath::Element">
+    <modify-field name="x" write="false"/>
+    <modify-field name="y" write="false"/>
+    <modify-field name="type" write="false"/>
+    <include file-name="QPainterPath" location="global"/>
+    <modify-function signature="operator QPointF()const" access="private"/>
+  </value-type>
+
+  <value-type name="QTextEdit::ExtraSelection" delete-in-main-thread="yes">
+    <include file-name="QTextEdit" location="global"/>
+  </value-type>
+
+  <value-type name="QFont" delete-in-main-thread="yes" expense-cost="1" expense-limit="1000">
+    <extra-includes>
+        <include file-name="QStringList" location="global"/>
+    </extra-includes>
+    <modify-function signature="operator=(QFont)" remove="all"/>
+  </value-type>
+
+  <value-type name="QTextTableCell" delete-in-main-thread="yes">
+    <extra-includes>
+        <include file-name="QTextCursor" location="global"/>
+    </extra-includes>
+    <modify-function signature="operator=(QTextTableCell)" remove="all"/>
+  </value-type>
+
+  <value-type name="QImage" expense-limit="67108864" expense-cost="height()*bytesPerLine()">
+    <modify-function signature="QImage(const char *, const char *)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="QImage(const char **)">
+        <access modifier="private"/>
+    </modify-function>
+    <modify-function signature="QImage(const unsigned char*,int,int,int,QImage::Format)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="bits()const">
+        <remove/>
+    </modify-function>
+    <modify-function signature="scanLine(int)const">
+        <remove/>
+    </modify-function>
+    <modify-function signature="QImage(const unsigned char *, int, int, QImage::Format)">
+        <remove/>
+    </modify-function>
+
+    <extra-includes>
+        <include file-name="QStringList" location="global"/>
+        <include file-name="QMatrix" location="global"/>
+    </extra-includes>
+    <modify-function signature="save(const QString &amp;, const char *, int) const">
+        <access modifier="private"/>
+        <rename to="private_save"/>
+        <modify-argument index="2">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="3">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="QImage(unsigned char*,int,int,QImage::Format)">
+        <access modifier="private"/>
+    </modify-function>
+
+    <modify-function signature="QImage(QString,const char*)">
+        <access modifier="private"/>
+        <modify-argument index="2">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="load(QString,const char*)">
+        <access modifier="private"/>
+        <modify-argument index="2">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="load(QIODevice*,const char*)">
+        <access modifier="private"/>
+    </modify-function>
+
+    <modify-function signature="loadFromData(const unsigned char*,int,const char*)">
+        <access modifier="private"/>
+        <modify-argument index="2">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="3">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="loadFromData(QByteArray,const char*)">
+        <access modifier="private"/>
+        <modify-argument index="2">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="operator=(QImage)" remove="all"/>
+
+    <modify-function signature="setText(const char*,const char*,QString)">
+        <remove/>
+    </modify-function>
+
+    <modify-function signature="text(const char*,const char*)const">
+        <remove/>
+    </modify-function>
+
+    <modify-function signature="fromData(QByteArray,const char*)">
+        <access modifier="private"/>
+        <modify-argument index="2">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="fromData(const unsigned char*,int,const char*)">
+        <remove/>
+    </modify-function>
+
+      <modify-function signature="serialNumber()const" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="textLanguages()const" remove="all"/> <!--### Obsolete in 4.3-->
+  </value-type>
+
+  <value-type name="QColormap" delete-in-main-thread="yes">
+    <modify-function signature="operator=(QColormap)" remove="all"/>
+    <extra-includes>
+        <include file-name="QColor" location="global"/>
+    </extra-includes>
+    <custom-constructor>
+    return new QColormap(*copy);
+    </custom-constructor>
+    <custom-destructor>
+    delete copy;
+    </custom-destructor>
+  </value-type>
+
+  <value-type name="QCursor" delete-in-main-thread="yes">
+     <extra-includes>
+        <include file-name="QPixmap" location="global"/>
+    </extra-includes>
+    <modify-function signature="operator=(QCursor)" remove="all"/>
+  </value-type>
+
+  <value-type name="QFontDatabase" delete-in-main-thread="yes">
+      <extra-includes>
+        <include file-name="QStringList" location="global"/>
+    </extra-includes>
+  </value-type>
+
+  <value-type name="QPen">
+      <extra-includes>
+        <include file-name="QBrush" location="global"/>
+    </extra-includes>
+
+    <modify-function signature="operator=(QPen)" remove="all"/>
+  </value-type>
+
+  <value-type name="QBrush">
+    <modify-function signature="QBrush(Qt::GlobalColor, Qt::BrushStyle)" remove="all"/>
+    <modify-function signature="operator=(const QBrush &amp;)" remove="all"/>
+
+    <extra-includes>
+        <include file-name="QPixmap" location="global"/>
+    </extra-includes>
+  </value-type>
+
+  <value-type name="QColor">
+    <modify-function signature="QColor(QColor::Spec)" remove="all"/>
+    <modify-function signature="operator=(QColor)" remove="all"/>
+    <modify-function signature="operator=(Qt::GlobalColor)" remove="all"/>
+
+    <modify-function signature="QColor(const char*)">
+        <remove/>
+    </modify-function>
+
+    <modify-function signature="getCmyk(int*,int*,int*,int*,int*)">
+        <remove/>
+    </modify-function>
+
+    <modify-function signature="getCmykF(double*,double*,double*,double*,double*)">
+        <remove/>
+    </modify-function>
+
+    <modify-function signature="getHsv(int*,int*,int*,int*)const">
+        <remove/>
+    </modify-function>
+
+    <modify-function signature="getHsvF(double*,double*,double*,double*)const">
+        <remove/>
+    </modify-function>
+
+    <modify-function signature="getRgb(int*,int*,int*,int*)const">
+        <remove/>
+    </modify-function>
+
+    <modify-function signature="getRgbF(double*,double*,double*,double*)const">
+        <remove/>
+    </modify-function>
+
+      <modify-function signature="dark(int)const" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="light(int)const" remove="all"/> <!--### Obsolete in 4.3-->
+  </value-type>
+
+  <value-type name="QFontMetricsF" delete-in-main-thread="yes" expense-cost="1" expense-limit="1000">
+    <custom-constructor>
+        return new QFontMetricsF(*copy);
+    </custom-constructor>
+    <custom-destructor>
+        delete copy;
+    </custom-destructor>
+    <modify-function signature="operator!=(const QFontMetricsF &amp;)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="operator==(const QFontMetricsF &amp;)">
+        <remove/>
+    </modify-function>
+
+    <modify-function signature="boundingRect(QRectF,int,QString,int,int*)const">
+        <access modifier="private"/>
+        <modify-argument index="4">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="5">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="operator=(QFontMetrics)" remove="all"/>
+    <modify-function signature="operator=(QFontMetricsF)" remove="all"/>
+
+    <modify-function signature="size(int,QString,int,int*)const">
+        <access modifier="private"/>
+        <modify-argument index="3">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="4">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+   </value-type>
+   <value-type name="QTextOption::Tab" />
+
+  <value-type name="QFontMetrics" delete-in-main-thread="yes" expense-cost="1" expense-limit="1000">
+    <custom-constructor>
+        return new QFontMetrics(*copy);
+    </custom-constructor>
+    <custom-destructor>
+        delete copy;
+    </custom-destructor>
+    <modify-function signature="operator!=(const QFontMetrics &amp;)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="operator==(const QFontMetrics &amp;)">
+        <remove/>
+    </modify-function>
+
+    <modify-function signature="boundingRect(int,int,int,int,int,QString,int,int*)const">
+        <access modifier="private"/>
+        <modify-argument index="7">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="8">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="boundingRect(QRect,int,QString,int,int*)const">
+        <access modifier="private"/>
+        <modify-argument index="4">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="5">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="operator=(QFontMetrics)" remove="all"/>
+
+    <modify-function signature="size(int,QString,int,int*)const">
+        <access modifier="private"/>
+        <modify-argument index="3">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="4">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+
+  </value-type>
+
+  <value-type name="QGradient" force-abstract="yes" polymorphic-base="yes" polymorphic-id-expression="%1-&gt;type() == QGradient::NoGradient">
+    <custom-constructor>
+    Q_UNUSED(copy)
+    qWarning("Copying empty QGradient object");
+    return new QGradient();
+    </custom-constructor>
+    <custom-destructor>
+    delete copy;
+    </custom-destructor>
+    <modify-function signature="operator==(const QGradient &amp;)">
+        <remove/>
+    </modify-function>
+  </value-type>
+
+  <value-type name="QLinearGradient" polymorphic-id-expression="%1-&gt;type() == QGradient::LinearGradient">
+    <custom-constructor>
+    QLinearGradient *lg = new QLinearGradient(copy-&gt;start(), copy-&gt;finalStop());
+    lg-&gt;setSpread(copy-&gt;spread());
+    lg-&gt;setStops(copy-&gt;stops());
+    return (void *) lg;
+    </custom-constructor>
+    <custom-destructor>
+    delete copy;
+    </custom-destructor>
+  </value-type>
+
+  <value-type name="QPrinterInfo">
+    <modify-function signature="operator=(const QPrinterInfo &amp;)" remove="all" />
+  </value-type>
+
+  <interface-type name="QLayoutItem"/>
+  <interface-type name="QPaintDevice"/>
+
+  <interface-type name="QGraphicsItem" delete-in-main-thread="yes">
+    <modify-function signature="setMatrix(QMatrix, bool)" remove="all"/>
+
+    <modify-function signature="paint(QPainter*,const QStyleOptionGraphicsItem*,QWidget*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="collidesWithItem(const QGraphicsItem*,Qt::ItemSelectionMode)const">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+
+    <modify-function signature="contextMenuEvent(QGraphicsSceneContextMenuEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="dragEnterEvent(QGraphicsSceneDragDropEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="dragLeaveEvent(QGraphicsSceneDragDropEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="dragMoveEvent(QGraphicsSceneDragDropEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="dropEvent(QGraphicsSceneDragDropEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="focusInEvent(QFocusEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="focusOutEvent(QFocusEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="hoverEnterEvent(QGraphicsSceneHoverEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="hoverLeaveEvent(QGraphicsSceneHoverEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="hoverMoveEvent(QGraphicsSceneHoverEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="inputMethodEvent(QInputMethodEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="isObscuredBy(const QGraphicsItem*)const">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="keyPressEvent(QKeyEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="keyReleaseEvent(QKeyEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="mouseDoubleClickEvent(QGraphicsSceneMouseEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="mouseMoveEvent(QGraphicsSceneMouseEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="mousePressEvent(QGraphicsSceneMouseEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="mouseReleaseEvent(QGraphicsSceneMouseEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="sceneEvent(QEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="sceneEventFilter(QGraphicsItem*,QEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+        <modify-argument index="2" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="wheelEvent(QGraphicsSceneWheelEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+
+    <modify-function signature="children()const" remove="all"/>
+    <modify-function signature="installSceneEventFilter(QGraphicsItem *)">
+        <modify-argument index="1">
+            <!-- Safe to ignore because items in a scene are memory managed by the scene -->
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="removeSceneEventFilter(QGraphicsItem *)">
+        <modify-argument index="1">
+            <!-- Safe to ignore because items in a scene are memory managed by the scene -->
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="matrix()const" remove="all"/> <!--### Obsolete in 4.3-->
+    <modify-function signature="resetMatrix()" remove="all"/> <!--### Obsolete in 4.3-->
+    <modify-function signature="sceneMatrix()const" remove="all"/> <!--### Obsolete in 4.3-->
+    <modify-function signature="setMatrix(QMatrix, bool)" remove="all"/> <!--### Obsolete in 4.3-->
+  </interface-type>
+
+  <object-type name="QAbstractGraphicsShapeItem" delete-in-main-thread="yes">
+    <modify-function signature="QAbstractGraphicsShapeItem(QGraphicsItem*,QGraphicsScene*)">
+        <inject-code position="end">
+            <argument-map index="1" meta-name="%1"/>
+            if (%1 != null) disableGarbageCollection();
+        </inject-code>
+    </modify-function>
+
+    <modify-function signature="matrix()const" remove="all"/> <!--### Obsolete in 4.3-->
+    <modify-function signature="resetMatrix()" remove="all"/> <!--### Obsolete in 4.3-->
+    <modify-function signature="sceneMatrix()const" remove="all"/> <!--### Obsolete in 4.3-->
+    <modify-function signature="setMatrix(QMatrix, bool)" remove="all"/> <!--### Obsolete in 4.3-->
+  </object-type>
+
+  <object-type name="QAbstractItemView">
+      <modify-function signature="update()" remove="all"/>
+      <modify-function signature="horizontalStepsPerItem()const" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="setHorizontalStepsPerItem(int)" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="setVerticalStepsPerItem(int)" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="verticalStepsPerItem()const" remove="all"/> <!--### Obsolete in 4.3-->
+
+      <modify-function signature="edit(QModelIndex,QAbstractItemView::EditTrigger,QEvent*)">
+        <modify-argument index="3" invalidate-after-use="yes" />
+      </modify-function>
+      <modify-function signature="selectionCommand(QModelIndex,const QEvent*)const">
+        <modify-argument index="2" invalidate-after-use="yes" />
+      </modify-function>
+
+  </object-type>
+
+  <object-type name="QAbstractPageSetupDialog"/>
+  <object-type name="QAbstractPrintDialog"/>
+  <object-type name="QAbstractSlider"/>
+  <object-type name="QAbstractTextDocumentLayout">
+    <modify-function signature="setPaintDevice(QPaintDevice*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcPaintDevice"/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="draw(QPainter*,QAbstractTextDocumentLayout::PaintContext)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="drawInlineObject(QPainter*,QRectF,QTextInlineObject,int,QTextFormat)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+
+  </object-type>
+  <object-type name="QAccessible">
+    <modify-function signature="initialize()" remove="all"/>
+    <modify-function signature="cleanup()" remove="all"/>
+    <modify-function signature="setRootObject(QObject *)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="queryAccessibleInterface(QObject *)">
+        <modify-argument index="return">
+            <define-ownership class="java" owner="java" />
+        </modify-argument>
+    </modify-function>
+  </object-type>
+  <object-type name="QAccessibleBridge">
+    <modify-function signature="setRootObject(QAccessibleInterface *)">
+        <modify-argument index="1">
+            <define-ownership class="shell" owner="java" />
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="notifyAccessibilityUpdate(int,QAccessibleInterface*,int)">
+        <modify-argument invalidate-after-use="yes" index="2" />
+    </modify-function>
+  </object-type>
+  <object-type name="QAccessible2Interface"/>
+  <object-type name="QAccessibleTableInterface">
+    <modify-function signature="qAccessibleTableCastHelper()" remove="all"/>
+  </object-type>
+
+  <object-type name="QAccessibleInterface">
+    <modify-function signature="indexOfChild(const QAccessibleInterface*)const">
+        <modify-argument invalidate-after-use="yes" index="1" />
+    </modify-function>
+    <modify-function signature="relationTo(int,const QAccessibleInterface*,int)const">
+        <modify-argument invalidate-after-use="yes" index="2" />
+    </modify-function>
+  </object-type>
+  <object-type name="QAccessibleInterfaceEx"/>
+  <object-type name="QAccessibleObject"/>
+  <object-type name="QAccessibleObjectEx"/>
+  <object-type name="QAccessibleWidget"/>
+  <object-type name="QAccessibleWidgetEx"/>
+  <object-type name="QActionGroup" />
+  <object-type name="QCDEStyle">
+      <modify-function signature="standardIconImplementation(QStyle::StandardPixmap, const QStyleOption *, const QWidget *)const" virtual-slot="yes"/>
+  </object-type>
+  <object-type name="QCheckBox">
+    <modify-function signature="initStyleOption(QStyleOptionButton*)const">
+        <access modifier="private"/>
+    </modify-function>
+  </object-type>
+  <object-type name="QCleanlooksStyle">
+    <modify-function signature="standardPixmap(QStyle::StandardPixmap,const QStyleOption*,const QWidget*)const" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="standardIconImplementation(QStyle::StandardPixmap, const QStyleOption *, const QWidget *)const" virtual-slot="yes"/>
+  </object-type>
+  <object-type name="QCommonStyle">
+      <modify-function signature="standardPixmap(QStyle::StandardPixmap, const QStyleOption*,const QWidget*)const" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="standardIconImplementation(QStyle::StandardPixmap, const QStyleOption *, const QWidget *)const" virtual-slot="yes"/>
+  </object-type>
+  <object-type name="QDataWidgetMapper">
+    <modify-function signature="addMapping(QWidget*,int)">
+        <modify-argument index="1">
+            <reference-count action="add" variable-name="__rcMappings"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="addMapping(QWidget*,int,QByteArray)">
+        <modify-argument index="1">
+            <reference-count action="add" variable-name="__rcMappings"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="removeMapping(QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="remove" variable-name="__rcMappings"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setItemDelegate(QAbstractItemDelegate*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcItemDelegate"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setModel(QAbstractItemModel*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcModel"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+  <object-type name="QDateEdit"/>
+  <object-type name="QDesktopServices">
+    <modify-function signature="setUrlHandler(const QString &amp;, QObject *, const char *)" access="private">
+        <modify-argument index="2">
+            <reference-count action="ignore" /> <!-- Handled in injected code -->
+        </modify-argument>
+    </modify-function>
+  </object-type>
+  <object-type name="QDialog">
+    <modify-function signature="setExtension(QWidget*)" remove="all"/>
+    <modify-function signature="exec()" access="non-final"/>
+    <modify-function signature="extension()const" remove="all"/> <!--### Obsolete in 4.3-->
+    <modify-function signature="orientation()const" remove="all"/> <!--### Obsolete in 4.3-->
+    <modify-function signature="setOrientation(Qt::Orientation)" remove="all"/> <!--### Obsolete in 4.3-->
+    <modify-function signature="showExtension(bool)" remove="all"/> <!--### Obsolete in 4.3-->
+  </object-type>
+  <object-type name="QDialogButtonBox">
+    <modify-function signature="addButton(QAbstractButton*,QDialogButtonBox::ButtonRole)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="removeButton(QAbstractButton*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+  <object-type name="QDirModel">
+     <modify-function signature="parent()const" remove="all"/>
+    <modify-function signature="setIconProvider(QFileIconProvider*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcIconProvider"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+  <object-type name="QDoubleValidator"/>
+  <object-type name="QFileIconProvider"/>
+  <object-type name="QWizard">
+    <!-- ### Requires correct class name in meta object -->
+    <modify-function signature="setDefaultProperty(const char *, const char *, const char *)" remove="all"/>
+    <modify-function signature="addPage(QWizardPage*)">
+        <modify-argument index="1">
+            <no-null-pointer/>
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setButton(QWizard::WizardButton,QAbstractButton*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setPage(int,QWizardPage*)">
+        <modify-argument index="2">
+            <no-null-pointer/>
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+
+  </object-type>
+  <object-type name="QWizardPage">
+    <!-- ### Reduced functionality due to meta object having missing information -->
+    <modify-function signature="registerField(const QString &amp;, QWidget *, const char *, const char *)">
+        <access modifier="private"/>
+        <modify-argument index="3">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="4">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+
+  </object-type>
+  <object-type name="QFocusFrame">
+    <modify-function signature="initStyleOption(QStyleOption*)const">
+        <access modifier="private"/>
+    </modify-function>
+    <modify-function signature="setWidget(QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcWidget"/>
+        </modify-argument>
+    </modify-function>
+    <inject-code>
+        <insert-template name="gui.init_style_option">
+            <replace from="%TYPE" to="QStyleOption"/>
+        </insert-template>
+    </inject-code>
+  </object-type>
+  <object-type name="QFontComboBox"/>
+  <object-type name="QFontDialog"/>
+  <object-type name="QGraphicsEllipseItem" delete-in-main-thread="yes"/>
+  <object-type name="QGraphicsItemAnimation" >
+    <modify-function signature="setItem(QGraphicsItem*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcItem"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setTimeLine(QTimeLine*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcTimeLine"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+  <object-type name="QGraphicsItemGroup" delete-in-main-thread="yes">
+      <modify-function signature="matrix()const" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="resetMatrix()" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="sceneMatrix()const" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="setMatrix(QMatrix, bool)" remove="all"/> <!--### Obsolete in 4.3-->
+  </object-type>
+  <object-type name="QGraphicsLineItem" delete-in-main-thread="yes">
+      <modify-function signature="matrix()const" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="resetMatrix()" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="sceneMatrix()const" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="setMatrix(QMatrix, bool)" remove="all"/> <!--### Obsolete in 4.3-->
+  </object-type>
+  <object-type name="QGraphicsPathItem" delete-in-main-thread="yes"/>
+
+  <object-type name="QGraphicsPixmapItem" delete-in-main-thread="yes">
+      <modify-function signature="matrix()const" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="resetMatrix()" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="sceneMatrix()const" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="setMatrix(QMatrix, bool)" remove="all"/> <!--### Obsolete in 4.3-->
+  </object-type>
+  <object-type name="QGraphicsPolygonItem" delete-in-main-thread="yes"/>
+  <object-type name="QGraphicsRectItem" delete-in-main-thread="yes"/>
+  <object-type name="QGraphicsSimpleTextItem" delete-in-main-thread="yes"/>
+  <object-type name="QHBoxLayout"/>
+  <object-type name="QHeaderView">
+    <modify-function signature="initStyleOption(QStyleOptionHeader*)const">
+        <access modifier="private"/>
+    </modify-function>
+
+    <modify-function signature="paintSection(QPainter*,QRect,int)const">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+
+    <inject-code>
+        <insert-template name="gui.init_style_option">
+            <replace from="%TYPE" to="QStyleOptionHeader"/>
+        </insert-template>
+    </inject-code>
+    <modify-function signature="setModel(QAbstractItemModel*)">
+        <modify-argument index="1">
+            <reference-count declare-variable="QAbstractItemView" action="set" variable-name="__rcModel"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+  <object-type name="QIconEngine">
+    <modify-function signature="paint(QPainter*,QRect,QIcon::Mode,QIcon::State)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+  </object-type>
+  <object-type name="QIconEngineV2">
+    <modify-function signature="read(QDataStream&amp;)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="write(QDataStream&amp;)const">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+
+    <modify-function signature="virtual_hook(int,void*)" remove="all"/>
+    <modify-function signature="clone()const">
+        <modify-argument index="return">
+            <define-ownership class="shell" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+  <object-type name="QImageWriter">
+  <modify-function signature="setDevice(QIODevice*)">
+    <modify-argument index="1">
+        <reference-count action="set" variable-name="__rcDevice"/>
+    </modify-argument>
+  </modify-function>
+      <modify-function signature="description()const" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="setDescription(QString)" remove="all"/> <!--### Obsolete in 4.3-->
+  </object-type>
+  <object-type name="QInputContextFactory"/>
+  <object-type name="QIntValidator"/>
+  <object-type name="QItemDelegate">
+    <modify-function signature="doLayout(QStyleOptionViewItem,QRect*,QRect*,QRect*,bool)const">
+        <remove/>
+    </modify-function>
+
+    <modify-function signature="drawCheck(QPainter*,QStyleOptionViewItem,QRect,Qt::CheckState)const">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="drawDecoration(QPainter*,QStyleOptionViewItem,QRect,QPixmap)const">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="drawDisplay(QPainter*,QStyleOptionViewItem,QRect,QString)const">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="drawFocus(QPainter*,QStyleOptionViewItem,QRect)const">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+
+
+    <modify-function signature="selected(QPixmap,QPalette,bool)const">
+        <remove/>
+    </modify-function>
+    <modify-function signature="setItemEditorFactory(QItemEditorFactory*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcItemEditorFactory"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setEditorData(QWidget*,QModelIndex)const">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setModelData(QWidget*,QAbstractItemModel*,QModelIndex)const">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+
+  </object-type>
+  <object-type name="QItemEditorCreatorBase"/>
+  <object-type name="QItemEditorFactory">
+    <modify-function signature="registerEditor(QVariant::Type, QItemEditorCreatorBase *)">
+        <modify-argument index="2">
+            <define-ownership class="java" owner="c++" />
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setDefaultFactory(QItemEditorFactory *)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcDefaultItemEditorFactory" />
+        </modify-argument>
+    </modify-function>
+  </object-type>
+  <object-type name="QItemSelectionModel"/>
+  <object-type name="QTreeModel"/>
+  <object-type name="QListView"/>
+  <object-type name="QColumnView">
+    <modify-function signature="setPreviewWidget(QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setModel(QAbstractItemModel*)">
+        <modify-argument index="1">
+            <reference-count declare-variable="QAbstractItemView" action="set" variable-name="__rcItemModel"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setSelectionModel(QItemSelectionModel*)">
+        <modify-argument index="1">
+            <no-null-pointer/>
+            <reference-count declare-variable="QAbstractItemView" action="set" variable-name="__rcItemSelectionModel"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+  <object-type name="QMainWindow">
+    <modify-function signature="addDockWidget(Qt::DockWidgetArea,QDockWidget*,Qt::Orientation)">
+        <modify-argument index="2">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="addDockWidget(Qt::DockWidgetArea,QDockWidget*)">
+        <modify-argument index="2">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="addToolBar(QToolBar*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="addToolBar(Qt::ToolBarArea,QToolBar*)">
+        <modify-argument index="2">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertToolBar(QToolBar*,QToolBar*)">
+        <modify-argument index="2">
+            <reference-count action="ignore"/>
+        </modify-argument>
+        <modify-argument index="2">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertToolBarBreak(QToolBar*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="removeDockWidget(QDockWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="removeToolBar(QToolBar*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="removeToolBarBreak(QToolBar*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setCentralWidget(QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setMenuBar(QMenuBar*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setMenuWidget(QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setStatusBar(QStatusBar*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+
+  </object-type>
+  <object-type name="QMdiArea">
+    <modify-function signature="addSubWindow(QWidget*,QFlags&lt;Qt::WindowType&gt;)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="removeSubWindow(QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="setActiveSubWindow(QMdiSubWindow*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="setupViewport(QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+
+  </object-type>
+  <object-type name="QMdiSubWindow">
+    <modify-function signature="setSystemMenu(QMenu*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setWidget(QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+  <object-type name="QMenu">
+    <modify-function signature="addAction(QAction *)" remove="all"/>
+    <modify-function signature="addMenu(QMenu*)">
+        <modify-argument index="1">
+            <reference-count action="add" variable-name="__rcMenus"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertMenu(QAction*,QMenu*)">
+        <modify-argument index="2">
+            <reference-count action="add" variable-name="__rcMenus"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertSeparator(QAction*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setActiveAction(QAction*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setDefaultAction(QAction*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setNoReplayFor(QWidget*)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="initStyleOption(QStyleOptionMenuItem*,const QAction*)const">
+        <access modifier="private"/>
+    </modify-function>
+
+    <modify-function signature="addAction(QString,const QObject*,const char*,QKeySequence)">
+        <remove/>
+    </modify-function>
+
+    <modify-function signature="addAction(QIcon,QString,const QObject*,const char*,QKeySequence)">
+        <remove/>
+    </modify-function>
+  </object-type>
+
+  <object-type name="QMenuBar">
+    <modify-function signature="addAction(QAction *)" remove="all"/>
+    <modify-function signature="addAction(QString,const QObject*,const char*)">
+        <remove/>
+    </modify-function>
+
+    <modify-function signature="initStyleOption(QStyleOptionMenuItem*,const QAction*)const">
+        <access modifier="private"/>
+    </modify-function>
+
+    <modify-function signature="addMenu(QMenu*)">
+        <modify-argument index="1">
+            <reference-count action="add" variable-name="__rcMenus"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertMenu(QAction*,QMenu*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+        <modify-argument index="2">
+            <reference-count action="add" variable-name="__rcMenus"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertSeparator(QAction*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setActiveAction(QAction*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setCornerWidget(QWidget*,Qt::Corner)    ">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+  <object-type name="QMotifStyle">
+    <modify-function signature="standardPixmap(QStyle::StandardPixmap, const QStyleOption*, const QWidget*)const" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="standardIconImplementation(QStyle::StandardPixmap, const QStyleOption *, const QWidget *)const" virtual-slot="yes"/>
+  </object-type>
+  <object-type name="QPainterPathStroker"/>
+
+  <object-type name="QPictureIO">
+      <modify-function signature="QPictureIO(QIODevice*,const char*)">
+        <access modifier="private"/>
+         <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcDevice"/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="setIODevice(QIODevice*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcDevice"/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="QPictureIO(QString,const char*)">
+        <access modifier="private"/>
+    </modify-function>
+
+    <modify-function signature="format()const">
+        <access modifier="private"/>
+        <rename to="format_private"/>
+    </modify-function>
+
+    <modify-function signature="parameters()const">
+        <access modifier="private"/>
+        <rename to="parameters_private"/>
+    </modify-function>
+
+    <modify-function signature="setFormat(const char*)">
+        <access modifier="private"/>
+    </modify-function>
+
+    <modify-function signature="setParameters(const char*)">
+        <access modifier="private"/>
+    </modify-function>
+
+  </object-type>
+
+  <object-type name="QPixmapCache">
+    <modify-function signature="find(QString)">
+        <remove/>
+    </modify-function>
+
+    <modify-function signature="find(QString,QPixmap&amp;)">
+        <access modifier="private"/>
+    </modify-function>
+  </object-type>
+  <object-type name="QPlastiqueStyle">
+    <modify-function signature="standardPixmap(QStyle::StandardPixmap, const QStyleOption*, const QWidget*)const" remove="all"/> <!--### Obsolete in 4.3-->
+    <modify-function signature="standardIconImplementation(QStyle::StandardPixmap, const QStyleOption *, const QWidget *)const" virtual-slot="yes"/>
+    <modify-function signature="layoutSpacingImplementation(QSizePolicy::ControlType, QSizePolicy::ControlType, Qt::Orientation, const QStyleOption *, const QWidget *) const" virtual-slot="yes" />
+  </object-type>
+  <object-type name="QPrintDialog" />
+  <object-type name="QPrintEngine"/>
+  <object-type name="QProgressBar">
+    <modify-function signature="initStyleOption(QStyleOptionProgressBar*)const">
+        <access modifier="private"/>
+    </modify-function>
+  </object-type>
+  <object-type name="QPushButton">
+    <modify-function signature="initStyleOption(QStyleOptionButton*)const">
+        <access modifier="private"/>
+    </modify-function>
+
+    <modify-function signature="setMenu(QMenu*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcMenu"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+  <object-type name="QRegExpValidator"/>
+  <object-type name="QScrollArea">
+    <modify-function signature="setWidget(QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+  <object-type name="QSessionManager"/>
+  <object-type name="QShortcut">
+    <modify-function signature="QShortcut(QKeySequence,QWidget*,const char*,const char*,Qt::ShortcutContext)">
+        <access modifier="private"/>
+        <modify-argument index="3">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="4">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="5">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+  <object-type name="QSizeGrip"/>
+  <object-type name="QSound"/>
+  <object-type name="QSpacerItem"/>
+  <object-type name="QStandardItem">
+    <modify-function signature="operator=(QStandardItem)" remove="all"/>
+    <modify-function signature="operator&lt;(QStandardItem)const">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="read(QDataStream&amp;)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="write(QDataStream&amp;)const">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+
+  </object-type>
+  <object-type name="QStatusBar">
+    <modify-function signature="addPermanentWidget(QWidget *, int)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="addWidget(QWidget *, int)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="removeWidget(QWidget *)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertPermanentWidget(int, QWidget *, int)">
+        <modify-argument index="2">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertWidget(int, QWidget *, int)">
+        <modify-argument index="2">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+  <object-type name="QStringListModel"/>
+  <object-type name="QStyleFactory"/>
+  <object-type name="QStyleHintReturn"/>
+  <object-type name="QStyleHintReturnVariant"/>
+  <object-type name="QStyleHintReturnMask"/>
+  <object-type name="QStylePainter" delete-in-main-thread="yes"/>
+  <object-type name="QSyntaxHighlighter">
+    <modify-function signature="setCurrentBlockUserData(QTextBlockUserData*)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setDocument(QTextDocument*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcDocument"/>
+        </modify-argument>
+    </modify-function>
+
+  </object-type>
+  <object-type name="QSystemTrayIcon">
+    <modify-function signature="setContextMenu(QMenu*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcContextMenu"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+  <object-type name="QTableView">
+    <modify-function signature="setHorizontalHeader(QHeaderView*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setVerticalHeader(QHeaderView*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setModel(QAbstractItemModel*)">
+        <modify-argument index="1">
+            <reference-count declare-variable="QAbstractItemView" action="set" variable-name="__rcItemModel"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setSelectionModel(QItemSelectionModel*)">
+        <modify-argument index="1">
+            <no-null-pointer/>
+            <reference-count declare-variable="QAbstractItemView" action="set" variable-name="__rcItemSelectionModel"/>
+        </modify-argument>
+    </modify-function>
+
+      <modify-function signature="sortByColumn(int)" remove="all"/> <!--### Obsolete in 4.3-->
+  </object-type>
+  <object-type name="QTextBlockGroup" delete-in-main-thread="yes"/>
+  <object-type name="QTextBlockUserData" delete-in-main-thread="yes"/>
+  <object-type name="QTextItem" delete-in-main-thread="yes"/>
+  <object-type name="QTextList" delete-in-main-thread="yes">
+    <modify-function signature="format()const" rename="textListFormat"/>
+
+      <modify-function signature="isEmpty()const" remove="all"/> <!--### Obsolete in 4.3-->
+  </object-type>
+  <object-type name="QTextObject" delete-in-main-thread="yes"/>
+  <object-type name="QTextObjectInterface" delete-in-main-thread="yes">
+    <modify-function signature="drawObject(QPainter*,QRectF,QTextDocument*,int,QTextFormat)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+  </object-type>
+  <object-type name="QTimeEdit"/>
+  <object-type name="QToolBox">
+    <modify-function signature="addItem(QWidget*,QString)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="addItem(QWidget*,QIcon,QString)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertItem(int,QWidget*,QIcon,QString)">
+        <modify-argument index="2">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertItem(int,QWidget*,QString)">
+        <modify-argument index="2">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setCurrentWidget(QWidget*)  ">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+  <object-type name="QToolButton">
+    <modify-function signature="initStyleOption(QStyleOptionToolButton*)const">
+        <access modifier="private"/>
+    </modify-function>
+
+    <modify-function signature="setDefaultAction(QAction *)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcDefaultAction"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setMenu(QMenu *)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcMenu"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+  <object-type name="QToolTip"/>
+  <object-type name="QTreeView">
+
+    <modify-function signature="drawBranches(QPainter*,QRect,QModelIndex)const">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="drawRow(QPainter*,QStyleOptionViewItem,QModelIndex)const">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+
+    <modify-function signature="setHeader(QHeaderView*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+   </modify-function>
+   <modify-function signature="setModel(QAbstractItemModel*)">
+        <modify-argument index="1">
+            <reference-count declare-variable="QAbstractItemView" action="set" variable-name="__rcItemModel"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setSelectionModel(QItemSelectionModel*)">
+        <modify-argument index="1">
+            <no-null-pointer/>
+            <reference-count declare-variable="QAbstractItemView" action="set" variable-name="__rcItemSelectionModel"/>
+        </modify-argument>
+    </modify-function>
+
+      <modify-function signature="sortByColumn(int)" remove="all"/> <!--### Obsolete in 4.3-->
+  </object-type>
+  <object-type name="QUndoCommand">
+    <modify-function signature="mergeWith(const QUndoCommand*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+  </object-type>
+  <object-type name="QUndoGroup">
+    <modify-function signature="addStack(QUndoStack*)">
+        <modify-argument index="1">
+            <reference-count action="add" variable-name="__rcStacks"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="removeStack(QUndoStack*)">
+        <modify-argument index="1">
+            <reference-count action="remove" variable-name="__rcStacks"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setActiveStack(QUndoStack*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+
+  <object-type name="QUndoStack"/>
+
+  <object-type name="QUndoView">
+    <modify-function signature="setGroup(QUndoGroup *)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcGroupOrStack"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setStack(QUndoStack *)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcGroupOrStack"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="QUndoView(QUndoGroup *,QWidget *)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcGroupOrStack"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="QUndoView(QUndoStack *,QWidget *)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcGroupOrStack"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+  <object-type name="QVBoxLayout"/>
+  <object-type name="QValidator" />
+  <object-type name="QWhatsThis"/>
+  <object-type name="QWidgetAction">
+    <modify-function signature="createWidget(QWidget*)">
+        <modify-argument index="return">
+            <define-ownership class="shell" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+  <object-type name="QWidgetItem" />
+  <object-type name="QWindowsStyle">
+      <modify-function signature="standardPixmap(QStyle::StandardPixmap, const QStyleOption*, const QWidget*)const" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="standardIconImplementation(QStyle::StandardPixmap, const QStyleOption *, const QWidget *)const" virtual-slot="yes"/>
+  </object-type>
+  <object-type name="QWorkspace">
+    <modify-function signature="addWindow(QWidget*,QFlags&lt;Qt::WindowType&gt;)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setActiveWindow(QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+
+  <object-type name="QActionEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::ActionAdded || %1-&gt;type() == QEvent::ActionRemoved || %1-&gt;type() == QEvent::ActionChanged"/>
+  <object-type name="QClipboardEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Clipboard"/>
+  <object-type name="QCloseEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Close"/>
+  <object-type name="QContextMenuEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::ContextMenu"/>
+  <object-type name="QDragEnterEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::DragEnter"/>
+  <object-type name="QDragLeaveEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::DragLeave"/>
+  <object-type name="QDragMoveEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::DragMove">
+    <modify-function signature="accept()" remove="all"/>
+    <modify-function signature="ignore()" remove="all"/>
+  </object-type>
+  <object-type name="QDropEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Drop">
+    <modify-function signature="encodedData(const char*)const">
+        <remove/>
+    </modify-function>
+
+    <modify-function signature="format(int)const">
+        <remove/>
+    </modify-function>
+
+    <modify-function signature="provides(const char*)const">
+        <remove/>
+    </modify-function>
+
+
+  </object-type>
+  <object-type name="QFileOpenEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::FileOpen"/>
+  <object-type name="QFocusEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::FocusIn || %1-&gt;type() == QEvent::FocusOut">
+        <modify-function signature="reason()const">
+            <remove/>
+        </modify-function>
+  </object-type>
+
+  <object-type name="QGraphicsSceneContextMenuEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneContextMenu"/>
+  <object-type name="QGraphicsSceneDragDropEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneDragEnter || %1-&gt;type() == QEvent::GraphicsSceneDragLeave || %1-&gt;type() == QEvent::GraphicsSceneDragMove || %1-&gt;type() == QEvent::GraphicsSceneDrop">
+    <modify-function signature="setMimeData(const QMimeData *)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="setSource(QWidget *)">
+        <remove/>
+    </modify-function>
+  </object-type>
+  <object-type name="QGraphicsSceneEvent">
+    <modify-function signature="setWidget(QWidget *)">
+        <remove/>
+    </modify-function>
+  </object-type>
+  <object-type name="QGraphicsSceneMoveEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneMove" />
+  <object-type name="QGraphicsSceneResizeEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneResize" />
+  <object-type name="QGraphicsSceneHelpEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneHelp"/>
+  <object-type name="QGraphicsSceneHoverEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneHoverEnter || %1-&gt;type() == QEvent::GraphicsSceneHoverLeave || %1-&gt;type() == QEvent::GraphicsSceneHoverMove"/>
+  <object-type name="QGraphicsSceneMouseEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneMouseDoubleClick || %1-&gt;type() == QEvent::GraphicsSceneMouseMove || %1-&gt;type() == QEvent::GraphicsSceneMousePress || %1-&gt;type() == QEvent::GraphicsSceneMouseRelease"/>
+  <object-type name="QGraphicsSceneWheelEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneWheel"/>
+  <object-type name="QHelpEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::ToolTip || %1-&gt;type() == QEvent::WhatsThis"/>
+  <object-type name="QHideEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Hide"/>
+  <object-type name="QHoverEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::HoverEnter || %1-&gt;type() == QEvent::HoverLeave || %1-&gt;type() == QEvent::HoverMove"/>
+  <object-type name="QIconDragEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::IconDrag"/>
+  <object-type name="QInputMethodEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::InputMethod"/>
+  <object-type name="QMoveEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Move"/>
+  <object-type name="QResizeEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Resize"/>
+  <object-type name="QShortcutEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Shortcut">
+        <!-- All these have const overloads that are used instead -->
+        <modify-function signature="isAmbiguous()">
+            <remove/>
+        </modify-function>
+        <modify-function signature="shortcutId()">
+            <remove/>
+        </modify-function>
+        <modify-function signature="key()">
+            <remove/>
+        </modify-function>
+  </object-type>
+  <object-type name="QShowEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Show"/>
+  <object-type name="QStatusTipEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::StatusTip"/>
+  <object-type name="QTabletEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::TabletMove || %1-&gt;type() == QEvent::TabletPress || %1-&gt;type() == QEvent::TabletRelease"/>
+  <object-type name="QToolBarChangeEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::ToolBarChange"/>
+  <object-type name="QWhatsThisClickedEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::WhatsThisClicked"/>
+  <object-type name="QWheelEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Wheel"/>
+  <object-type name="QWindowStateChangeEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::WindowStateChange"/>
+  <object-type name="QDragResponseEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::DragResponse"/>
+  <object-type name="QInputEvent">
+    <modify-function signature="modifiers()const" access="non-final"/>
+  </object-type>
+  <object-type name="QKeyEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::KeyPress || %1-&gt;type() == QEvent::KeyRelease"/>
+  <object-type name="QMouseEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::MouseButtonDblClick || %1-&gt;type() == QEvent::MouseButtonPress || %1-&gt;type() == QEvent::MouseButtonRelease || %1-&gt;type() == QEvent::MouseMove"/>
+  <object-type name="QPaintEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Paint"/>
+  <object-type name="QAccessibleEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::AccessibilityDescription || %1-&gt;type() == QEvent::AccessibilityHelp"/>
+
+  <object-type name="QAbstractButton" />
+
+  <object-type name="QStyle">
+      <modify-function signature="standardIconImplementation(QStyle::StandardPixmap, const QStyleOption *, const QWidget *)const" virtual-slot="yes"/>
+      <modify-function signature="layoutSpacingImplementation(QSizePolicy::ControlType, QSizePolicy::ControlType, Qt::Orientation, const QStyleOption *, const QWidget *) const" virtual-slot="yes" />
+
+      <modify-function signature="drawComplexControl(QStyle::ComplexControl,const QStyleOptionComplex*,QPainter*,const QWidget*)const">
+        <modify-argument index="3" invalidate-after-use="yes" />
+      </modify-function>
+      <modify-function signature="drawControl(QStyle::ControlElement,const QStyleOption*,QPainter*,const QWidget*)const">
+        <modify-argument index="3" invalidate-after-use="yes" />
+      </modify-function>
+      <modify-function signature="drawPrimitive(QStyle::PrimitiveElement,const QStyleOption*,QPainter*,const QWidget*)const">
+        <modify-argument index="3" invalidate-after-use="yes" />
+      </modify-function>
+      <modify-function signature="styleHint(QStyle::StyleHint,const QStyleOption*,const QWidget*,QStyleHintReturn*)const">
+        <modify-argument index="4" invalidate-after-use="yes" />
+      </modify-function>
+      <modify-function signature="drawItemPixmap(QPainter*,QRect,int,QPixmap)const">
+        <modify-argument index="1" invalidate-after-use="yes" />
+      </modify-function>
+      <modify-function signature="drawItemText(QPainter*,QRect,int,QPalette,bool,QString,QPalette::ColorRole)const">
+        <modify-argument index="1" invalidate-after-use="yes" />
+      </modify-function>
+
+  </object-type>
+
+  <object-type name="QColorDialog">
+    <modify-function signature="getColor(const QColor &amp;, QWidget *)">
+      <modify-argument index="1">
+        <replace-default-expression with="QColor.white"/>
+      </modify-argument>
+    </modify-function>
+    <modify-function signature="getRgba(uint,bool*,QWidget*)">
+        <remove/>
+    </modify-function>
+  </object-type>
+
+  <object-type name="QLayout">
+    <modify-function signature="addItem(QLayoutItem*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+
+    <modify-function signature="setSpacing(int)" rename="setWidgetSpacing"/>
+    <modify-function signature="spacing()const" rename="widgetSpacing"/>
+    <modify-function signature="addWidget(QWidget *)">
+        <modify-argument index="1">
+            <no-null-pointer/>
+            <reference-count variable-name="__rcWidgets" action="add"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="addChildWidget(QWidget *)">
+        <modify-argument index="1">
+            <no-null-pointer/>
+            <reference-count variable-name="__rcWidgets" action="add"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="removeWidget(QWidget *)">
+        <modify-argument index="1">
+            <no-null-pointer/>
+            <reference-count variable-name="__rcWidgets" action="remove"/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="setAlignment(QWidget*,QFlags&lt;Qt::AlignmentFlag&gt;)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setAlignment(QLayout*,QFlags&lt;Qt::AlignmentFlag&gt;)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setMenuBar(QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcMenuBar"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="getContentsMargins(int*,int*,int*,int*)const">
+        <access modifier="private"/>
+    </modify-function>
+
+    <modify-function signature="margin()const" remove="all"/> <!--### Obsolete in 4.3-->
+    <!-- <modify-function signature="setMargin(int)" remove="all"/> --> <!--### Obsolete in 4.3-->
+  </object-type>
+
+  <object-type name="QStackedLayout">
+    <modify-function signature="addItem(QLayoutItem *)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="itemAt(int) const">
+        <modify-argument index="return">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="addWidget(QWidget *)">
+        <rename to="addStackedWidget"/>
+        <modify-argument index="1">
+            <no-null-pointer/>
+            <reference-count action="add" declare-variable="QLayout" variable-name="__rcWidgets"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertWidget(int,QWidget*)">
+        <modify-argument index="2">
+            <no-null-pointer/>
+            <reference-count action="add" declare-variable="QLayout" variable-name="__rcWidgets"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setCurrentWidget(QWidget*)">
+        <modify-argument index="1">
+            <!-- Safe to ignore because current widget must have been added to layout already -->
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+
+  <object-type name="QBoxLayout">
+    <modify-function signature="addWidget(QWidget *, int, QFlags&lt;Qt::AlignmentFlag&gt;)">
+        <modify-argument index="1">
+            <no-null-pointer/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="addItem(QLayoutItem *)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertLayout(int, QLayout *, int)">
+        <modify-argument index="2">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertItem(int, QLayoutItem *)">
+        <modify-argument index="2">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="addSpacerItem(QSpacerItem*)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++" />
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertSpacerItem(int,QSpacerItem*)">
+        <modify-argument index="2">
+            <define-ownership class="java" owner="c++" />
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="addLayout(QLayout *, int)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="addWidget(QWidget*,int,QFlags&lt;Qt::AlignmentFlag&gt;)">
+        <modify-argument index="1">
+            <reference-count declare-variable="QLayout" action="add" variable-name="__rcWidgets"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertWidget(int,QWidget*,int,QFlags&lt;Qt::AlignmentFlag&gt;)">
+        <modify-argument index="2">
+            <reference-count declare-variable="QLayout" action="add" variable-name="__rcWidgets"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setStretchFactor(QWidget*,int)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setStretchFactor(QLayout*,int)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+
+  <object-type name="QGridLayout">
+    <modify-function signature="addWidget(QWidget *)" remove="all"/>
+    <modify-function signature="addItem(QLayoutItem *)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="addItem(QLayoutItem *, int, int, int, int, QFlags&lt;Qt::AlignmentFlag&gt;)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="addLayout(QLayout *, int, int, QFlags&lt;Qt::AlignmentFlag&gt;)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="addLayout(QLayout *, int, int, int, int, QFlags&lt;Qt::AlignmentFlag&gt;)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+        <modify-function signature="addWidget(QWidget*,int,int,QFlags&lt;Qt::AlignmentFlag&gt;)">
+            <modify-argument index="1">
+                <reference-count declare-variable="QLayout" action="add" variable-name="__rcWidgets"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="addWidget(QWidget*,int,int,int,int,QFlags&lt;Qt::AlignmentFlag&gt;)">
+            <modify-argument index="1">
+                <reference-count declare-variable="QLayout" action="add" variable-name="__rcWidgets"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="addWidget(QWidget*)">
+            <modify-argument index="1">
+                <reference-count declare-variable="QLayout" action="add" variable-name="__rcWidgets"/>
+            </modify-argument>
+        </modify-function>
+    <modify-function signature="getItemPosition(int,int*,int*,int*,int*)">
+        <access modifier="private"/>
+    </modify-function>
+  </object-type>
+
+  <object-type name="QGraphicsView">
+    <extra-includes>
+      <include file-name="QPainterPath" location="global"/>
+      <include file-name="QVarLengthArray" location="global"/>
+    </extra-includes>
+    <modify-function signature="fitInView(const QGraphicsItem *, Qt::AspectRatioMode)">
+        <modify-argument index="1">
+            <no-null-pointer />
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setupViewport(QWidget *)" access="non-final"/>
+    <modify-function signature="setScene(QGraphicsScene*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcScene"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setupViewport(QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="drawBackground(QPainter*,QRectF)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="drawForeground(QPainter*,QRectF)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="drawItems(QPainter*,int,QGraphicsItem**,const QStyleOptionGraphicsItem*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+
+    <modify-function signature="drawItems(QPainter*,int,QGraphicsItem**,const QStyleOptionGraphicsItem*)">
+        <modify-argument index="2">
+            <remove-argument/>
+            <conversion-rule class="shell">
+                // nothing
+            </conversion-rule>
+            <conversion-rule class="native">
+                <insert-template name="core.get_array_length">
+                    <replace from="%ARRAY" to="%3"/>
+                </insert-template>
+                int __length = %out;
+            </conversion-rule>
+        </modify-argument>
+
+        <modify-argument index="3">
+            <replace-type modified-type="qt.gui.QGraphicsItemInterface[]"/>
+            <conversion-rule class="shell">
+                <insert-template name="gui.convert_graphicsitem_array_to_java">
+                    <replace from="%LENGTH" to="%2"/>
+                </insert-template>
+                jobjectArray graphicsItemArrayHolder = %out;
+            </conversion-rule>
+            <conversion-rule class="native">
+                <insert-template name="gui.convert_graphicsitem_array_from_java"/>
+            </conversion-rule>
+        </modify-argument>
+
+        <modify-argument index="4">
+            <replace-type modified-type="qt.gui.QStyleOptionGraphicsItem[]"/>
+            <conversion-rule class="shell">
+                <insert-template name="gui.convert_styleoptiongraphicsitem_array_to_java">
+                    <replace from="%LENGTH" to="%2"/>
+                </insert-template>
+                jobjectArray styleOptionArrayHolder = %out;
+            </conversion-rule>
+            <conversion-rule class="native">
+                <insert-template name="gui.convert_styleoptiongraphicsitem_array_from_java"/>
+            </conversion-rule>
+        </modify-argument>
+
+        <modify-argument index="return">
+            <conversion-rule class="shell">
+                qtjambi_invalidate_array(__jni_env, styleOptionArrayHolder);
+                qtjambi_invalidate_array(__jni_env, graphicsItemArrayHolder);
+            </conversion-rule>
+        </modify-argument>
+
+    </modify-function>
+  </object-type>
+
+  <object-type name="QInputDialog">
+    <modify-function signature="getDouble(QWidget *, const QString &amp;, const QString &amp;, double, double, double, int, bool *, QFlags&lt;Qt::WindowType&gt;)">
+        <rename to="getDouble_internal"/>
+        <access modifier="private"/>
+        <modify-argument index="4">
+            <remove-default-expression />
+        </modify-argument>
+        <modify-argument index="5">
+            <remove-default-expression />
+        </modify-argument>
+        <modify-argument index="6">
+            <remove-default-expression />
+        </modify-argument>
+        <modify-argument index="7">
+            <remove-default-expression />
+        </modify-argument>
+        <modify-argument index="8">
+            <remove-default-expression />
+        </modify-argument>
+        <modify-argument index="9">
+            <remove-default-expression />
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="getInteger(QWidget *, const QString &amp;, const QString &amp;, int, int, int, int, bool *, QFlags&lt;Qt::WindowType&gt;)">
+        <rename to="getInteger_internal"/>
+        <access modifier="private"/>
+        <modify-argument index="4">
+            <remove-default-expression />
+        </modify-argument>
+        <modify-argument index="5">
+            <remove-default-expression />
+        </modify-argument>
+        <modify-argument index="6">
+            <remove-default-expression />
+        </modify-argument>
+        <modify-argument index="7">
+            <remove-default-expression />
+        </modify-argument>
+        <modify-argument index="8">
+            <remove-default-expression />
+        </modify-argument>
+        <modify-argument index="9">
+            <remove-default-expression />
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="getItem(QWidget *, const QString &amp;, const QString &amp;, const QStringList&lt;QString&gt; &amp;, int, bool, bool *, QFlags&lt;Qt::WindowType&gt;)">
+        <rename to="getItem_internal"/>
+        <access modifier="private"/>
+        <modify-argument index="4">
+            <remove-default-expression />
+        </modify-argument>
+        <modify-argument index="5">
+            <remove-default-expression />
+        </modify-argument>
+        <modify-argument index="6">
+            <remove-default-expression />
+        </modify-argument>
+        <modify-argument index="7">
+            <remove-default-expression />
+        </modify-argument>
+        <modify-argument index="8">
+            <remove-default-expression />
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="getText(QWidget *, const QString &amp;, const QString &amp;, QLineEdit::EchoMode, const QString &amp;, bool *, QFlags&lt;Qt::WindowType&gt;)">
+        <rename to="getText_internal"/>
+        <access modifier="private"/>
+        <modify-argument index="4">
+            <remove-default-expression />
+        </modify-argument>
+        <modify-argument index="5">
+            <remove-default-expression />
+        </modify-argument>
+        <modify-argument index="6">
+            <remove-default-expression />
+        </modify-argument>
+        <modify-argument index="7">
+            <remove-default-expression />
+        </modify-argument>
+    </modify-function>
+  </object-type>
+
+
+  <object-type name="QGraphicsScene">
+    <extra-includes>
+        <include file-name="QVarLengthArray" location="global"/>
+    </extra-includes>
+
+    <modify-function signature="contextMenuEvent(QGraphicsSceneContextMenuEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="dragEnterEvent(QGraphicsSceneDragDropEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="dragLeaveEvent(QGraphicsSceneDragDropEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="dragMoveEvent(QGraphicsSceneDragDropEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="drawBackground(QPainter*,QRectF)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="drawForeground(QPainter*,QRectF)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="drawItems(QPainter*,int,QGraphicsItem**,const QStyleOptionGraphicsItem*,QWidget*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="dropEvent(QGraphicsSceneDragDropEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="focusInEvent(QFocusEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="focusOutEvent(QFocusEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="helpEvent(QGraphicsSceneHelpEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="inputMethodEvent(QInputMethodEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="keyPressEvent(QKeyEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="keyReleaseEvent(QKeyEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="mouseDoubleClickEvent(QGraphicsSceneMouseEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="mouseMoveEvent(QGraphicsSceneMouseEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="mousePressEvent(QGraphicsSceneMouseEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="mouseReleaseEvent(QGraphicsSceneMouseEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="wheelEvent(QGraphicsSceneWheelEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+
+    <modify-function signature="setActiveWindow(QGraphicsWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore" />
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setStyle(QStyle*)">
+        <modify-argument index="1">
+            <reference-count action="ignore" />
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="addItem(QGraphicsItem *)">
+      <modify-argument index="1">
+        <define-ownership class="java" owner="c++"/>
+      </modify-argument>
+    </modify-function>
+    <modify-function signature="addEllipse(const QRectF &amp;, const QPen &amp;, const QBrush &amp;)">
+      <modify-argument index="return">
+        <define-ownership class="java" owner="c++"/>
+      </modify-argument>
+    </modify-function>
+    <modify-function signature="addLine(const QLineF &amp;, const QPen &amp;)">
+      <modify-argument index="return">
+        <define-ownership class="java" owner="c++"/>
+      </modify-argument>
+    </modify-function>
+    <modify-function signature="addPath(const QPainterPath &amp;, const QPen &amp;, const QBrush &amp;)">
+      <modify-argument index="return">
+        <define-ownership class="java" owner="c++"/>
+      </modify-argument>
+    </modify-function>
+    <modify-function signature="addPixmap(const QPixmap &amp;)">
+        <modify-argument index="return">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="addPolygon(const QPolygonF &amp;, const QPen &amp;, const QBrush &amp;)">
+        <modify-argument index="return">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="addRect(const QRectF &amp;, const QPen &amp;, const QBrush &amp;)">
+        <modify-argument index="return">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="addText(const QString &amp;, const QFont &amp;)">
+        <modify-argument index="return">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="addWidget(QWidget*,QFlags&lt;Qt::WindowType&gt;)">
+        <modify-argument index="return">
+            <define-ownership class="java" owner="c++" />
+        </modify-argument>
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++" />
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="removeItem(QGraphicsItem*)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="default"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setFocusItem(QGraphicsItem*,Qt::FocusReason)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcFocusItem"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+
+
+  <object-type name="QCalendarWidget">
+    <extra-includes>
+      <include file-name="QTextCharFormat" location="global"/>
+    </extra-includes>
+
+      <modify-function signature="isHeaderVisible()const" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="setHeaderVisible(bool)" remove="all"/> <!--### Obsolete in 4.3-->
+
+      <modify-function signature="paintCell(QPainter*,QRect,QDate)const">
+        <modify-argument invalidate-after-use="yes" index="1" />
+      </modify-function>
+  </object-type>
+
+  <object-type name="QTreeWidget">
+    <modify-function signature="mimeData(const QList&lt;QTreeWidgetItem*&gt;)const">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="dropMimeData(QTreeWidgetItem*,int,const QMimeData*,Qt::DropAction)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="isSortingEnabled()const" remove="all"/>
+    <modify-function signature="setSortingEnabled(bool)" remove="all"/>
+    <modify-function signature="indexOfTopLevelItem(QTreeWidgetItem *)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="addTopLevelItem(QTreeWidgetItem *)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="takeTopLevelItem(int)">
+        <modify-argument index="return">
+            <define-ownership class="java" owner="default"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="addTopLevelItems(const QList&lt;QTreeWidgetItem*&gt; &amp;)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertTopLevelItem(int, QTreeWidgetItem *)">
+        <modify-argument index="2">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertTopLevelItems(int, const QList&lt;QTreeWidgetItem*&gt; &amp;)">
+        <modify-argument index="2">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setHeaderItem(QTreeWidgetItem *)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="takeTopLevelItem(int)">
+        <modify-argument index="return">
+            <define-ownership class="java" owner="default"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="removeItemWidget(QTreeWidgetItem*,int)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="default"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setCurrentItem(QTreeWidgetItem*,int,QFlags&lt;QItemSelectionModel::SelectionFlag&gt;)">
+        <modify-argument index="1">
+            <reference-count action="ignore" />
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setFirstItemColumnSpanned(const QTreeWidgetItem*,bool)">
+        <modify-argument index="1">
+            <reference-count action="ignore" />
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setCurrentItem(QTreeWidgetItem*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setCurrentItem(QTreeWidgetItem*,int)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setItemExpanded(const QTreeWidgetItem*,bool)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="isItemExpanded(const QTreeWidgetItem*)const">
+        <remove/>
+    </modify-function>
+    <modify-function signature="setItemHidden(const QTreeWidgetItem*,bool)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="isItemHidden(const QTreeWidgetItem*)const">
+        <remove/>
+    </modify-function>
+    <modify-function signature="isItemSelected(const QTreeWidgetItem*)const">
+        <remove/>
+    </modify-function>
+    <modify-function signature="setItemSelected(const QTreeWidgetItem*,bool)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="setItemWidget(QTreeWidgetItem*,int,QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+        <modify-argument index="3">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setModel(QAbstractItemModel*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+
+      <modify-function signature="items(const QMimeData*)const" remove="all"/> <!--### Obsolete in 4.3-->
+  </object-type>
+
+  <object-type name="QAbstractItemDelegate">
+    <modify-function signature="setEditorData(QWidget*,QModelIndex)const">
+        <modify-argument index="1">
+            <!-- Safe to ignore because this implementation is documented to do nothing -->
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setModelData(QWidget*,QAbstractItemModel*,QModelIndex)const">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+        <modify-argument index="2">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="paint(QPainter*,QStyleOptionViewItem,QModelIndex)const">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="editorEvent(QEvent*,QAbstractItemModel*,QStyleOptionViewItem,QModelIndex)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+
+      <modify-function signature="elidedText(QFontMetrics, int, Qt::TextElideMode, QString)" remove="all"/> <!--### Obsolete in 4.3-->
+  </object-type>
+
+  <object-type name="QTableWidgetItem" delete-in-main-thread="yes">
+    <modify-function signature="operator=(const QTableWidgetItem&amp;)" remove="all"/>
+    <modify-function signature="clone() const">
+        <modify-argument index="return">
+            <define-ownership class="shell" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+
+      <modify-function signature="backgroundColor()const" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="setBackgroundColor(QColor)" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="setTextColor(QColor)" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="textColor()const" remove="all"/> <!--### Obsolete in 4.3-->
+
+    <modify-function signature="operator&lt;(QTableWidgetItem)const">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="read(QDataStream&amp;)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="write(QDataStream&amp;)const">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+
+  </object-type>
+
+  <object-type name="QListWidgetItem" delete-in-main-thread="yes">
+
+    <modify-function signature="operator&lt;(QListWidgetItem)const">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="read(QDataStream&amp;)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="write(QDataStream&amp;)const">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+
+
+    <modify-function signature="operator=(const QListWidgetItem&amp;)" remove="all"/>
+    <modify-function signature="QListWidgetItem(QListWidget *, int)">
+        <modify-argument index="this">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="QListWidgetItem(const QString &amp;, QListWidget *, int)">
+        <modify-argument index="this">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="QListWidgetItem(const QIcon &amp;, const QString &amp;, QListWidget *, int)">
+        <modify-argument index="this">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="clone() const">
+        <modify-argument index="return">
+            <define-ownership class="shell" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+
+      <modify-function signature="backgroundColor()const" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="setBackgroundColor(QColor)" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="setTextColor(QColor)" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="textColor()const" remove="all"/> <!--### Obsolete in 4.3-->
+  </object-type>
+
+  <object-type name="QGraphicsTextItem"> <!-- a QObject so main-thread delete redundant -->
+    <extra-includes>
+      <include file-name="QTextCursor" location="global"/>
+    </extra-includes>
+    <modify-function signature="QGraphicsTextItem(QGraphicsItem*,QGraphicsScene*)">
+        <inject-code position="end">
+            <argument-map index="1" meta-name="%1"/>
+            if (%1 != null) disableGarbageCollection();
+        </inject-code>
+    </modify-function>
+    <modify-function signature="QGraphicsTextItem(const QString &amp;,QGraphicsItem*,QGraphicsScene*)">
+        <inject-code position="end">
+            <argument-map index="2" meta-name="%2"/>
+            if (%2 != null) disableGarbageCollection();
+        </inject-code>
+    </modify-function>
+    <modify-function signature="setDocument(QTextDocument*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcDocument"/>
+        </modify-argument>
+    </modify-function>
+
+      <modify-function signature="matrix()const" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="resetMatrix()" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="sceneMatrix()const" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="setMatrix(QMatrix, bool)" remove="all"/> <!--### Obsolete in 4.3-->
+  </object-type>
+
+  <object-type name="QCompleter">
+    <modify-function signature="activated(const QModelIndex &amp;)">
+        <rename to="activatedIndex"/>
+    </modify-function>
+    <modify-function signature="highlighted(const QModelIndex &amp;)">
+        <rename to="highlightedIndex"/>
+    </modify-function>
+    <modify-function signature="setModel(QAbstractItemModel *)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcModel"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setPopup(QAbstractItemView *)">
+        <modify-argument index="1">
+            <no-null-pointer/>
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setWidget(QWidget *)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcWidget"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+
+
+  <object-type name="QTreeWidgetItem" delete-in-main-thread="yes">
+
+    <modify-function signature="operator&lt;(QTreeWidgetItem)const">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="read(QDataStream&amp;)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="write(QDataStream&amp;)const">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+
+    <modify-function signature="QTreeWidgetItem(const QTreeWidgetItem &amp;)" remove="all"/>
+    <modify-function signature="operator=(const QTreeWidgetItem&amp;)" remove="all"/>
+
+    <modify-function signature="QTreeWidgetItem(QTreeWidget *,int)">
+        <modify-argument index="this">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="QTreeWidgetItem(QTreeWidget *,const QStringList&lt;QString&gt; &amp;,int)">
+        <modify-argument index="this">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="QTreeWidgetItem(QTreeWidget *,QTreeWidgetItem *,int)">
+        <modify-argument index="this">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="QTreeWidgetItem(QTreeWidgetItem *,int)">
+        <modify-argument index="this">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="QTreeWidgetItem(QTreeWidgetItem *,const QStringList&lt;QString&gt; &amp;,int)">
+        <modify-argument index="this">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="QTreeWidgetItem(QTreeWidgetItem *,QTreeWidgetItem *,int)">
+        <modify-argument index="this">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="clone() const">
+        <modify-argument index="return">
+            <define-ownership class="shell" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="addChild(QTreeWidgetItem *)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="addChildren(const QList&lt;QTreeWidgetItem*&gt; &amp;)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertChild(int, QTreeWidgetItem *)">
+        <modify-argument index="2">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertChildren(int, const QList&lt;QTreeWidgetItem*&gt; &amp;)">
+        <modify-argument index="2">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="removeChild(QTreeWidgetItem*)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="default"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="takeChild(int)">
+        <modify-argument index="return">
+            <define-ownership class="java" owner="default"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="takeChildren()">
+        <modify-argument index="return">
+            <define-ownership class="java" owner="default"/>
+        </modify-argument>
+    </modify-function>
+
+      <modify-function signature="backgroundColor(int)const" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="setBackgroundColor(int, QColor)" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="setTextColor(int, QColor)" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="textColor(int)const" remove="all"/> <!--### Obsolete in 4.3-->
+  </object-type>
+
+  <object-type name="QListWidget">
+    <modify-function signature="mimeData(const QList&lt;QListWidgetItem *&gt;)const">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="addItem(QListWidgetItem *)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertItem(int, QListWidgetItem *)">
+        <modify-argument index="2">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="removeItemWidget(QListWidgetItem*)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="default"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setCurrentItem(QListWidgetItem*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setCurrentItem(QListWidgetItem*,QFlags&lt;QItemSelectionModel::SelectionFlag&gt;)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setItemHidden(const QListWidgetItem*,bool)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="isItemHidden(const QListWidgetItem*)const">
+        <remove/>
+    </modify-function>
+    <modify-function signature="setItemSelected(const QListWidgetItem*,bool)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="isItemSelected(const QListWidgetItem*)const">
+        <remove/>
+    </modify-function>
+    <modify-function signature="takeItem(int)">
+        <modify-argument index="return">
+            <define-ownership class="java" owner="default"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setItemWidget(QListWidgetItem*,QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+        <modify-argument index="2">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setModel(QAbstractItemModel*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+
+  </object-type>
+
+  <object-type name="QWidget">
+    <extra-includes>
+        <include file-name="QIcon" location="global"/>
+        <include file-name="QMessageBox" location="global"/>
+    </extra-includes>
+
+    <modify-function signature="actionEvent(QActionEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="changeEvent(QEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="closeEvent(QCloseEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="contextMenuEvent(QContextMenuEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="dragEnterEvent(QDragEnterEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="dragLeaveEvent(QDragLeaveEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="dragMoveEvent(QDragMoveEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="dropEvent(QDropEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="enterEvent(QEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="focusInEvent(QFocusEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="focusOutEvent(QFocusEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="hideEvent(QHideEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="inputMethodEvent(QInputMethodEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="keyPressEvent(QKeyEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="keyReleaseEvent(QKeyEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="leaveEvent(QEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="mouseDoubleClickEvent(QMouseEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="mouseMoveEvent(QMouseEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="mousePressEvent(QMouseEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="mouseReleaseEvent(QMouseEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="moveEvent(QMoveEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="paintEvent(QPaintEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="resizeEvent(QResizeEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="showEvent(QShowEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="tabletEvent(QTabletEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="wheelEvent(QWheelEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+
+    <modify-function signature="render(QPainter*,QPoint,QRegion,QFlags&lt;QWidget::RenderFlag&gt;)">
+        <modify-argument index="2">
+            <!-- Removed because the render(QPainter*) overload conflicts with the identical function in QGraphicsView -->
+            <remove-default-expression />
+        </modify-argument>
+    </modify-function>
+
+    <inject-code class="native">
+        extern "C" JNIEXPORT void JNICALL QTJAMBI_FUNCTION_PREFIX(Java_com_trolltech_qt_gui_QWidget__1_1qt_1QMessageBox_1setWindowTitle)
+        (JNIEnv *__jni_env,
+            jclass,
+            jlong __this_nativeId,
+            jobject title0)
+        {
+            QTJAMBI_DEBUG_TRACE("(native) entering: QMessageBox::setWindowTitle(const QString &amp; title)");
+            QString __qt_title0 =  qtjambi_to_qstring(__jni_env, (jstring) title0);
+            QTJAMBI_EXCEPTION_CHECK(__jni_env);
+            QMessageBox *__qt_this = (QMessageBox *) qtjambi_from_jlong(__this_nativeId);
+            QTJAMBI_EXCEPTION_CHECK(__jni_env);
+            Q_ASSERT(__qt_this);
+            __qt_this-&gt;setWindowTitle((const QString&amp; )__qt_title0);
+            QTJAMBI_DEBUG_TRACE("(native) -&gt; leaving: QMessageBox::setWindowTitle(const QString &amp; title)");
+        }
+    </inject-code>
+
+    <inject-code class="native">
+        extern "C" JNIEXPORT void JNICALL QTJAMBI_FUNCTION_PREFIX(Java_com_trolltech_qt_gui_QWidget__1_1qt_1QMessageBox_1setWindowModality)
+        (JNIEnv *__jni_env,
+            jclass,
+            jlong __this_nativeId,
+            jint windowModality0)
+        {
+            Q_UNUSED(__jni_env);
+            QTJAMBI_DEBUG_TRACE("(native) entering: QMessageBox::setWindowModality(Qt::WindowModality modality)");
+            Qt::WindowModality __qt_windowModality0 = (Qt::WindowModality) windowModality0;
+            QTJAMBI_EXCEPTION_CHECK(__jni_env);
+            QMessageBox *__qt_this = (QMessageBox *) qtjambi_from_jlong(__this_nativeId);
+            QTJAMBI_EXCEPTION_CHECK(__jni_env);
+            Q_ASSERT(__qt_this);
+            __qt_this-&gt;setWindowModality((Qt::WindowModality )__qt_windowModality0);
+            QTJAMBI_DEBUG_TRACE("(native) -&gt; leaving: QMessageBox::setWindowModality(Qt::WindowModality modality)");
+        }
+    </inject-code>
+
+    <modify-function signature="render(QPaintDevice *, const QPoint &amp;, const QRegion &amp;, QFlags&lt;QWidget::RenderFlag&gt;)">
+        <modify-argument index="4">
+            <replace-default-expression with="RenderFlag.DrawWindowBackground, RenderFlag.DrawChildren"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="render(QPainter *, const QPoint &amp;, const QRegion &amp;, QFlags&lt;QWidget::RenderFlag&gt;)">
+        <modify-argument index="4">
+            <replace-default-expression with="RenderFlag.DrawWindowBackground, RenderFlag.DrawChildren"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setFocusProxy(QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcFocusProxy"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setInputContext(QInputContext*)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setLayout(QLayout*)">
+        <modify-argument index="1">
+            <no-null-pointer/>
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setParent(QWidget*,QFlags&lt;Qt::WindowType&gt;)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setParent(QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setStyle(QStyle*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcStyle"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setTabOrder(QWidget*,QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+        <modify-argument index="2">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="getContentsMargins(int*,int*,int*,int*)const">
+        <access modifier="private"/>
+    </modify-function>
+
+    <modify-function signature="addAction(QAction *)">
+        <modify-argument index="1">
+            <reference-count action="add" variable-name="__rcActions"/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="insertAction(QAction *, QAction *)">
+        <modify-argument index="2">
+            <reference-count action="add" variable-name="__rcActions"/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="addActions(const QList&lt;QAction *&gt; &amp;)">
+        <modify-argument index="1">
+            <reference-count action="add-all" variable-name="__rcActions"/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="insertActions(QAction *, const QList&lt;QAction *&gt; &amp;)">
+        <modify-argument index="2">
+            <reference-count action="add-all" variable-name="__rcActions"/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="removeAction(QAction *)">
+        <modify-argument index="1">
+            <reference-count action="remove" variable-name="__rcActions"/>
+        </modify-argument>
+    </modify-function>
+      <modify-function signature="enabledChange(bool)" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="fontChange(QFont)" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="isEnabledToTLW()const" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="isTopLevel()const" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="paletteChange(QPalette)" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="setShown(bool)" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="topLevelWidget()const" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="windowActivationChange(bool)" remove="all"/> <!--### Obsolete in 4.3-->
+  </object-type>
+
+  <object-type name="QMessageBox">
+    <modify-function signature="setWindowTitle(const QString &amp;)" remove="all"/>
+    <modify-function signature="setWindowModality(Qt::WindowModality)" remove="all"/>
+    <extra-includes>
+        <include file-name="QPixmap" location="global"/>
+    </extra-includes>
+    <modify-function signature="addButton(QAbstractButton*,QMessageBox::ButtonRole)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="removeButton(QAbstractButton*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setDefaultButton(QPushButton*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setEscapeButton(QAbstractButton*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+
+      <modify-function signature="QMessageBox(QString,QString,QMessageBox::Icon,int,int,int,QWidget*,QFlags&lt;Qt::WindowType&gt;)" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="buttonText(int)const" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="setButtonText(int, QString)" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="standardIcon(QMessageBox::Icon)" remove="all"/> <!--### Obsolete in 4.3-->
+
+      <modify-function signature="critical(QWidget*,QString,QString,int,int,int)" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="critical(QWidget*,QString,QString,QString,QString,QString,int,int)" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="information(QWidget*,QString,QString,int,int,int)" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="information(QWidget*,QString,QString,QString,QString,QString,int,int)" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="question(QWidget*, QString, QString, int, int, int)" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="question(QWidget*, QString, QString, QString, QString, QString, int, int)" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="warning(QWidget*, QString, QString, int, int, int)" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="warning(QWidget*, QString, QString, QString, QString, QString, int, int)" remove="all"/> <!--### Obsolete in 4.3-->
+  </object-type>
+
+  <object-type name="QAbstractSpinBox">
+    <modify-function signature="initStyleOption(QStyleOptionSpinBox*)const">
+        <access modifier="private"/>
+    </modify-function>
+    <modify-function signature="setLineEdit(QLineEdit*)">
+        <modify-argument index="1">
+            <!-- Safe to ignore because the spinbox reparents the line edit -->
+            <reference-count action="ignore"/>
+            <no-null-pointer/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+
+  <object-type name="QTextFrame" delete-in-main-thread="yes">
+    <extra-includes>
+        <include file-name="QTextCursor" location="global"/>
+    </extra-includes>
+  </object-type>
+
+  <object-type name="QImageIOHandler">
+    <extra-includes>
+        <include file-name="QRect" location="global"/>
+    </extra-includes>
+    <modify-function signature="setFormat(const QByteArray &amp;)const">
+        <remove/>
+    </modify-function>
+    <modify-function signature="setDevice(QIODevice*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcDevice"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="read(QImage*)">
+        <modify-argument index="1">
+            <replace-type modified-type="qt.gui.QImage"/>
+            <conversion-rule class="shell">
+                jobject %out = qtjambi_from_object(__jni_env, %in, "QImage", "com/trolltech/qt/gui/", false);
+
+                QtJambiLink *__link = %out != 0 ? QtJambiLink::findLink(__jni_env, %out) : 0;
+            </conversion-rule>
+            <conversion-rule class="native">
+                QImage *%out = (QImage *) qtjambi_to_object(__jni_env, %in);
+            </conversion-rule>
+        </modify-argument>
+        <modify-argument index="0">
+            <conversion-rule class="shell">
+                // Invalidate object
+                if (__link != 0) __link-&gt;resetObject(__jni_env);
+                bool %out = (bool) %in;
+            </conversion-rule>
+        </modify-argument>
+    </modify-function>
+
+      <modify-function signature="name()const" remove="all"/> <!--### Obsolete in 4.3-->
+  </object-type>
+
+  <object-type name="QProxyModel">
+    <modify-function signature="parent()const" remove="all"/>
+    <extra-includes>
+        <include file-name="QPixmap" location="global"/>
+        <include file-name="QStringList" location="global"/>
+        <include file-name="QSize" location="global"/>
+    </extra-includes>
+    <modify-function signature="setModel(QAbstractItemModel*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcModel"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+
+  <object-type name="QImageReader">
+    <extra-includes>
+        <include file-name="QColor" location="global"/>
+        <include file-name="QRect" location="global"/>
+        <include file-name="QSize" location="global"/>
+        <include file-name="QStringList" location="global"/>
+        <include file-name="QImage" location="global"/>
+    </extra-includes>
+    <modify-function signature="read(QImage*) ">
+        <remove/>
+    </modify-function>
+    <modify-function signature="setDevice(QIODevice*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcDevice"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+
+  <object-type name="QMovie">
+    <extra-includes>
+        <include file-name="QColor" location="global"/>
+        <include file-name="QImage" location="global"/>
+        <include file-name="QPixmap" location="global"/>
+        <include file-name="QRect" location="global"/>
+        <include file-name="QSize" location="global"/>
+    </extra-includes>
+    <modify-function signature="cacheMode()">
+        <remove/>
+    </modify-function>
+    <modify-function signature="setDevice(QIODevice*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcDevice"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+
+  <object-type name="QPageSetupDialog">
+  </object-type>
+
+  <object-type name="QTabWidget">
+    <modify-function signature="initStyleOption(QStyleOptionTabWidgetFrame*)const">
+        <access modifier="private"/>
+    </modify-function>
+    <inject-code>
+        <insert-template name="gui.init_style_option">
+            <replace from="%TYPE" to="QStyleOptionTabWidgetFrame"/>
+        </insert-template>
+    </inject-code>
+    <modify-function signature="addTab(QWidget*,QIcon,QString)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="addTab(QWidget*,QString)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertTab(int,QWidget*,QString)">
+        <modify-argument index="2">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertTab(int,QWidget*,QIcon,QString)">
+        <modify-argument index="2">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setCornerWidget(QWidget*,Qt::Corner)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setCurrentWidget(QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setTabBar(QTabBar*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+  <object-type name="QDrag">
+    <extra-includes>
+        <include file-name="QPoint" location="global"/>
+        <include file-name="QPixmap" location="global"/>
+    </extra-includes>
+    <modify-function signature="setMimeData(QMimeData*)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="start(QFlags&lt;Qt::DropAction&gt;)" remove="all"/> <!--### Obsolete in 4.3-->
+  </object-type>
+
+  <object-type name="QDateTimeEdit">
+    <modify-function signature="initStyleOption(QStyleOptionSpinBox*)const" access="private" rename="initDateTimeEditStyleOption"/>
+    <modify-function signature="setCalendarWidget(QCalendarWidget*)">
+        <modify-argument index="1">
+            <!-- Safe to ignore because widget is reparented -->
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+
+  </object-type>
+
+  <object-type name="QSortFilterProxyModel">
+     <modify-function signature="parent()const" remove="all"/>
+    <extra-includes>
+        <include file-name="QItemSelection" location="global"/>
+        <include file-name="QStringList" location="global"/>
+        <include file-name="QSize" location="global"/>
+    </extra-includes>
+
+    <modify-function signature="setSourceModel(QAbstractItemModel *)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcSourceModel"/>
+        </modify-argument>
+    </modify-function>
+
+      <modify-function signature="clear()" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="filterChanged()" remove="all"/> <!--### Obsolete in 4.3-->
+  </object-type>
+
+  <object-type name="QSlider">
+    <modify-function signature="initStyleOption(QStyleOptionSlider*)const">
+        <access modifier="private"/>
+    </modify-function>
+  </object-type>
+
+  <object-type name="QInputContext">
+    <extra-includes>
+        <include file-name="QTextFormat" location="global"/>
+    </extra-includes>
+    <modify-function signature="setFocusWidget(QWidget*)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="filterEvent(const QEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="mouseHandler(int,QMouseEvent*)">
+        <modify-argument index="2" invalidate-after-use="yes" />
+    </modify-function>
+
+  </object-type>
+
+  <object-type name="QProgressDialog">
+    <modify-function signature="setBar(QProgressBar*)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setCancelButton(QPushButton*)">
+        <modify-argument index="1">
+            <!-- Safe to ignore because button is reparented -->
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setLabel(QLabel*)">
+        <modify-argument index="1">
+            <!-- Safe to ignore because label is reparented -->
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+
+  </object-type>
+
+  <object-type name="QLabel">
+    <modify-function signature="picture()const">
+        <access modifier="private"/>
+        <rename to="picture_private"/>
+    </modify-function>
+
+    <modify-function signature="setBuddy(QWidget *)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcBuddy"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setMovie(QMovie *)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcMovie"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="pixmap()const">
+        <access modifier="private"/>
+        <rename to="pixmap_private"/>
+    </modify-function>
+  </object-type>
+
+  <object-type name="QFileDialog">
+    <extra-includes>
+        <include file-name="QUrl" location="global"/>
+    </extra-includes>
+    <modify-function signature="getOpenFileName(QWidget*,QString,QString,QString,QString*,QFlags&lt;QFileDialog::Option&gt;)">
+        <access modifier="private"/>
+        <modify-argument index="1">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="2">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="3">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="4">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="5">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="6">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="getOpenFileNames(QWidget*,QString,QString,QString,QString*,QFlags&lt;QFileDialog::Option&gt;)">
+        <access modifier="private"/>
+        <modify-argument index="1">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="2">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="3">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="4">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="5">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="6">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="getSaveFileName(QWidget*,QString,QString,QString,QString*,QFlags&lt;QFileDialog::Option&gt;)">
+        <access modifier="private"/>
+        <modify-argument index="1">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="2">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="3">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="4">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="5">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="6">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="setIconProvider(QFileIconProvider*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcIconProvider"/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="setItemDelegate(QAbstractItemDelegate*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcItemDelegate"/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="setProxyModel(QAbstractProxyModel*)">
+        <modify-argument index="1">
+            <!-- Reparented -->
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+
+  </object-type>
+
+  <object-type name="QErrorMessage" />
+
+  <object-type name="QTabBar">
+    <extra-includes>
+        <include file-name="QIcon" location="global"/>
+    </extra-includes>
+    <modify-function signature="initStyleOption(QStyleOptionTab*,int)const">
+        <access modifier="private"/>
+    </modify-function>
+  </object-type>
+
+  <object-type name="QStandardItemModel">
+    <modify-function signature="insertColumn(int,const QModelIndex &amp;)" remove="all"/>
+    <modify-function signature="insertRow(int,const QModelIndex &amp;)" remove="all"/>
+    <modify-function signature="parent()const" remove="all"/>
+    <extra-includes>
+        <include file-name="QStringList" location="global"/>
+        <include file-name="QSize" location="global"/>
+    </extra-includes>
+
+    <modify-function signature="appendColumn(const QList&lt;QStandardItem *&gt;&amp;)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="takeColumn(int)">
+        <modify-argument index="return">
+            <define-ownership class="java" owner="default"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="takeRow(int)">
+        <modify-argument index="return">
+            <define-ownership class="java" owner="default"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="takeHorizontalHeaderItem(int)">
+        <modify-argument index="return">
+            <define-ownership class="java" owner="default"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="takeVerticalHeaderItem(int)">
+        <modify-argument index="return">
+            <define-ownership class="java" owner="default"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="takeItem(int,int)">
+        <modify-argument index="return">
+            <define-ownership class="java" owner="default"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="appendRow(const QList&lt;QStandardItem *&gt;&amp;)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="appendRow(QStandardItem *)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertColumn(int, const QList&lt;QStandardItem *&gt;&amp;)">
+        <modify-argument index="2">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertRow(int, const QList&lt;QStandardItem *&gt;&amp;)">
+        <modify-argument index="2">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertRow(int, QStandardItem *)">
+        <modify-argument index="2">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setHorizontalHeaderItem(int, QStandardItem *)">
+        <modify-argument index="2">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setItem(int, int, QStandardItem *)">
+        <modify-argument index="3">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setItem(int, QStandardItem *)">
+        <modify-argument index="2">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setItemPrototype(const QStandardItem *)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setVerticalHeaderItem(int, QStandardItem *)">
+        <modify-argument index="2">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+
+  <object-type name="QRadioButton">
+    <modify-function signature="initStyleOption(QStyleOptionButton*)const">
+        <access modifier="private"/>
+    </modify-function>
+  </object-type>
+
+  <object-type name="QScrollBar">
+    <modify-function signature="initStyleOption(QStyleOptionSlider*)const">
+        <access modifier="private"/>
+    </modify-function>
+  </object-type>
+
+  <object-type name="QClipboard">
+    <extra-includes>
+        <include file-name="QImage" location="global"/>
+        <include file-name="QPixmap" location="global"/>
+    </extra-includes>
+    <modify-function signature="setMimeData(QMimeData *, QClipboard::Mode)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+
+
+  </object-type>
+
+  <object-type name="QAbstractScrollArea">
+    <modify-function signature="setupViewport(QWidget *)" access="non-final"/>
+    <modify-function signature="addScrollBarWidget(QWidget*,QFlags&lt;Qt::AlignmentFlag&gt;)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setCornerWidget(QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setHorizontalScrollBar(QScrollBar*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="setVerticalScrollBar(QScrollBar*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="setViewport(QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="setupViewport(QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="viewportEvent(QEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+
+  </object-type>
+
+  <object-type name="QPaintEngineState">
+    <extra-includes>
+        <include file-name="QPainterPath" location="global"/>
+    </extra-includes>
+  </object-type>
+
+  <object-type name="QRubberBand">
+    <modify-function signature="initStyleOption(QStyleOptionRubberBand*)const">
+        <access modifier="private"/>
+    </modify-function>
+    <modify-function signature="move(int,int)" rename="moveRubberBand"/>
+    <modify-function signature="move(const QPoint &amp;)" rename="moveRubberBand"/>
+    <modify-function signature="resize(int,int)" rename="resizeRubberBand"/>
+    <modify-function signature="resize(const QSize &amp;)" rename="resizeRubberBand"/>
+    <modify-function signature="setGeometry(int,int,int,int)" rename="setRubberBandGeometry"/>
+    <modify-function signature="setGeometry(const QRect &amp;)" rename="setRubberBandGeometry"/>
+  </object-type>
+
+  <object-type name="QTextLayout">
+    <extra-includes>
+        <include file-name="QTextOption" location="global"/>
+    </extra-includes>
+  </object-type>
+
+  <object-type name="QTableWidget">
+    <modify-function signature="mimeData(const QList&lt;QTableWidgetItem*&gt;)const">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="isSortingEnabled()const" remove="all"/>
+    <modify-function signature="setSortingEnabled(bool)" remove="all"/>
+    <modify-function signature="setHorizontalHeaderItem(int, QTableWidgetItem *)">
+        <modify-argument index="2">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setItem(int, int, QTableWidgetItem *)">
+        <modify-argument index="3">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="takeHorizontalHeaderItem(int)">
+        <modify-argument index="return">
+            <define-ownership class="java" owner="default"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="takeVerticalHeaderItem(int)">
+        <modify-argument index="return">
+            <define-ownership class="java" owner="default"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="takeItem(int,int)">
+        <modify-argument index="return">
+            <define-ownership class="java" owner="default"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setItemPrototype(const QTableWidgetItem *)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setVerticalHeaderItem(int, QTableWidgetItem *)">
+        <modify-argument index="2">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setCellWidget(int,int,QWidget*)">
+        <modify-argument index="3">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setCurrentItem(QTableWidgetItem*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setCurrentItem(QTableWidgetItem*,QFlags&lt;QItemSelectionModel::SelectionFlag&gt;)">
+        <modify-argument index="1">
+            <reference-count action="ignore" />
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setItemSelected(const QTableWidgetItem*,bool)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="isItemSelected(const QTableWidgetItem*)const">
+        <remove/>
+    </modify-function>
+    <modify-function signature="setModel(QAbstractItemModel*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+  <object-type name="QTextDocument">
+    <extra-includes>
+        <include file-name="QTextBlock" location="global"/>
+        <include file-name="QTextFormat" location="global"/>
+        <include file-name="QTextCursor" location="global"/>
+    </extra-includes>
+    <modify-function signature="redo(QTextCursor*)">
+        <access modifier="private"/>
+    </modify-function>
+    <modify-function signature="setDocumentLayout(QAbstractTextDocumentLayout*)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="undo(QTextCursor*)">
+        <access modifier="private"/>
+    </modify-function>
+  </object-type>
+
+  <object-type name="QSplitter">
+
+    <modify-function signature="getRange(int,int*,int*)const">
+        <access modifier="private"/>
+    </modify-function>
+    <modify-function signature="addWidget(QWidget *)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertWidget(int, QWidget *)">
+        <modify-argument index="2">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+
+  <object-type name="QGroupBox">
+    <modify-function signature="initStyleOption(QStyleOptionGroupBox*)const">
+        <access modifier="private"/>
+    </modify-function>
+  </object-type>
+
+  <object-type name="QStackedWidget">
+    <modify-function signature="addWidget(QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertWidget(int,QWidget*)">
+        <modify-argument index="2">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="removeWidget(QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setCurrentWidget(QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+
+  <object-type name="QSplitterHandle">
+  </object-type>
+
+  <object-type name="QDial">
+    <modify-function signature="initStyleOption(QStyleOptionSlider*)const">
+        <access modifier="private"/>
+    </modify-function>
+  </object-type>
+
+  <object-type name="QLineEdit">
+    <modify-function signature="initStyleOption(QStyleOptionFrame*)const">
+        <access modifier="private"/>
+    </modify-function>
+    <modify-function signature="setCompleter(QCompleter *)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcCompleter"/>
+        </modify-argument>
+    </modify-function>
+     <modify-function signature="setValidator(const QValidator *)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcValidator"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+
+  <object-type name="QLCDNumber" />
+
+  <object-type name="QSplashScreen">
+    <modify-function signature="showMessage(const QString &amp;, int, const QColor &amp;)">
+      <modify-argument index="3">
+        <replace-default-expression with="QColor.black"/>
+      </modify-argument>
+    </modify-function>
+    <modify-function signature="repaint()" remove="all"/>
+    <modify-function signature="drawContents(QPainter*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+  </object-type>
+
+  <object-type name="QDockWidget">
+    <modify-function signature="initStyleOption(QStyleOptionDockWidget*)const">
+        <access modifier="private"/>
+    </modify-function>
+    <inject-code>
+        <insert-template name="gui.init_style_option">
+            <replace from="%TYPE" to="QStyleOptionDockWidget"/>
+        </insert-template>
+    </inject-code>
+    <modify-function signature="setTitleBarWidget(QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setWidget(QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+
+  <object-type name="QAbstractProxyModel">
+    <extra-includes>
+        <include file-name="QItemSelection" location="global"/>
+        <include file-name="QStringList" location="global"/>
+        <include file-name="QSize" location="global"/>
+    </extra-includes>
+
+    <modify-function signature="setSourceModel(QAbstractItemModel *)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcSourceModel"/>
+        </modify-argument>
+    </modify-function>
+
+  </object-type>
+
+  <object-type name="QDesktopWidget">
+  </object-type>
+
+  <object-type name="QFrame">
+  </object-type>
+
+  <object-type name="QTextTable">
+    <modify-function signature="format() const">
+        <rename to="tableFormat"/>
+    </modify-function>
+    <extra-includes>
+        <include file-name="QTextCursor" location="global"/>
+    </extra-includes>
+  </object-type>
+
+  <object-type name="QSpinBox">
+    <modify-function signature="valueChanged(const QString &amp;)">
+        <rename to="valueStringChanged"/>
+    </modify-function>
+  </object-type>
+
+  <object-type name="QTextBrowser">
+    <modify-function signature="highlighted(const QString &amp;)">
+        <rename to="highlightedString"/>
+    </modify-function>
+  </object-type>
+
+  <object-type name="QDoubleSpinBox">
+    <modify-function signature="valueChanged(const QString &amp;)">
+        <rename to="valueStringChanged"/>
+    </modify-function>
+  </object-type>
+
+  <object-type name="QButtonGroup">
+    <modify-function signature="buttonClicked(int)">
+        <rename to="buttonIdClicked"/>
+    </modify-function>
+    <modify-function signature="buttonPressed(int)">
+        <rename to="buttonIdPressed"/>
+    </modify-function>
+    <modify-function signature="buttonReleased(int)">
+        <rename to="buttonIdReleased"/>
+    </modify-function>
+    <modify-function signature="addButton(QAbstractButton *)">
+        <modify-argument index="1">
+            <reference-count action="add" variable-name="__rcButtons"/>
+            <no-null-pointer/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="addButton(QAbstractButton *, int)">
+        <modify-argument index="1">
+            <reference-count action="add" variable-name="__rcButtons"/>
+            <no-null-pointer/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="removeButton(QAbstractButton *)">
+        <modify-argument index="1">
+            <reference-count action="remove" variable-name="__rcButtons"/>
+            <no-null-pointer/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setId(QAbstractButton *,int)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+
+  <object-type name="QToolBar">
+    <modify-function signature="addAction(QAction *)" remove="all"/>
+    <modify-function signature="initStyleOption(QStyleOptionToolBar*)const">
+        <access modifier="private"/>
+    </modify-function>
+    <modify-function signature="addAction(QIcon,QString,const QObject*,const char*)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="addAction(QString,const QObject*,const char*)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="addWidget(QWidget*)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertWidget(QAction*,QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+        <modify-argument index="2">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertSeparator(QAction*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+
+  <object-type name="QPaintEngine">
+
+    <modify-function signature="begin(QPaintDevice*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="updateState(QPaintEngineState)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="drawTextItem(QPointF,QTextItem)">
+        <modify-argument index="2" invalidate-after-use="yes" />
+    </modify-function>
+
+    <extra-includes>
+        <include file-name="QVarLengthArray" location="global"/>
+    </extra-includes>
+    <modify-function signature="setPaintDevice(QPaintDevice*)">
+        <remove/>
+    </modify-function>
+    <modify-field name="state" read="false" write="false"/>
+  </object-type>
+
+  <object-type name="QAbstractTableModel">
+    <extra-includes>
+        <include file-name="QStringList" location="global"/>
+        <include file-name="QSize" location="global"/>
+    </extra-includes>
+  </object-type>
+
+  <object-type name="QGuiSignalMapper"/>
+
+  <object-type name="QComboBox">
+    <modify-function signature="initStyleOption(QStyleOptionComboBox*)const">
+        <access modifier="private"/>
+    </modify-function>
+    <modify-function signature="setCompleter(QCompleter*)">
+        <modify-argument index="1">
+            <reference-count variable-name="__rcCompleter" action="set"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setValidator(const QValidator*)">
+        <modify-argument index="1">
+            <reference-count variable-name="__rcValidator" action="set"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setItemDelegate(QAbstractItemDelegate *)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+            <no-null-pointer/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setView(QAbstractItemView *)">
+        <modify-argument index="1">
+            <no-null-pointer/>
+            <!-- Safe to ignore because combo box reparents view -->
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setLineEdit(QLineEdit *)">
+        <modify-argument index="1">
+            <no-null-pointer/>
+            <!-- Safe to ignore because combo box reparents line edit -->
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setModel(QAbstractItemModel *)">
+        <modify-argument index="1">
+            <no-null-pointer/>
+            <reference-count action="set" variable-name="__rcModel"/>
+        </modify-argument>
+    </modify-function>
+    <inject-code>
+        <insert-template name="gui.init_style_option">
+            <replace from="%TYPE" to="QStyleOptionComboBox"/>
+        </insert-template>
+    </inject-code>
+    <modify-function signature="activated(int)">&gt;
+        <rename to="activatedIndex"/>
+    </modify-function>
+    <modify-function signature="currentIndexChanged(const QString &amp;)">
+        <rename to="currentStringChanged"/>
+    </modify-function>
+    <modify-function signature="highlighted(int)">
+        <rename to="highlightedIndex"/>
+    </modify-function>
+
+      <modify-function signature="autoCompletion()const" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="autoCompletionCaseSensitivity()const" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="setAutoCompletion(bool)" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="setAutoCompletionCaseSensitivity(Qt::CaseSensitivity)" remove="all"/> <!--### Obsolete in 4.3-->
+  </object-type>
+
+  <object-type name="QTextEdit">
+    <extra-includes>
+        <include file-name="QTextCursor" location="global"/>
+    </extra-includes>
+    <modify-function signature="setDocument(QTextDocument*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcDocument"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertFromMimeData(const QMimeData*)    ">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+
+  <object-type name="QPrinter" delete-in-main-thread="yes">
+    <modify-function signature="setEngines(QPrintEngine*,QPaintEngine*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcPrintEngine"/>
+        </modify-argument>
+        <modify-argument index="2">
+            <reference-count action="set" variable-name="__rcPaintEngine"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+
+  <object-type name="QAction">
+      <modify-function signature="setMenu(QMenu*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcMenu"/>
+        </modify-argument>
+    </modify-function>
+
+  </object-type>
+
+  <object-type name="QPainter">
+    <extra-includes>
+      <include file-name="QWidget" location="global"/>
+      <include file-name="QPainterPath" location="global"/>
+      <include file-name="QPixmap" location="global"/>
+    </extra-includes>
+
+    <modify-function signature="drawText(const QPointF &amp;, const QString &amp;, int, int)" remove="all" />
+
+    <modify-function signature="drawConvexPolygon(const QPoint *, int)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="drawConvexPolygon(const QPointF *, int)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="drawLines(const QLine *, int)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="drawLines(const QLineF *, int)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="drawLines(const QPoint *, int)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="drawLines(const QPointF *, int)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="drawPoints(const QPoint *, int)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="drawPoints(const QPointF *, int)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="drawPolygon(const QPoint *, int, Qt::FillRule)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="drawPolygon(const QPointF *, int, Qt::FillRule)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="drawPolyline(const QPoint *, int)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="drawPolyline(const QPointF *, int)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="drawRects(const QRect *, int)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="drawRects(const QRectF *, int)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="drawLines(const QVector&lt;QPoint&gt; &amp;)">
+        <rename to="drawLinesFromPoints"/>
+    </modify-function>
+    <modify-function signature="drawLines(const QVector&lt;QPointF&gt; &amp;)">
+        <rename to="drawLinesFromPointsF"/>
+    </modify-function>
+    <modify-function signature="drawLines(const QVector&lt;QLineF&gt; &amp;)">
+        <rename to="drawLinesF"/>
+    </modify-function>
+    <modify-function signature="drawRects(const QVector&lt;QRectF&gt; &amp;)">
+        <rename to="drawRectsF"/>
+    </modify-function>
+
+    <modify-function signature="QPainter(QPaintDevice *)">
+        <modify-argument index="1">
+            <no-null-pointer/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="begin(QPaintDevice *)">
+        <modify-argument index="1">
+            <no-null-pointer/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="initFrom(const QWidget *)">
+        <modify-argument index="1">
+            <no-null-pointer/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setRedirected(const QPaintDevice *, QPaintDevice *, const QPoint &amp;)">
+        <modify-argument index="1">
+            <no-null-pointer />
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="restoreRedirected(const QPaintDevice *)">
+        <modify-argument index="1">
+            <no-null-pointer />
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="drawText(QRect,int,QString,QRect*)">
+        <access modifier="private"/>
+        <modify-argument index="4">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="drawText(QRectF,int,QString,QRectF*)">
+        <access modifier="private"/>
+        <modify-argument index="4">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="drawText(int,int,int,int,int,QString,QRect*)">
+        <access modifier="private"/>
+        <modify-argument index="7">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="redirected(const QPaintDevice*,QPoint*)">
+        <access modifier="private"/>
+        <modify-argument index="2">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="matrix()const" remove="all"/> <!--### Obsolete in 4.3-->
+    <modify-function signature="matrixEnabled()const" remove="all"/> <!--### Obsolete in 4.3-->
+    <modify-function signature="setMatrix(QMatrix, bool)" remove="all"/> <!--### Obsolete in 4.3-->
+    <modify-function signature="setMatrixEnabled(bool)" remove="all"/> <!--### Obsolete in 4.3-->
+  </object-type>
+
+  <object-type name="QApplication">
+    <extra-includes>
+      <include file-name="QBasicTimer" location="global"/>
+      <include file-name="QFont" location="global"/>
+      <include file-name="QFontMetrics" location="global"/>
+      <include file-name="QPalette" location="global"/>
+      <include file-name="QIcon" location="global"/>
+      <include file-name="QLocale" location="global"/>
+    </extra-includes>
+
+    <modify-function signature="QApplication(int &amp;, char  **, int)">
+        <access modifier="private"/>
+    </modify-function>
+    <modify-function signature="QApplication(int &amp;, char **, QApplication::Type, int)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="QApplication(int &amp;, char **, bool, int)">
+        <remove/>
+    </modify-function>
+
+    <modify-function signature="font(const char*)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="setFont(QFont,const char*)">
+        <access modifier="private"/>
+        <modify-argument index="2">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="palette(const char*)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="setPalette(QPalette,const char*)">
+        <access modifier="private"/>
+        <modify-argument index="2">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="overrideCursor()">
+        <access modifier="private"/>
+        <rename to="overrideCursor_private"/>
+    </modify-function>
+
+    <modify-function signature="setInputContext(QInputContext*)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setActiveWindow(QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setStyle(QStyle*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+
+  <object-type name="QCommandLinkButton" />
+  <object-type name="QFileSystemModel">
+    <modify-function signature="setIconProvider(QFileIconProvider*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcIconProvider"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+  <object-type name="QFormLayout">
+    <modify-function signature="addRow(QWidget*,QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore" />
+        </modify-argument>
+        <modify-argument index="2">
+            <reference-count action="ignore" />
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="addRow(QLayout*)">
+        <modify-argument index="1">
+            <reference-count action="ignore" />
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="addRow(QWidget*,QLayout*)">
+        <modify-argument index="1">
+            <reference-count action="ignore" />
+        </modify-argument>
+        <modify-argument index="2">
+            <reference-count action="ignore" />
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="addRow(QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore" />
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="addRow(QString,QLayout*)">
+        <modify-argument index="2">
+            <reference-count action="ignore" />
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="addRow(QString,QWidget*)">
+        <modify-argument index="2">
+            <reference-count action="ignore" />
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertRow(int,QLayout*)">
+        <modify-argument index="2">
+            <reference-count action="ignore" />
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertRow(int,QWidget*,QLayout*)">
+        <modify-argument index="2">
+            <reference-count action="ignore" />
+        </modify-argument>
+        <modify-argument index="3">
+            <reference-count action="ignore" />
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertRow(int,QWidget*,QWidget*)">
+        <modify-argument index="2">
+            <reference-count action="ignore" />
+        </modify-argument>
+        <modify-argument index="3">
+            <reference-count action="ignore" />
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertRow(int,QWidget*)">
+        <modify-argument index="2">
+            <reference-count action="ignore" />
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertRow(int,QString,QLayout*)">
+        <modify-argument index="3">
+            <reference-count action="ignore" />
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertRow(int,QString,QWidget*)">
+        <modify-argument index="3">
+            <reference-count action="ignore" />
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setLayout(int,QFormLayout::ItemRole,QLayout*)">
+        <modify-argument index="3">
+            <reference-count action="ignore" />
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setWidget(int,QFormLayout::ItemRole,QWidget*)">
+        <modify-argument index="3">
+            <reference-count action="ignore" />
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setItem(int,QFormLayout::ItemRole,QLayoutItem*)" access="private" rename="setItem_private">
+        <modify-argument index="3">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="addItem(QLayoutItem*)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+  <object-type name="QGraphicsGridLayout" delete-in-main-thread="yes">
+    <modify-function signature="addItem(QGraphicsLayoutItem*,int,int,QFlags&lt;Qt::AlignmentFlag&gt;)">
+        <modify-argument index="1">
+            <reference-count action="add" variable-name="__rcItems" />
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="addItem(QGraphicsLayoutItem*,int,int,int,int,QFlags&lt;Qt::AlignmentFlag&gt;)">
+        <modify-argument index="1">
+            <reference-count action="add" variable-name="__rcItems" />
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setAlignment(QGraphicsLayoutItem*,QFlags&lt;Qt::AlignmentFlag&gt;)">
+        <modify-argument index="1">
+            <reference-count action="ignore" />
+        </modify-argument>
+    </modify-function>
+  </object-type>
+  <object-type name="QGraphicsLayout" delete-in-main-thread="yes">
+
+    <modify-function signature="widgetEvent(QEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="setParentLayoutItem(QGraphicsLayoutItem*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcParentLayoutItem" />
+        </modify-argument>
+    </modify-function>
+  </object-type>
+  <interface-type name="QGraphicsLayoutItem" delete-in-main-thread="yes">
+    <modify-function signature="setParentLayoutItem(QGraphicsLayoutItem*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcParentLayoutItem" />
+        </modify-argument>
+    </modify-function>
+  </interface-type>
+  <object-type name="QGraphicsLinearLayout" delete-in-main-thread="yes">
+    <modify-function signature="addItem(QGraphicsLayoutItem*)">
+        <modify-argument index="1">
+            <reference-count action="add" variable-name="__rcItems" />
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertItem(int,QGraphicsLayoutItem*)">
+        <modify-argument index="2">
+            <reference-count action="add" variable-name="__rcItems" />
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="removeItem(QGraphicsLayoutItem*)">
+        <modify-argument index="1">
+            <reference-count action="remove" variable-name="__rcItems" />
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setAlignment(QGraphicsLayoutItem*,QFlags&lt;Qt::AlignmentFlag&gt;)">
+        <modify-argument index="1">
+            <reference-count action="ignore" />
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setStretchFactor(QGraphicsLayoutItem*,int)">
+        <modify-argument index="1">
+            <reference-count action="ignore" />
+        </modify-argument>
+    </modify-function>
+  </object-type>
+  <object-type name="QGraphicsProxyWidget"/> <!-- a QObject so main-thread delete redundant -->
+  <object-type name="QGraphicsWidget">  <!-- a QObject so main-thread delete redundant -->
+    <!-- Duplicate function to QObject::children() to override accidental shadowing which is not present in Jambi -->
+    <modify-function signature="children()const" remove="all" />
+    <modify-function signature="setLayout(QGraphicsLayout*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcLayout" />
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="changeEvent(QEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="closeEvent(QCloseEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="grabKeyboardEvent(QEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="grabMouseEvent(QEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="hideEvent(QHideEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="moveEvent(QGraphicsSceneMoveEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="paintWindowFrame(QPainter*,const QStyleOptionGraphicsItem*,QWidget*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="resizeEvent(QGraphicsSceneResizeEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="showEvent(QShowEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="ungrabKeyboardEvent(QEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="ungrabMouseEvent(QEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="windowFrameEvent(QEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+
+    <modify-function signature="setStyle(QStyle*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcStyle" />
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setTabOrder(QGraphicsWidget*,QGraphicsWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore" />
+        </modify-argument>
+        <modify-argument index="2">
+            <reference-count action="ignore" />
+        </modify-argument>
+    </modify-function>
+  </object-type>
+  <object-type name="QPlainTextDocumentLayout" />
+  <object-type name="QPlainTextEdit">
+    <modify-function signature="setDocument(QTextDocument*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcDocument" />
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertFromMimeData(const QMimeData*)">
+        <modify-argument index="1">
+            <reference-count action="ignore" />
+        </modify-argument>
+    </modify-function>
+  </object-type>
+  <object-type name="QPrintPreviewDialog" />
+  <object-type name="QPrintPreviewWidget" />
+  <object-type name="QStyledItemDelegate">
+    <modify-function signature="setItemEditorFactory(QItemEditorFactory*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcItemEditorFactory" />
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setEditorData(QWidget*,QModelIndex)const">
+        <modify-argument index="1">
+            <reference-count action="ignore" />
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setModelData(QWidget*,QAbstractItemModel*,QModelIndex)const">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+
+  <interface-type name="QAccessibleFactoryInterface" java-name="QAbstractAccessibleFactory" />
+  <interface-type name="QIconEngineFactoryInterfaceV2" java-name="QAbstractIconEngineFactoryV2" />
+  <interface-type name="QImageIOHandlerFactoryInterface" java-name="QAbstractImageIOHandlerFactory" />
+  <interface-type name="QInputContextFactoryInterface" java-name="QAbstractInputContextFactory" />
+  <interface-type name="QStyleFactoryInterface" java-name="QAbstractStyleFactory" />
+  <interface-type name="QTextCodecFactoryInterface" java-name="QAbstractTextCodecFactory" />
+  <interface-type name="QPictureFormatInterface" java-name="QAbstractPictureFormat" />
+
+  <object-type name="QIconEnginePluginV2"/>
+  <object-type name="QAccessiblePlugin"/>
+  <object-type name="QImageIOPlugin" />
+  <object-type name="QInputContextPlugin" />
+  <object-type name="QPictureFormatPlugin" />
+  <object-type name="QStylePlugin" />
+  <object-type name="QTextCodecPlugin" />
+
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QPixmap::QPixmap', unmatched parameter type 'QPixmapData*'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type '*Private&amp;'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type '*Private\*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type '*Private const\*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QTextEngine\*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QFontEngine\*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QPixmap::Type'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QInputDialog::Type'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QTextFrameLayoutData\*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QAbstractUndoItem\*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type '*QImageTextKeyLang*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: non-public function '*' in interface '*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: visibility of function '*' modified in class '*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: hiding of function '*' in class '*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: unsupported default value 'QVector&lt;FormatRange&gt;()' of argument in function '*', class '*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: unsupported default value 'QVariantList()' of argument in function '*', class '*'"/>
+  <suppress-warning text="WARNING(CppImplGenerator) :: protected function '*' in final class '*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QTextLayout::QTextLayout', unmatched parameter type 'QTextEngine*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: unsupported default value of argument in function 'doAction', class 'QAccessibleInterface'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QFileDialog::QFileDialog', unmatched parameter type 'QFileDialogArgs const&amp;'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: unsupported default value '0., 0., 1000000000., 1000000000.' of argument in function 'update', class 'QAbstractTextDocumentLayout'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QWidget::windowSurface', unmatched return type 'QWindowSurface*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QWidget::setWindowSurface', unmatched parameter type 'QWindowSurface*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: enum 'QStyleOption::StyleOptionType' does not have a type entry or is not an enum"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: unhandled enum value: ~FlagMask in QMessageBox::StandardButton"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: unmatched enum ~FlagMask"/>
+  <suppress-warning text="WARNING(MetaInfoGenerator) :: class 'QGraphicsSceneEvent' inherits from polymorphic class 'QEvent', but has no polymorphic id set"/>
+  <suppress-warning text="WARNING(MetaInfoGenerator) :: class 'QInputEvent' inherits from polymorphic class 'QEvent', but has no polymorphic id set"/>
+  <suppress-warning text="WARNING(JavaGenerator) :: either add or remove specified for reference count variable '__rcMenus' in 'qt.gui.QMenu' but not both"/>
+  <suppress-warning text="WARNING(JavaGenerator) :: either add or remove specified for reference count variable '__rcMenus' in 'qt.gui.QMenuBar' but not both"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QBrush' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QTextFrame_iterator' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QRegion' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QPolygon' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QTextTableCell' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QTextLength' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QPalette' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QTextBlock_iterator' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QTextBlock' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QTextCursor' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QFont' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QMatrix' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QPen' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QColor' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QTransform' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QPainterPath_Element' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QPainterPath' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QItemSelection' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QKeySequence' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QLine' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QPolygonF' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QSizePolicy' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QTextFragment' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QFontMetrics' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QGradient' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QFontMetricsF' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QTextFormat' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QLineF' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QImage' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QNetworkCookie' has equals operators but no qHash() function" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QNetworkRequest' has equals operators but no qHash() function" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QPixmap::pixmapData', unmatched return type 'QPixmapData*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: object type 'QAccessible' extended by interface type 'QAbstractAccessibleFactory'. The resulting API will be less expressive than the original." />
+
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QTextOption_Tab' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Rejected enum has no alternative...: QPalette::NColorRoles" />
+
+</typesystem>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/typesystem_gui-java.java	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,1680 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+package generator;
+
+import qt.QNativePointer;
+import qt.QtBlockedSlot;
+import qt.core.QPoint;
+import qt.core.QPointF;
+import qt.gui.*;
+
+class QIconEngineV2___ extends QIconEngineV2 {
+    public QIconEngineV2 clone() {
+        return null;
+    }
+}// class
+
+class QTransform___ extends QTransform {
+
+    public final QTransform multiply(double d) {
+        operator_multiply_assign(d);
+        return this;
+    }
+
+    public final QTransform multiply(QTransform matrix) {
+        operator_multiply_assign(matrix);
+        return this;
+    }
+
+    public final QTransform add(double d) {
+        operator_add_assign(d);
+        return this;
+    }
+
+    public final QTransform divide(double d) {
+        operator_divide_assign(d);
+        return this;
+    }
+
+    public final QTransform subtract(double d) {
+        operator_subtract_assign(d);
+        return this;
+    }
+
+    /**
+     * Returns an inverted copy of this transformation.
+     *
+     * @return The inverse of the transformation.
+     * @throws IllegalArgumentException
+     *             If this transformation is not invertible.
+     */
+/*    public final QTransform inverted() {
+        QNativePointer ok = new QNativePointer(QNativePointer.Type.Boolean);
+        QTransform returned = inverted(ok);
+        if (!ok.booleanValue())
+            throw new IllegalArgumentException("Transformation is not invertible");
+        return returned;
+    }
+*/
+    /**
+     * Creates a transformation mapping one arbitrary quad into another.
+     *
+     * @return The transformation.
+     * @throws IllegalArgumentException
+     *             If this transformation is not possible.
+     */
+  /*  public static final QTransform quadToQuad(QPolygonF from, QPolygonF to) {
+        QTransform res = new QTransform();
+        QNativePointer resPointer = res.nativePointer();
+        if (quadToQuadPrivate(from, to, resPointer)) {
+            return res;
+        } else
+            throw new IllegalArgumentException("Transformation is not possible");
+    }
+*/
+    /**
+     * Creates a transformation that maps a quad to a unit square.
+     *
+     * @return The transformation.
+     * @throws IllegalArgumentException If this transformation is not possible.
+     */
+/*    public static final QTransform quadToSquare(QPolygonF quad) {
+        QTransform res = new QTransform();
+        QNativePointer resPointer = res.nativePointer();
+        if (quadToSquarePrivate(quad, resPointer)) {
+            return res;
+        } else
+            throw new IllegalArgumentException("Transformation is not possible");
+    }
+*/
+    /**
+     * Creates a transformation that maps a unit square to a the given quad.
+     *
+     * @return The transformation.
+     * @throws IllegalArgumentException
+     *             If this transformation is not possible.
+     */
+/*    public static final QTransform squareToQuad(QPolygonF quad) {
+        QTransform res = new QTransform();
+        QNativePointer resPointer = res.nativePointer();
+        if (squareToQuadPrivate(quad, resPointer)) {
+            return res;
+        } else
+            throw new IllegalArgumentException("Transformation is not possible");
+    }
+*/
+}// class
+
+class QBitmap___ extends QBitmap {
+/*
+    public QBitmap(String fileName, String format) {
+        this(fileName, format == null ? null : qt.QNativePointer.createCharPointer(format));
+    }
+
+    public QBitmap(String fileName) {
+        this(fileName, (String) null);
+    }
+
+    public static QBitmap fromData(qt.core.QSize size, byte bits[], QImage.Format monoFormat) {
+        return fromData(size, qt.internal.QtJambiInternal.byteArrayToNativePointer(bits), monoFormat);
+    }
+
+    public static QBitmap fromData(qt.core.QSize size, byte bits[]) {
+        return fromData(size, bits, QImage.Format.Format_MonoLSB);
+    }
+	*/
+}// class
+
+class QPolygon___ extends QPolygon {
+/*
+    private native void add_private(long nid, int x, int y);
+
+    @QtBlockedSlot
+    public final QPolygon add(int x, int y) {
+        add_private(nativeId(), x, y);
+        return this;
+    }
+
+    @QtBlockedSlot
+    public final QPolygon add(QPoint pt) {
+        add_private(nativeId(), pt.x(), pt.y());
+        return this;
+    }
+
+    @QtBlockedSlot
+    public final QPolygon add(QPolygon p) {
+        int size = p.size();
+        long nid = nativeId();
+        for (int i = 0; i < size; ++i) {
+            QPoint pt = p.at(i);
+            add_private(nid, pt.x(), pt.y());
+        }
+        return this;
+    }
+*/
+}// class
+
+class QPolygonF___ extends QPolygonF {
+  /*
+    private native void add_private(long nid, double x, double y);
+
+    @QtBlockedSlot
+    public final QPolygonF add(double x, double y) {
+        add_private(nativeId(), x, y);
+        return this;
+    }
+
+    @QtBlockedSlot
+    public final QPolygonF add(QPointF pt) {
+        add_private(nativeId(), pt.x(), pt.y());
+        return this;
+    }
+
+    @QtBlockedSlot
+    public final QPolygonF add(QPolygonF p) {
+        int size = p.size();
+        long nid = nativeId();
+        for (int i = 0; i < size; ++i) {
+            QPointF pt = p.at(i);
+            add_private(nid, pt.x(), pt.y());
+        }
+        return this;
+    }
+	*/
+}// class
+
+class QTreeWidgetItemIterator___ extends QTreeWidgetItemIterator {
+    @QtBlockedSlot
+    public final void next(int i) {
+        operator_add_assign(i);
+    }
+
+    @QtBlockedSlot
+    public final void previous(int i) {
+        operator_subtract_assign(i);
+    }
+
+    @QtBlockedSlot
+    public final void next() {
+        operator_increment();
+    }
+
+    @QtBlockedSlot
+    public final void previous() {
+        operator_decrement();
+    }
+
+    @QtBlockedSlot
+    public final QTreeWidgetItem current() {
+        return operator_multiply();
+    }
+}// class
+
+class QTextCursor___ extends QTextCursor {
+/*    public final QTableArea selectedTableCells() {
+        QNativePointer firstRow = new QNativePointer(QNativePointer.Type.Int);
+        QNativePointer numRows = new QNativePointer(QNativePointer.Type.Int);
+        QNativePointer firstColumn = new QNativePointer(QNativePointer.Type.Int);
+        QNativePointer numColumns = new QNativePointer(QNativePointer.Type.Int);
+
+        selectedTableCells(firstRow, numRows, firstColumn, numColumns);
+
+        return new QTableArea(firstRow.intValue(), firstColumn.intValue(), numRows.intValue(), numColumns.intValue());
+    }*/
+}// class
+
+class QComboBox___ extends QComboBox {
+
+}// class
+
+class QMatrix___ extends QMatrix {
+    /**
+     * Returns an inverted copy of this matrix.
+     *
+     * @return The inverse of the matrix.
+     * @throws IllegalArgumentException
+     *             If this matrix is not invertible.
+     */
+/*    public final QMatrix inverted() {
+        QNativePointer ok = new QNativePointer(QNativePointer.Type.Boolean);
+        QMatrix returned = inverted(ok);
+        if (!ok.booleanValue())
+            throw new IllegalArgumentException("Matrix is not invertible");
+        return returned;
+    }
+
+    @QtBlockedSlot
+    public final QMatrix multiply(QMatrix other) {
+        operator_multiply_assign(other);
+        return this;
+    }
+
+    @QtBlockedSlot
+    public final QMatrix multiplied(QMatrix other) {
+        return operator_multiply(other);
+    }
+*/
+}// class
+
+class QImage___ extends QImage {
+    private import qt.qtd.Str;
+
+    public this(in string[] xpm) {
+        this(toStringzArray(xpm));
+    }
+/*
+    public final byte[] copyOfBytes() {
+        QNativePointer bits = bits();
+        byte bytes[] = new byte[numBytes()];
+        for (int i = 0; i < bytes.length; ++i)
+            bytes[i] = bits.byteAt(i);
+        return bytes;
+    }
+*/
+    public this(ubyte[] data, int width, int height, Format format) {
+        this(data.ptr, width, height, format);
+    }
+
+    public this(string fileName, string format = null) {
+        this(fileName, format == null ? null : toStringz(format));
+    }
+}// class
+
+class QPen___ extends QPen {
+  /*
+    public QPen(QColor color, double width, qt.core.Qt.PenStyle s, qt.core.Qt.PenCapStyle c, qt.core.Qt.PenJoinStyle j) {
+        this(new QBrush(color), width, s, c, j);
+    }
+
+    public QPen(QColor color, double width, qt.core.Qt.PenStyle s, qt.core.Qt.PenCapStyle c) {
+        this(new QBrush(color), width, s, c);
+    }
+
+    public QPen(QColor color, double width, qt.core.Qt.PenStyle s) {
+        this(new QBrush(color), width, s);
+    }
+
+    public QPen(QColor color, double width) {
+        this(new QBrush(color), width);
+    }
+
+    public static final QPen NoPen = new QPen(qt.core.Qt.PenStyle.NoPen);
+	*/
+}// class
+
+class QColor___ extends QColor {
+	static this() {
+		White = new QColor(Qt.GlobalColor.white);
+		Black = new QColor(Qt.GlobalColor.black);
+		Red = new QColor(Qt.GlobalColor.red);
+		DarkRed = new QColor(Qt.GlobalColor.darkRed);
+		Green = new QColor(Qt.GlobalColor.green);
+		DarkGreen = new QColor(Qt.GlobalColor.darkGreen);
+		Blue = new QColor(Qt.GlobalColor.blue);
+		DarkBlue = new QColor(Qt.GlobalColor.darkBlue);
+		Cyan = new QColor(Qt.GlobalColor.cyan);
+		DarkCyan = new QColor(Qt.GlobalColor.darkCyan);
+		Magenta = new QColor(Qt.GlobalColor.magenta);
+		DarkMagenta = new QColor(Qt.GlobalColor.darkMagenta);
+		Yellow = new QColor(Qt.GlobalColor.yellow);
+		DarkYellow = new QColor(Qt.GlobalColor.darkYellow);
+		Gray = new QColor(Qt.GlobalColor.gray);
+		DarkGray = new QColor(Qt.GlobalColor.darkGray);
+		LightGray = new QColor(Qt.GlobalColor.lightGray);
+		Transparent = new QColor(Qt.GlobalColor.transparent);
+		Color0 = new QColor(Qt.GlobalColor.color0);
+		Color1 = new QColor(Qt.GlobalColor.color1);    
+	}
+	
+    public static const QColor White;
+    public static const QColor Black;
+    public static const QColor Red;
+    public static const QColor DarkRed;
+    public static const QColor Green;
+    public static const QColor DarkGreen;
+    public static const QColor Blue;
+    public static const QColor DarkBlue;
+    public static const QColor Cyan;
+    public static const QColor DarkCyan;
+    public static const QColor Magenta;
+    public static const QColor DarkMagenta;
+    public static const QColor Yellow;
+    public static const QColor DarkYellow;
+    public static const QColor Gray;
+    public static const QColor DarkGray;
+    public static const QColor LightGray;
+    public static const QColor Transparent;
+    public static const QColor Color0;
+    public static const QColor Color1;
+
+}// class
+
+class QTextLine___ extends QTextLine {
+
+    public final void draw(QPainter painter, QPointF position) {
+        draw(painter, position, null);
+    }
+
+}// class
+
+class QKeySequence___ extends QKeySequence {
+/*
+    @QtBlockedSlot
+    public final int toInt() {
+        return operator_cast_int();
+    }
+
+    @QtBlockedSlot
+    public final int at(int i) {
+        return operator_subscript(i);
+    }
+*/
+}// class
+
+class QPicture___ extends QPicture {
+/*
+    public final boolean load(QIODevice dev) {
+        return load(dev, (QNativePointer) null);
+    }
+
+    public final boolean load(String fileName) {
+        return load(fileName, (qt.QNativePointer) null);
+    }
+
+    public final boolean save(QIODevice dev) {
+        return save(dev, (qt.QNativePointer) null);
+    }
+
+    public final boolean save(String fileName) {
+        return save(fileName, (qt.QNativePointer) null);
+    }
+
+    public final byte[] data() {
+        QNativePointer npData = data_private();
+        if (npData == null)
+            return null;
+        byte returned[] = new byte[size()];
+        for (int i = 0; i < returned.length; ++i)
+            returned[i] = npData.byteAt(i);
+        return returned;
+    }
+*/
+}// class
+
+class QRegion___ extends QRegion {
+/*
+    public void setRects(qt.core.QRect[] rects) {
+        setRects(qt.core.QRect.nativePointerArray(rects), rects.length);
+    }
+*/
+}// class
+
+class QPolygon___ extends QPolygon {
+
+}// class
+
+class QPolygonF___ extends QPolygonF {
+
+}// class
+
+class QTextFrame_iterator___ extends QTextFrame_iterator {
+
+    public final void opPostInc() {
+        operator_increment();
+    }
+
+    public final void opPostDec() {
+        operator_decrement();
+    }
+
+}// class
+
+class QTextBlock_iterator___ extends QTextBlock_iterator {
+
+    public final void opPostInc() {
+        operator_increment();
+    }
+
+    public final void opPostDec() {
+        operator_decrement();
+    }
+
+}// class
+
+class QPixmap___ extends QPixmap {
+
+	private import qt.qtd.Str;
+
+        public this(in string[] xpm) {
+		this(toStringzArray(xpm));
+	}
+	
+    public this(string fileName, string format = null, int flags = Qt.ImageConversionFlag.AutoColor) {
+        this(fileName, toStringz(format), flags);
+    }
+	
+/*
+        public this(string fileName, string format = null, Qt.ImageConversionFlags flags = Qt.ImageConversionFlag.AutoColor) {
+        this(fileName, toStringz(format), flags);
+    }
+*/
+
+        public final bool load(string fileName, string format, int flags = Qt.ImageConversionFlag.AutoColor) {
+        return load(fileName, toStringz(format), flags);
+    }
+/*
+        public final bool load(string fileName, string format = null, Qt.ImageConversionFlags flags = Qt.ImageConversionFlag.AutoColor) {
+        return load(fileName, toStringz(format), flags);
+    }
+*/
+/*
+    public final bool loadFromData(ubyte[] data, string format, int flags = Qt.ImageConversionFlag.AutoColor) {
+        return loadFromData(data.ptr, data.length, toStringz(format), flags);
+    }
+
+    public final bool loadFromData(ubyte[] data, string format = null, Qt.ImageConversionFlags flags = Qt.ImageConversionFlag.AutoColor) {
+        return loadFromData(qdata.ptr, data.length, toStringz(format), flags);
+    }
+*/
+
+    public final bool loadFromData(QByteArray data, string format, int flags = Qt.ImageConversionFlag.AutoColor) {
+        return loadFromData(data, toStringz(format), flags);
+    }
+    
+/*	public final bool loadFromData(QByteArray data, string format = null, Qt.ImageConversionFlags flags = Qt.ImageConversionFlag.AutoColor) {
+        return loadFromData(data, toStringz(format), flags);
+    }
+*/
+
+    public final bool save(string fileName, string format, int quality = -1) {
+        return private_save(fileName, toStringz(format), quality);
+    }
+
+    public final bool save(QIODevice dev, string format, int quality = -1) {
+        return private_save(dev, toStringz(format), quality);
+    }
+}// class
+
+class QItemSelection___ extends QItemSelection {
+
+    public static void split(QItemSelectionRange range, QItemSelectionRange other, QItemSelection result) {
+        qt.QNativePointer np = result.nativePointer();
+        split(range, other, np);
+    }
+
+}// class
+
+class QPainterPath_Element___ extends QPainterPath_Element {
+/*
+    @QtBlockedSlot
+    public final qt.core.QPointF toPoint() {
+        return operator_cast_QPointF();
+    }
+*/
+}// class
+
+class QBrush___ extends QBrush {
+/*
+    public static final QBrush NoBrush = new QBrush(qt.core.Qt.BrushStyle.NoBrush);
+*/
+}// class
+
+class QAbstractItemView___ extends QAbstractItemView {
+
+    private QAbstractItemDelegate[int] __rcDelegatesForColumns;
+    private QAbstractItemDelegate[int] __rcDelegatesForRows;
+
+}// class
+
+class QAccessibleTableInterface___ extends QAccessibleTableInterface {
+
+    public static class CellAtIndex extends QTableArea {
+        public CellAtIndex(int row, int column, int rowSpan, int columnSpan, boolean isSelected) {
+            super(row, column, rowSpan, columnSpan);
+            this.isSelected = isSelected;
+        }
+
+        public boolean isSelected;
+    }
+
+}// class
+
+class QAccessibleInterface___ extends QAccessibleInterface {
+
+    public static class Target {
+        public Target(int childIndex, QAccessibleInterface target) {
+            this.childIndex = childIndex;
+            this.target = target;
+        }
+
+        public QAccessibleInterface target;
+        public int childIndex;
+    }
+
+}// class
+
+class QDesktopServices___ extends QDesktopServices {
+
+    private static java.util.Hashtable<String, InternalUrlHandler> __rcUrlHandlers = new java.util.Hashtable<String, InternalUrlHandler>();
+
+    public static interface UrlHandler {
+        public void handleUrl(qt.core.QUrl url);
+    }
+
+    private static class InternalUrlHandler extends qt.core.QObject {
+
+        private UrlHandler urlHandler;
+
+        private InternalUrlHandler(UrlHandler urlHandler) {
+            this.urlHandler = urlHandler;
+        }
+
+        private void handleUrl(qt.core.QUrl url) {
+            urlHandler.handleUrl(url);
+        }
+
+    }
+
+    public static void setUrlHandler(String scheme, UrlHandler urlHandler) {
+        InternalUrlHandler receiver = urlHandler != null ? new InternalUrlHandler(urlHandler) : null;
+
+        if (receiver == null)
+            __rcUrlHandlers.remove(scheme);
+        else
+            __rcUrlHandlers.put(scheme, receiver);
+        setUrlHandler(scheme, receiver, QNativePointer.createCharPointer("handleUrl"));
+    }
+
+}// class
+
+class QWizardPage___ extends QWizardPage {
+
+    protected final void registerField(String name, QWidget widget) {
+        registerField(name, widget, (qt.QNativePointer) null, (qt.QNativePointer) null);
+    }
+
+    protected final void registerField(String name, QWidget widget, String property) {
+        registerField(name, widget, QNativePointer.createCharPointer(property), null);
+    }
+
+    /**
+     * Creates a field called <code>name</code> associated with the given
+     * property of the given widget. From then on, that property becomes
+     * accessible using <code>field()</code> and <code>setField()</code>.
+     * Fields are global to the entire wizard and make it easy for any single
+     * page to access information stored by another page, without having to put
+     * all the logic in <code>QWizard</code> or having the pages know
+     * explicitly about each other. If name ends with an asterisk (*), the field
+     * is a mandatory field. When a page has mandatory fields, the Next and/or
+     * Finish buttons are enabled only when all mandatory fields are filled.
+     * This requires a <code>changedSignal</code> to be specified, to tell
+     * QWizard to recheck the value stored by the mandatory field.
+     *
+     * QWizard knows the most common Qt widgets. For these (or their
+     * subclasses), you don't need to specify a <code>property</code> or a
+     * <code>changedSignal</code>. The table below lists these widgets:
+     *
+     * <code>QAbstractButton</code> (for which the relevant property is the
+     * <code>checked</code> property), <code>QAbstractSlider</code> (the
+     * <code>value</code> property), <code>QComboBox</code> (<code>currentIndex</code>
+     * property), <code>QDateTimeEdit</code>(<code>dateTime</code>
+     * property), <code>QLineEdit</code>(<code>text</code> property),
+     * <code>QListWidget</code>(<code>currentRow</code> property), or
+     * <code>QSpinBox</code>(<code>value</code> property).
+     *
+     * @param name
+     *            The name which will be used to access the field. Names ending
+     *            with an asterisk signify mandatory fields.
+     * @param widget
+     *            The widget whose property will be accessed using this field.
+     * @param property
+     *            The name of the property associated with the field.
+     * @param changedSignal
+     *            The name of a signal which is emitted when the associated
+     *            property's value changes.
+     *
+     * @see qt.gui.QWizardPage#field
+     * @see qt.gui.QWizardPage#setField
+     */
+    protected final void registerField(String name, QWidget widget, String property, String changedSignal) {
+        String signalSignature = qt.internal.MetaObjectTools.cppSignalSignature(widget, changedSignal);
+        if (signalSignature.length() == 0)
+            throw new QNoSuchSignalException("Signal '" + changedSignal
+                    + "' does not exist or has argument types that cannot be converted to Qt Jambi or java.lang types.");
+        registerField(name, widget, qt.QNativePointer.createCharPointer(property), qt.QNativePointer
+                .createCharPointer(qt.internal.QtJambiInternal.SignalPrefix + signalSignature));
+    }
+
+}// class
+
+class QFontDialog___ extends QFontDialog {
+
+    public static final class Result {
+        public Result(QFont font, boolean ok) {
+            this.font = font;
+            this.ok = ok;
+        }
+
+        public QFont font;
+        public boolean ok;
+    }
+
+}// class
+
+class QMenu___ extends QMenu {
+/*
+    protected final void initStyleOption(qt.gui.QStyleOptionMenuItem option, QAction action) {
+        initStyleOption(option.nativePointer(), action);
+    }
+*/
+    alias QWidget.addAction addAction;
+}// class
+
+class QMenuBar___ extends QMenuBar {
+
+
+}// class
+
+class QToolBar___ extends QToolBar {
+	/*
+	protected final void initStyleOption(qt.gui.QStyleOptionMenuItem option, QAction action) {
+   initStyleOption(option.nativePointer(), action);
+}
+*/
+	alias QWidget.addAction addAction;
+}// class
+
+class QPixmapCache___ extends QPixmapCache {
+
+    public static boolean find(String key, QPixmap pm) {
+        return find(key, pm.nativePointer());
+    }
+
+}// class
+
+class QShortcut___ extends QShortcut {
+
+    public QShortcut(QKeySequence key, QWidget parent) {
+        this(key, parent, null, null, qt.core.Qt.ShortcutContext.WindowShortcut);
+    }
+
+    public QShortcut(QKeySequence key, QWidget parent, qt.core.Qt.ShortcutContext context) {
+        this(key, parent, null, null, context);
+    }
+
+}// class
+
+class QValidator___ extends QValidator {
+
+    public static class QValidationData {
+        public QValidationData(String input, int pos) {
+            string = input;
+            position = pos;
+        }
+
+        public String string;
+        public int position;
+    }
+
+}// class
+
+class QAbstractButton___ extends QAbstractButton {
+
+    /**
+     * Sets the shortcut to the key sequence for the given key string. For
+     * example "Ctrl+O" gives CTRL+'O'. The strings "Ctrl", "Shift", "Alt" and
+     * "Meta" are recognized, as well as their translated equivalents in the
+     * "QShortcut" context (using QObject::tr()). Up to four key codes may be
+     * entered by separating them with commas, e.g. "Alt+X,Ctrl+S,Q".
+     *
+     * @param key
+     *            The description of the key sequence. Typically used with tr()
+     *            so key sequences can be locale aware.
+     */
+    public final void setShortcut(string key) {
+        setShortcut(new QKeySequence(key));
+    }
+
+    /**
+     * Sets the shortcut to the key sequence for the given key. The result will
+     * depend on the currently running platform. The key sequence will be based
+     * on the first element in the list of key bindings for the key.
+     *
+     * @param key
+     *            The key for which to select a key sequence
+     */
+    public final void setShortcut(QKeySequence.StandardKey key) {
+        setShortcut(new QKeySequence(key));
+    }
+
+}// class
+
+class QStyle___ extends QStyle {
+/*
+    @QtBlockedSlot
+    public final int combinedLayoutSpacing(QSizePolicy.ControlTypes controls1, QSizePolicy.ControlTypes controls2,
+            qt.core.Qt.Orientation orientation, QStyleOption option, QWidget widget) {
+        return combinedLayoutSpacing(controls1, controls2, orientation, option == null ? null : option.nativePointer(), widget);
+    }
+
+    @QtBlockedSlot
+    public final int combinedLayoutSpacing(QSizePolicy.ControlTypes controls1, QSizePolicy.ControlTypes controls2,
+            qt.core.Qt.Orientation orientation, QStyleOption option) {
+        return combinedLayoutSpacing(controls1, controls2, orientation, option, null);
+    }
+
+    @QtBlockedSlot
+    public final int combinedLayoutSpacing(QSizePolicy.ControlTypes controls1, QSizePolicy.ControlTypes controls2,
+            qt.core.Qt.Orientation orientation) {
+        return combinedLayoutSpacing(controls1, controls2, orientation, null);
+    }
+
+    @QtBlockedSlot
+    public final int layoutSpacing(QSizePolicy.ControlType control1, QSizePolicy.ControlType control2, qt.core.Qt.Orientation orientation,
+            QStyleOption option, QWidget widget) {
+        return layoutSpacing(control1, control2, orientation, option == null ? null : option.nativePointer(), widget);
+    }
+
+    @QtBlockedSlot
+    public final int layoutSpacing(QSizePolicy.ControlType control1, QSizePolicy.ControlType control2, qt.core.Qt.Orientation orientation,
+            QStyleOption option) {
+        return layoutSpacing(control1, control2, orientation, option, null);
+    }
+
+    @QtBlockedSlot
+    public final int layoutSpacing(QSizePolicy.ControlType control1, QSizePolicy.ControlType control2, qt.core.Qt.Orientation orientation) {
+        return layoutSpacing(control1, control2, orientation, null);
+    }
+*/
+}// class
+
+class QLayout___ extends QLayout {
+/*
+    @QtBlockedSlot
+    public final QContentsMargins getContentsMargins() {
+        QNativePointer left = new QNativePointer(QNativePointer.Type.Int);
+        QNativePointer top = new QNativePointer(QNativePointer.Type.Int);
+        QNativePointer right = new QNativePointer(QNativePointer.Type.Int);
+        QNativePointer bottom = new QNativePointer(QNativePointer.Type.Int);
+
+        getContentsMargins(left, top, right, bottom);
+        return new QContentsMargins(left.intValue(), top.intValue(), right.intValue(), bottom.intValue());
+    }
+
+    @QtBlockedSlot
+    public final void setContentsMargins(QContentsMargins margins) {
+        setContentsMargins(margins.left, margins.top, margins.right, margins.bottom);
+    }
+*/
+}// class
+
+class QGridLayout___ extends QGridLayout {
+/*
+    public final QTableArea getItemPosition(int index) {
+        QNativePointer row = new QNativePointer(QNativePointer.Type.Int);
+        QNativePointer column = new QNativePointer(QNativePointer.Type.Int);
+        QNativePointer rowSpan = new QNativePointer(QNativePointer.Type.Int);
+        QNativePointer columnSpan = new QNativePointer(QNativePointer.Type.Int);
+
+        getItemPosition(index, row, column, rowSpan, columnSpan);
+
+        return new QTableArea(row.intValue(), column.intValue(), rowSpan.intValue(), columnSpan.intValue());
+    }
+*/
+}// class
+
+class QWidget___ extends QWidget {
+/*
+    private native static void __qt_QMessageBox_setWindowTitle(long native_id, String windowTitle);
+
+    private native static void __qt_QMessageBox_setWindowModality(long native_id, int modality);
+
+    @QtBlockedSlot
+    public final QContentsMargins getContentsMargins() {
+        QNativePointer left = new QNativePointer(QNativePointer.Type.Int);
+        QNativePointer top = new QNativePointer(QNativePointer.Type.Int);
+        QNativePointer right = new QNativePointer(QNativePointer.Type.Int);
+        QNativePointer bottom = new QNativePointer(QNativePointer.Type.Int);
+
+        getContentsMargins(left, top, right, bottom);
+        return new QContentsMargins(left.intValue(), top.intValue(), right.intValue(), bottom.intValue());
+    }
+
+    @QtBlockedSlot
+    public final void setContentsMargins(QContentsMargins margins) {
+        setContentsMargins(margins.left, margins.top, margins.right, margins.bottom);
+    }
+*/
+}// class
+
+class QFileDialog___ extends QFileDialog {
+    
+    public static string getOpenFileName(QWidget _parent, string caption = null, string dir = null, string filter = null) {
+        string res;
+        string _selectedFilter = "";
+        qtd_QFileDialog_getOpenFileName_QWidget_string_string_string_nativepointerstring_Options(&res, _parent is null ? null : _parent.nativeId, caption.ptr, caption.length, dir.ptr, dir.length, filter.ptr, filter.length, _selectedFilter.ptr, _selectedFilter.length, 0);
+        return res;
+    }
+    
+    public static string getSaveFileName(QWidget _parent, string caption = null, string dir = null, string filter = null) {
+        string res;
+        string _selectedFilter = "";
+        qtd_QFileDialog_getSaveFileName_QWidget_string_string_string_nativepointerstring_Options(&res, _parent is null ? null : _parent.nativeId, caption.ptr, caption.length, dir.ptr, dir.length, filter.ptr, filter.length, _selectedFilter.ptr, _selectedFilter.length, 0);
+        return res;
+    }
+    
+    public static class Filter {
+        public this(string filter) {
+            this.filter = filter;
+        }
+
+        public string filter;
+        public string selectedFilter = "";
+    }
+
+}// class
+
+class QTabBar___ extends QTabBar {
+
+    public final void initStyleOption(QStyleOptionTab option, int tabIndex) {
+        initStyleOption(option.nativePointer(), tabIndex);
+    }
+
+}// class
+
+class QClipboard___ extends QClipboard {
+/*
+    public static class Text {
+        public String text;
+        public String subtype;
+    }
+
+    public final Text text(String subtype, Mode mode) {
+        QNativePointer np = new QNativePointer(QNativePointer.Type.String);
+        np.setStringValue(subtype != null ? subtype : "");
+
+        Text returned = new Text();
+        returned.text = text(np, mode);
+        returned.subtype = np.stringValue();
+        return returned;
+    }
+
+    public final Text text(String subtype) {
+        return text(subtype, Mode.Clipboard);
+    }
+*/
+}// class
+
+class QAbstractScrollArea___ extends QAbstractScrollArea {
+/*
+    public QPaintEngine paintEngine() {
+        throw new RuntimeException("Cannot open a painter directly on a QAbstractScrollArea, open QPainter on its viewport instead...");
+    }
+*/
+}// class
+
+class QTextDocument___ extends QTextDocument {
+
+    public final void redo(QTextCursor cursor) {
+        redo(cursor.nativePointer());
+    }
+
+    public final void undo(QTextCursor cursor) {
+        undo(cursor.nativePointer());
+    }
+
+}// class
+
+class QSplitter___ extends QSplitter {
+
+    public struct Range {
+		public static Range opCall(int min, int max) {
+            Range rng;
+			rng.minimum = min;
+            rng.maximum = max;
+			return rng;
+        }
+
+        public int minimum;
+        public int maximum;
+    }
+
+    public final Range getRange(int index) {
+        int* min;
+        int* max;
+
+        getRange(index, min, max);
+
+        return Range(*min, *max);
+    }
+
+}// class
+
+class QAction___ extends QAction {
+	
+        public final void setShortcut(string key) {
+		setShortcut(new QKeySequence(key));
+	}
+/*
+    private QActionGroup __rcActionGroup = null;
+*/
+    /**
+     * Sets the shortcut to the key sequence for the given key string. For
+     * example "Ctrl+O" gives CTRL+'O'. The strings "Ctrl", "Shift", "Alt" and
+     * "Meta" are recognized, as well as their translated equivalents in the
+     * "QShortcut" context (using QObject::tr()). Up to four key codes may be
+     * entered by separating them with commas, e.g. "Alt+X,Ctrl+S,Q".
+     *
+     * @param key
+     *            The description of the key sequence. Typically used with tr()
+     *            so key sequences can be locale aware.
+     */
+/*    public final void setShortcut(String key) {
+        setShortcut(new QKeySequence(key));
+    }
+*/
+    /**
+     * Sets the shortcut to the key sequence for the given key. The result will
+     * depend on the currently running platform. The key sequence will be based
+     * on the first element in the list of key bindings for the key.
+     *
+     * @param key
+     *            The key for which to select a key sequence
+     */
+/*    public final void setShortcut(QKeySequence.StandardKey key) {
+        setShortcut(new QKeySequence(key));
+    }
+
+    public final void setIcon(QPixmap pm) {
+        setIcon(new QIcon(pm));
+    }
+*/
+}// class
+
+class QPainter___ extends QPainter {
+
+    public final void setBrush(QColor color) {
+        setBrush(new QBrush(color));
+    }
+
+    public final void setBrush(QGradient gradient) {
+        setBrush(new QBrush(gradient));
+    }
+
+    public final void setBrush(QPixmap pm) {
+        setBrush(new QBrush(pm));
+    }
+    
+    public final void drawConvexPolygon(QPoint[] points) {
+        qtd_QPainter_drawConvexPolygon_nativepointerQPoint_int(nativeId, points.ptr, points.length);
+    }
+    
+    public final void drawConvexPolygon(QPointF[] points) {
+        qtd_QPainter_drawConvexPolygon_nativepointerQPointF_int(nativeId, points.ptr, points.length);
+    }
+/*
+    public static QPaintDeviceInterface redirected(QPaintDeviceInterface device, qt.core.QPoint offset) {
+        return redirected(device, offset == null ? null : offset.nativePointer());
+    }
+
+    public QPainter(QWidget widget) {
+        this();
+        begin(widget);
+    }
+
+    public boolean begin(QWidget widget) { // can't be final because of QStylePainter
+        return qt.QtJambiGuiInternal.beginPaint(widget, this);
+    }
+
+    private static java.util.Stack<QPaintDeviceInterface> __rcRedirections = new java.util.Stack<QPaintDeviceInterface>();
+*/
+}// class
+
+class QApplication___ extends QApplication {
+
+        this(in string[] args)
+	{
+//        if (m_instance != null)
+//            throw new RuntimeException("QCoreApplication can only be initialized once");
+            
+		argc = args.length;
+		argv = toStringzArray(args);
+		this(&argc, argv);
+
+//        m_instance.aboutToQuit.connect(m_instance, "disposeOfMyself()");
+	}
+	
+	private int argc;
+	private char **argv;
+
+	/*    public static QApplication instance() {
+        if (type() != Type.Tty)
+            return (QApplication) qt.core.QCoreApplication.instance();
+        return null;
+    }
+
+    public QApplication(String args[]) {
+        this(argc(args), argv(args));
+    }
+
+    public static void setFont(QFont font) {
+        setFont(font, null);
+    }
+
+    public static void setPalette(QPalette palette) {
+        setPalette(palette, null);
+    }
+
+    public static QCursor overrideCursor() {
+        QNativePointer np = overrideCursor_private();
+        return np == null ? null : QCursor.fromNativePointer(np);
+    }
+*/
+}// class
+
+class QFormLayout___ extends QFormLayout {
+
+    /**
+     * Retrieves the row and role (column) of the item at the specified index.
+     * If index is out of bounds, -1 is returned in place of the row.
+     *
+     * @param index The index of the item for which to retrieve the position.
+     * @return A pair of an int (row of item) and an ItemRole (role of the item.)
+     **/
+/*    @QtBlockedSlot
+    public final qt.QPair<Integer, ItemRole> getItemPosition(int index) {
+       qt.QNativePointer row = new qt.QNativePointer(qt.QNativePointer.Type.Int);
+       qt.QNativePointer role = new qt.QNativePointer(qt.QNativePointer.Type.Int);
+
+       getItemPosition(index, row, role);
+
+       return new qt.QPair<Integer, ItemRole>(row.intValue(), ItemRole.resolve(role.intValue()));
+    }
+*/
+    /**
+     * Retrieves the row and role (column) of the specified child layout.
+     * If the layout is not in the form layout, -1 is returned in place of the row.
+     *
+     * @param layout The layout for which to retrieve the position.
+     * @return A pair of an int (row of item) and an ItemRole (role of the item.)
+     */
+/*    @QtBlockedSlot
+    public final qt.QPair<Integer, ItemRole> getLayoutPosition(QLayout layout) {
+        qt.QNativePointer row = new qt.QNativePointer(qt.QNativePointer.Type.Int);
+        qt.QNativePointer role = new qt.QNativePointer(qt.QNativePointer.Type.Int);
+
+        getLayoutPosition(layout, row, role);
+
+        return new qt.QPair<Integer, ItemRole>(row.intValue(), ItemRole.resolve(role.intValue()));
+    }
+*/
+    /**
+     * Retrieves the row and role (column) of the specified widget in the layout.
+     * If the widget is not in the form layout, -1 is returned in place of the row.
+     *
+     * @param widget The widget for which to retrieve the position.
+     * @return A pair of an int (row of item) and an ItemRole (role of the item.)
+     */
+/*    @QtBlockedSlot
+    public final qt.QPair<Integer, ItemRole> getWidgetPosition(QWidget widget) {
+        qt.QNativePointer row = new qt.QNativePointer(qt.QNativePointer.Type.Int);
+        qt.QNativePointer role = new qt.QNativePointer(qt.QNativePointer.Type.Int);
+
+        getWidgetPosition(widget, row, role);
+
+        return new qt.QPair<Integer, ItemRole>(row.intValue(), ItemRole.resolve(role.intValue()));
+    }
+*/
+    /**
+     * Sets the item in the given row for the given role to item, extending the layout with empty rows if necessary.
+     * If the cell is already occupied, the item is not inserted and a IllegalArgumentException is thrown.
+     */
+/*    @QtBlockedSlot
+    public final void setItem(int row, ItemRole role, QLayoutItem item) {
+        if (itemAt(row, role) == null)
+            setItem_private(row, role, item);
+        else
+            throw new IllegalArgumentException("Cell in form layout is already occupied");
+    }
+*/
+}// class
+
+class Subclass_of_QGraphicsLayoutItem___ extends QGraphicsLayoutItem {
+    /*
+    @QtBlockedSlot
+    public final QMarginsF getContentsMargins() {
+        QNativePointer left = new QNativePointer(QNativePointer.Type.Double);
+        QNativePointer top = new QNativePointer(QNativePointer.Type.Double);
+        QNativePointer right = new QNativePointer(QNativePointer.Type.Double);
+        QNativePointer bottom = new QNativePointer(QNativePointer.Type.Double);
+
+        getContentsMargins(left, top, right, bottom);
+        return new QMarginsF(left.doubleValue(), top.doubleValue(), right.doubleValue(), bottom.doubleValue());
+    }*/
+}// class
+
+class QGraphicsWidget___ extends QGraphicsWidget {
+
+    /*
+     * Gets the widget's window frame margins.
+     *
+     * @returns An object containing the margins in left, right, top and bottom coordinates.
+     
+    @QtBlockedSlot
+    public final QMarginsF getWindowFrameMargins() {
+        QNativePointer left = new QNativePointer(QNativePointer.Type.Double);
+        QNativePointer top = new QNativePointer(QNativePointer.Type.Double);
+        QNativePointer right = new QNativePointer(QNativePointer.Type.Double);
+        QNativePointer bottom = new QNativePointer(QNativePointer.Type.Double);
+
+        getWindowFrameMargins(left, top, right, bottom);
+        return new QMarginsF(left.doubleValue(), top.doubleValue(), right.doubleValue(), bottom.doubleValue());
+    }
+    */
+
+}// class
+
+class QPrinter___ extends QPrinter {
+
+    /**
+     * Returns the page margins for this printer.
+     * The unit of the returned margins are specified with the unit parameter.
+     * This function was introduced in Qt 4.4.
+     *
+     * @param unit Specifies the unit of the returned margins.
+     * @return The page margins for this printer.
+     */
+/*    public final QMarginsF getPageMargins(QPrinter.Unit unit) {
+        QNativePointer left = new QNativePointer(QNativePointer.Type.Double);
+        QNativePointer top = new QNativePointer(QNativePointer.Type.Double);
+        QNativePointer right = new QNativePointer(QNativePointer.Type.Double);
+        QNativePointer bottom = new QNativePointer(QNativePointer.Type.Double);
+
+        getPageMargins(left, top, right, bottom, unit);
+        return new QMarginsF(left.doubleValue(), top.doubleValue(), right.doubleValue(), bottom.doubleValue());
+    }*/
+
+}// class
+
+class QListWidget___ extends QListWidget {
+
+    /**
+     * Inserts items with the text labels at the end of the list widget.
+     *
+     * @param labels The collection of labels for the new items.
+     */
+    public final void addItems(string[] labels) {
+        foreach (label; labels)
+            addItem(label);
+    }
+
+    /**
+     * This is an overloaded member function, provided for convenience.
+     * Inserts an item with the text label in the list widget at the position given by row.
+     *
+     * @param row The position in which to insert the new item.
+     * @param label The text of the new item.
+     */
+    public final void insertItem(int row, string label) {
+        insertItem(row, new QListWidgetItem(label, this));
+    }
+
+    /**
+     * Inserts items from the list of labels into the list, starting at the given row.
+     *
+     * @param row The position in which to insert the new items.
+     * @param labels The collection of labels for the new items.
+     */
+    public final void insertItems(int row, string[] labels) {
+		foreach (label; labels)
+            insertItem(row++, label);
+    }
+}// class
+
+
+class QGraphicsScene___ extends QGraphicsScene {
+    /**
+     * Equivalent to addEllipse(rect, null, null)
+     */
+    /*public final QGraphicsEllipseItem addEllipse(qt.core.QRectF rect)
+    {
+        return addEllipse(rect, null);
+    }*/
+
+    /**
+     * Equivalent to addEllipse(rect, pen, null)
+     */
+   /* public final QGraphicsEllipseItem addEllipse(qt.core.QRectF rect, QPen pen)
+    {
+        return addEllipse(rect, pen, null);
+    }*/
+
+
+    /**
+     * Creates and adds an ellipse item to the scene, and returns the item
+     * reference. The geometry of the ellipse is defined by rect, and its pen
+     * and brush are initialized to pen and brush.
+     *
+     * Note that the item's geometry is provided in item coordinates, and its
+     * position is initialized to (0, 0).
+     *
+     * If the item is visible (i.e., QGraphicsItem::isVisible() returns true),
+     * QGraphicsScene will emit changed() once control goes back to the event
+     * loop.
+     *
+     * @param rect The bounding rectangle of the ellipse.
+     * @param pen The pen for the resulting QGraphicsEllipseItem.
+     * @param brush The brush for the resulting QGraphicsEllipseItem.
+     * @return The resulting item.
+     */
+   /* public final QGraphicsEllipseItem addEllipse(qt.core.QRectF rect, QPen pen, QBrush brush)
+    {
+        return addEllipse(rect.x(), rect.y(), rect.width(), rect.height(), pen, brush);
+    }*/
+
+    /**
+     * Equivalent to addEllipse(x, y, w, h, null, null)
+     */
+   /* public final QGraphicsEllipseItem addEllipse(double x, double y, double w, double h) {
+        return addEllipse(x, y, w, h, null);
+    }*/
+
+    /**
+     * Equivalent to addEllipse(x, y, w, h, pen, null)
+     */
+   /* public final QGraphicsEllipseItem addEllipse(double x, double y, double w, double h, QPen pen)
+    {
+        return addEllipse(x, y, w, h, pen, null);
+    }*/
+
+    /**
+     * Creates and adds an ellipse item to the scene, and returns the item
+     * reference. The geometry of the ellipse is defined by x, y, w, h, and its pen
+     * and brush are initialized to pen and brush.
+     *
+     * Note that the item's geometry is provided in item coordinates, and its
+     * position is initialized to (0, 0).
+     *
+     * If the item is visible (i.e., QGraphicsItem.isVisible() returns true),
+     * QGraphicsScene will emit changed once control goes back to the event
+     * loop.
+     *
+     * @param x The left horizontal coordinate of the ellipse's bounding rectangle.
+     * @param y The top vertical coordinate of the ellipse's bounding rectangle.
+     * @param w The width of the ellipse's bounding rectangle.
+     * @param h The height of the ellipse's bounding rectangle.
+     * @param pen The pen for the resulting QGraphicsEllipseItem.
+     * @param brush The brush for the resulting QGraphicsEllipseItem.
+     * @return The resulting item.
+     */
+   /* public final QGraphicsEllipseItem addEllipse(double x, double y, double w, double h, QPen pen, QBrush brush)
+    {
+        QGraphicsEllipseItem item = new QGraphicsEllipseItem(x, y, w, h);
+        item.setPen(pen);
+        item.setBrush(brush);
+
+        addItem(item);
+
+        return item;
+    }*/
+
+    /**
+     * Equivalent to addLine(line, null)
+     */
+   /* public final QGraphicsLineItem addLine(QLineF line) {
+        return addLine(line, null);
+    }*/
+
+    /**
+     * Creates and adds a line item to the scene, and returns the item
+     * reference. The geometry of the line is defined by line, and its pen
+     * is initialized to pen.
+     *
+     * Note that the item's geometry is provided in item coordinates, and its
+     * position is initialized to (0, 0).
+     *
+     * If the item is visible (i.e., QGraphicsItem.isVisible() returns true),
+     * QGraphicsScene will emit changed once control goes back to the event
+     * loop.
+     *
+     * @param line The definition of the line.
+     * @param pen The pen with which to draw the line.
+     * @return The resulting item.
+     */
+   /* public final QGraphicsLineItem addLine(QLineF line, QPen pen)
+    {
+        return addLine(line.x1(), line.y1(), line.x2(), line.y2(), pen);
+    }*/
+
+    /**
+     * Equivalent to addLine(x1, y1, x2, y2, null)
+     */
+  /*  public final QGraphicsLineItem addLine(double x1, double y1, double x2, double y2) {
+        return addLine(x1, y1, x2, y2, null);
+    }*/
+
+    /**
+     * Creates and adds a line item to the scene, and returns the item
+     * reference. The geometry of the line is defined by x1, y1, x2, y2, and its pen
+     * is initialized to pen.
+     *
+     * Note that the item's geometry is provided in item coordinates, and its
+     * position is initialized to (0, 0).
+     *
+     * If the item is visible (i.e., QGraphicsItem.isVisible() returns true),
+     * QGraphicsScene will emit changed once control goes back to the event
+     * loop.
+     *
+     * @param x1 The first horizontal coordinate of the line.
+     * @param y1 The first vertical coordinate of the line.
+     * @param x2 The second horizontal coordinate of the line.
+     * @param y2 The second vertical coordinate of the line.
+     * @param pen The pen with which to draw the line.
+     * @return The resulting item.
+     */
+  /*  public final QGraphicsLineItem addLine(double x1, double y1, double x2, double y2, QPen pen)
+    {
+        QGraphicsLineItem item = new QGraphicsLineItem(x1, y1, x2, y2);
+        item.setPen(pen);
+
+        addItem(item);
+
+        return item;
+    }*/
+
+
+    /**
+     * Equivalent to addPath(path, null, null)
+     */
+    /*public final QGraphicsPathItem addPath(QPainterPath path) {
+        return addPath(path, null);
+    }*/
+
+    /**
+     * Equivalent to addPath(path, pen, null)
+     */
+    /*public final QGraphicsPathItem addPath(QPainterPath path, QPen pen)
+    {
+        return addPath(path, pen, null);
+    }*/
+    /**
+     * Creates and adds a path item to the scene, and returns the item
+     * reference. The geometry of the path is defined by path, and its pen and
+     * brush are initialized to pen and brush.
+     *
+     * Note that the item's geometry is provided in item coordinates, and its
+     * position is initialized to (0, 0).
+     *
+     * If the item is visible (i.e., QGraphicsItem.isVisible() returns true),
+     * QGraphicsScene will emit changed once control goes back to the event
+     * loop.
+     *
+     * @param path The definition of the path.
+     * @param pen The pen for drawing the path.
+     * @param brush The brush for drawing the path.
+     * @return The resulting item.
+     */
+   /* public final QGraphicsPathItem addPath(QPainterPath path, QPen pen, QBrush brush)
+    {
+        QGraphicsPathItem item = new QGraphicsPathItem(path);
+        item.setPen(pen);
+        item.setBrush(brush);
+
+        addItem(item);
+
+        return item;
+    }*/
+
+    /**
+     * Creates and adds a pixmap item to the scene, and returns the item
+     * reference. The pixmap is defined by pixmap.
+     *
+     * Note that the item's geometry is provided in item coordinates, and its
+     * position is initialized to (0, 0).
+     *
+     * If the item is visible (i.e., QGraphicsItem.isVisible() returns true),
+     * QGraphicsScene will emit changed once control goes back to the event
+     * loop.
+     *
+     * @param pixmap The pixmap for which to create a graphics item.
+     * @return The resulting item.
+     */
+   /* public final QGraphicsPixmapItem addPixmap(QPixmap pixmap)
+    {
+        QGraphicsPixmapItem item = new QGraphicsPixmapItem(pixmap);
+
+        addItem(item);
+
+        return item;
+    }*/
+
+    /**
+     * Equivalent to addPolygon(polygon, null, null)
+     */
+  /*  public final QGraphicsPolygonItem addPolygon(QPolygonF polygon) {
+        return addPolygon(polygon, null);
+    }*/
+
+    /**
+     * Equivalent to addPolygon(polygon, pen, null)
+     */
+   /* public final QGraphicsPolygonItem addPolygon(QPolygonF polygon, QPen pen) {
+        return addPolygon(polygon, pen, null);
+    }*/
+
+    /**
+     * Creates and adds a polygon item to the scene, and returns the item
+     * reference. The polygon is defined by polygon, and its pen and
+     * brush are initialized to pen and brush.
+     *
+     * Note that the item's geometry is provided in item coordinates, and its
+     * position is initialized to (0, 0).
+     *
+     * If the item is visible (i.e., QGraphicsItem.isVisible() returns true),
+     * QGraphicsScene will emit changed once control goes back to the event
+     * loop.
+     *
+     * @param polygon The definition of the polygon.
+     * @param pen The pen with which to draw the polygon.
+     * @param brush The brush with which to draw the polygon.
+     * @return The resulting item.
+     */
+  /*  public final QGraphicsPolygonItem addPolygon(QPolygonF polygon, QPen pen, QBrush brush)
+    {
+        QGraphicsPolygonItem item = new QGraphicsPolygonItem(polygon);
+        item.setPen(pen);
+        item.setBrush(brush);
+
+        addItem(item);
+
+        return item;
+    }*/
+
+    /**
+     * Equivalent to addRect(rect, null, null)
+     */
+  /*  public final QGraphicsRectItem addRect(qt.core.QRectF rect) {
+        return addRect(rect, null);
+    }*/
+
+    /**
+     * Equivalent to addRect(rect, pen, null)
+     */
+   /* public final QGraphicsRectItem addRect(qt.core.QRectF rect, QPen pen)
+    {
+        return addRect(rect, pen, null);
+    }*/
+
+    /**
+     * Creates and adds a rectangle item to the scene, and returns the item
+     * reference. The geometry of the rectangle is defined by rect, and its pen
+     * and brush are initialized to pen and brush.
+     *
+     * Note that the item's geometry is provided in item coordinates, and its
+     * position is initialized to (0, 0). For example, if a QRect(50, 50, 100,
+     * 100) is added, its top-left corner will be at (50, 50) relative to the
+     * origin in the item's coordinate system.
+     *
+     * If the item is visible (i.e., QGraphicsItem.isVisible() returns true),
+     * QGraphicsScene will emit changed once control goes back to the event
+     * loop.
+     *
+     * @param rect The definition of the rectangle.
+     * @param pen The pen with which to draw the rectangle.
+     * @param brush The brush with which to draw the rectangle.
+     * @return The resulting item.
+     */
+  /*  public final QGraphicsRectItem addRect(qt.core.QRectF rect, QPen pen, QBrush brush)
+    {
+        return addRect(rect.x(), rect.y(), rect.width(), rect.height(), pen, brush);
+    }*/
+
+    /**
+     * Equivalent to addRect(x, y, w, h, null, null)
+     */
+  /*  public final QGraphicsRectItem addRect(double x, double y, double w, double h) {
+        return addRect(x, y, w, h, null);
+    }*/
+
+    /**
+     * Equivalent to addRect(x, y, w, h, pen, null)
+     */
+   /* public final QGraphicsRectItem addRect(double x, double y, double w, double h, QPen pen) {
+        return addRect(x, y, w, h, pen, null);
+    }*/
+
+    /**
+     * Creates and adds a rectangle item to the scene, and returns the item
+     * reference. The geometry of the rectangle is defined by x, y, w, h, and its pen
+     * and brush are initialized to pen and brush.
+     *
+     * Note that the item's geometry is provided in item coordinates, and its
+     * position is initialized to (0, 0).
+     *
+     * If the item is visible (i.e., QGraphicsItem.isVisible() returns true),
+     * QGraphicsScene will emit changed once control goes back to the event
+     * loop.
+     *
+     * @param x The left horizontal coordinate of the rectangle.
+     * @param y The top vertical coordinate of the rectangle.
+     * @param w The width of the rectangle.
+     * @param h The height of the rectangle.
+     * @param pen The pen with which to draw the rectangle.
+     * @param brush The brush with which to draw the rectangle.
+     * @return The resulting item.
+     */
+   /* public final QGraphicsRectItem addRect(double x, double y, double w, double h, QPen pen, QBrush brush)
+    {
+        QGraphicsRectItem item = new QGraphicsRectItem(x, y, w, h);
+        item.setPen(pen);
+        item.setBrush(brush);
+
+        addItem(item);
+
+        return item;
+    }*/
+
+    /**
+     * Equivalent to addSimpleText(text, null)
+     */
+    /*public final QGraphicsSimpleTextItem addSimpleText(String text) {
+        return addSimpleText(text, null);
+    }*/
+
+    /**
+     * Creates and adds a QGraphicsSimpleTextItem to the scene, and returns the
+     * item reference. The text string is initialized to text, and its font is
+     * initialized to font.
+     *
+     * The item's position is initialized to (0, 0).
+     *
+     * If the item is visible (i.e., QGraphicsItem.isVisible() returns true),
+     * QGraphicsScene will emit changed once control goes back to the event
+     * loop.
+     *
+     * @param text The text to add to the scene.
+     * @param font The font to use for displaying the text.
+     * @return The resulting item.
+     */
+   /* public final QGraphicsSimpleTextItem addSimpleText(String text, QFont font)
+    {
+        QGraphicsSimpleTextItem item = new QGraphicsSimpleTextItem(text);
+        item.setFont(font);
+
+        addItem(item);
+
+        return item;
+    }*/
+
+    /**
+     * Equivalent to addText(text, null)
+     */
+   /* public final QGraphicsTextItem addText(String text) {
+        return addText(text, null);
+    }*/
+
+    /**
+     * Creates and adds a text item to the scene, and returns the item
+     * reference. The text string is initialized to text, and its font
+     * is initialized to font.
+     *
+     * The item's position is initialized to (0, 0).
+     *
+     * If the item is visible (i.e., QGraphicsItem.isVisible() returns true),
+     * QGraphicsScene will emit changed once control goes back to the event
+     * loop.
+     *
+     * @param text The text to add to the scene.
+     * @param font The font to use for displaying the text.
+     * @return The resulting item.
+     */
+   /* public final QGraphicsTextItem addText(String text, QFont font)
+    {
+        QGraphicsTextItem item = new QGraphicsTextItem(text);
+        item.setFont(font);
+
+        addItem(item);
+
+        return item;
+    }*/
+
+}// class
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/typesystem_gui-java.xml	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,3113 @@
+<?xml version="1.0"?>
+<typesystem package="qt.gui" default-superclass="QtDObject">
+    <inject-code>
+        qt.Utilities.loadQtLibrary("QtGui");
+    </inject-code>
+
+    <template name="gui.getter_returning_nativepointer">
+        public final %RETURN_TYPE %FUNCTION_NAME() {
+            QNativePointer np = %FUNCTION_NAME_private();
+            %RETURN_TYPE tmp = np == null ? null : %RETURN_TYPE.fromNativePointer(np);
+            return tmp == null ? null : new %RETURN_TYPE(tmp);
+        }
+
+    </template>
+
+    <template name="gui.init_style_option">
+        protected final void initStyleOption(%TYPE option) {
+            initStyleOption(option.nativePointer());
+        }
+    </template>
+
+    <template name="gui.convert_validationdata_to_java">
+        StaticCache *sc = StaticCache::instance();
+        sc-&gt;resolveValidationData();
+        jstring __qt_converted_input = qtjambi_from_qstring(__jni_env, %STRING);
+        jobject %out = __jni_env-&gt;NewObject(sc-&gt;ValidationData.class_ref, sc-&gt;ValidationData.constructor, __qt_converted_input, %POS);
+        jobject __java_validation_data = %out;
+    </template>
+
+    <template name="gui.cleanup_validationdata_from_java">
+        __jni_env-&gt;SetIntField(%1, sc-&gt;ValidationData.position, *__position_ptr);
+        __jni_env-&gt;SetObjectField(%1, sc-&gt;ValidationData.string, qtjambi_from_qstring(__jni_env, *__string_ptr));
+    </template>
+
+    <template name="gui.convert_validationdata_to_string">
+        StaticCache *sc = StaticCache::instance();
+        sc-&gt;resolveValidationData();
+        jstring __java_string = (jstring) __jni_env-&gt;GetObjectField(%in, sc-&gt;ValidationData.string);
+        QString %out = __java_string == 0 ? QString() : qtjambi_to_qstring(__jni_env, __java_string);
+        QString *__string_ptr = &amp;%out;
+    </template>
+
+    <template name="gui.convert_validationdata_to_pos">
+        int %out = __jni_env-&gt;GetIntField(%1, sc-&gt;ValidationData.position);
+        int *__position_ptr = &amp;%out;
+    </template>
+
+    <template name="gui.cleanup_validationdata_to_java">
+        jstring __java_string = (jstring) __jni_env-&gt;GetObjectField(__java_validation_data, sc-&gt;ValidationData.string);
+        %STRING = __java_string == 0 ? QString() : qtjambi_to_qstring(__jni_env, __java_string);
+        %POS = __jni_env-&gt;GetIntField(__java_validation_data, sc-&gt;ValidationData.position);
+    </template>
+
+    <template name="gui.convert_object_array_to_java">
+        jobjectArray %out = 0;
+
+        {
+            jclass __resolved_class = resolveClass(__jni_env, "%CLASSNAME_ARRAY", "%PACKAGE_ARRAY");
+            QTJAMBI_EXCEPTION_CHECK(__jni_env);
+            Q_ASSERT(__resolved_class != 0);
+
+            %out = %in == 0 ? 0 : __jni_env-&gt;NewObjectArray(%LENGTH, __resolved_class, 0);
+            QTJAMBI_EXCEPTION_CHECK(__jni_env);
+            if (%out != 0) {
+                for (int i=0; i&lt;%LENGTH; ++i) {
+                    __jni_env-&gt;SetObjectArrayElement(%out, i, qtjambi_from_object(__jni_env, %REFERENCE %in[i], "%CLASSNAME", "%PACKAGE", %LOOKUP true));
+                }
+            }
+       }
+    </template>
+
+    <template name="gui.convert_graphicsitem_array_to_java">
+        <insert-template name="gui.convert_object_array_to_java">
+            <replace from="%CLASSNAME_ARRAY" to="QGraphicsItemInterface"/>
+            <replace from="%PACKAGE_ARRAY" to="com/trolltech/qt/gui/"/>
+            <replace from="%CLASSNAME" to="QGraphicsItem$ConcreteWrapper"/>
+            <replace from="%PACKAGE" to="com/trolltech/qt/gui/"/>
+            <replace from="%LOOKUP" to=""/>
+            <replace from="%REFERENCE" to=""/>
+        </insert-template>
+    </template>
+
+    <template name="gui.convert_styleoptiongraphicsitem_array_to_java">
+        <insert-template name="gui.convert_object_array_to_java">
+            <replace from="%CLASSNAME_ARRAY" to="QStyleOptionGraphicsItem"/>
+            <replace from="%PACKAGE_ARRAY" to="com/trolltech/qt/gui/"/>
+            <replace from="%CLASSNAME" to="QStyleOptionGraphicsItem"/>
+            <replace from="%PACKAGE" to="com/trolltech/qt/gui/"/>
+            <replace from="%LOOKUP" to="&quot;Lcom_trolltech_qt_gui_QStyleOption_2&quot;,"/>
+            <replace from="%REFERENCE" to="&amp;"/>
+        </insert-template>
+    </template>
+
+    <template name="gui.convert_interface_array_from_java">
+        %CLASSNAME *%out = 0;
+        QVarLengthArray&lt;%CLASSNAME, 256&gt; __interfaceArray(__length);
+        if (%in != 0) {
+            for (int i=0; i&lt;__length; ++i) {
+                __interfaceArray[i] = (%CLASSNAME) %CONVERSION_FUNCTION(__jni_env, __jni_env-&gt;GetObjectArrayElement((jobjectArray) %in, i) %EXTRA);
+            }
+        }
+        %out = %in == 0 ? 0 : __interfaceArray.data();
+    </template>
+
+    <template name="gui.convert_object_array_from_java">
+        %CLASSNAME *%out = 0;
+        QVarLengthArray&lt;%CLASSNAME, 256&gt; __array(__length);
+        if (%in != 0) {
+            for (int i=0; i&lt;__length; ++i) {
+                __array[i] = *(%CLASSNAME *) %CONVERSION_FUNCTION(__jni_env, __jni_env-&gt;GetObjectArrayElement((jobjectArray) %in, i) %EXTRA);
+            }
+        }
+        %out = %in == 0 ? 0 : __array.data();
+    </template>
+
+    <template name="gui.convert_graphicsitem_array_from_java">
+        <insert-template name="gui.convert_interface_array_from_java">
+            <replace from="%CLASSNAME" to="QGraphicsItem *"/>
+            <replace from="%EXTRA" to=", &quot;QGraphicsItemInterface&quot;, &quot;com/trolltech/qt/gui/&quot;, &quot;__qt_cast_to_QGraphicsItem&quot;"/>
+            <replace from="%CONVERSION_FUNCTION" to="qtjambi_to_interface"/>
+        </insert-template>
+    </template>
+
+
+    <template name="gui.convert_styleoptiongraphicsitem_array_from_java">
+        <insert-template name="gui.convert_object_array_from_java">
+            <replace from="%CLASSNAME" to="QStyleOptionGraphicsItem"/>
+            <replace from="%EXTRA" to=""/>
+            <replace from="%CONVERSION_FUNCTION" to="qtjambi_to_object"/>
+        </insert-template>
+    </template>
+
+
+    <value-type name="QTransform">
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QTransform___" quote-before-line="}// class"/>
+        </inject-code>
+
+        <extra-includes>
+            <include file-name="qt.core.Qt.Axis" location="java"/>
+        </extra-includes>
+
+        <modify-function signature="inverted(bool*)const">
+            <access modifier="private"/>
+            <modify-argument index="1">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="rotate(double,Qt::Axis)">
+            <modify-argument index="1">
+                <remove-default-expression/>
+            </modify-argument>
+            <access modifier="private"/>
+            <rename to="rotate_private"/>
+        </modify-function>
+        <inject-code>
+    /**
+     * Rotates the transformation around the given axis.
+     *
+     * @return The rotated transformation.
+     */
+        <insert-template name="core.private_function_return_self">
+            <replace from="%RETURN_TYPE" to="QTransform"/>
+            <replace from="%FUNCTION_NAME" to="rotate"/>
+            <replace from="%ARGUMENTS" to="double angle, Axis axis"/>
+            <replace from="%ARGUMENT_NAMES" to="angle, axis"/>
+        </insert-template>
+
+    /**
+     * Rotates the transformation around the z-axis.
+     *
+     * @return The rotated transformation.
+     */
+        <insert-template name="core.private_function_return_self">
+            <replace from="%RETURN_TYPE" to="QTransform"/>
+            <replace from="%FUNCTION_NAME" to="rotate"/>
+            <replace from="%ARGUMENTS" to="double angle"/>
+            <replace from="%ARGUMENT_NAMES" to="angle"/>
+        </insert-template>
+        </inject-code>
+
+        <modify-function signature="rotateRadians(double,Qt::Axis)">
+        <modify-argument index="1">
+            <remove-default-expression/>
+        </modify-argument>
+        <access modifier="private"/>
+        <rename to="rotateRadians_private"/>
+    </modify-function>
+    <inject-code>
+    /**
+     * Rotates the transformation around the given axis.
+     *
+     * @return The rotated transformation.
+     */
+        <insert-template name="core.private_function_return_self">
+            <replace from="%RETURN_TYPE" to="QTransform"/>
+            <replace from="%FUNCTION_NAME" to="rotateRadians"/>
+            <replace from="%ARGUMENTS" to="double angle, Axis axis"/>
+            <replace from="%ARGUMENT_NAMES" to="angle, axis"/>
+        </insert-template>
+
+    /**
+     * Rotates the transformation around the z-axis.
+     *
+     * @return The rotated transformation.
+     */
+        <insert-template name="core.private_function_return_self">
+            <replace from="%RETURN_TYPE" to="QTransform"/>
+            <replace from="%FUNCTION_NAME" to="rotateRadians"/>
+            <replace from="%ARGUMENTS" to="double angle"/>
+            <replace from="%ARGUMENT_NAMES" to="angle"/>
+        </insert-template>
+    </inject-code>
+
+    <modify-function signature="scale(double,double)">
+        <access modifier="private"/>
+        <rename to="scale_private"/>
+    </modify-function>
+    <inject-code>
+    /**
+     * Scales the transformation using x and y.
+     *
+     * @return The scaled transformation.
+     */
+        <insert-template name="core.private_function_return_self">
+            <replace from="%RETURN_TYPE" to="QTransform"/>
+            <replace from="%FUNCTION_NAME" to="scale"/>
+            <replace from="%ARGUMENTS" to="double x, double y"/>
+            <replace from="%ARGUMENT_NAMES" to="x, y"/>
+        </insert-template>
+    </inject-code>
+
+    <modify-function signature="shear(double,double)">
+        <access modifier="private"/>
+        <rename to="shear_private"/>
+    </modify-function>
+    <inject-code>
+    /**
+      * Shears the transformation using x and y.
+      *
+      * @return The sheared transformation.
+      */
+        <insert-template name="core.private_function_return_self">
+            <replace from="%RETURN_TYPE" to="QTransform"/>
+            <replace from="%FUNCTION_NAME" to="shear"/>
+            <replace from="%ARGUMENTS" to="double x, double y"/>
+            <replace from="%ARGUMENT_NAMES" to="x, y"/>
+        </insert-template>
+    </inject-code>
+
+    <modify-function signature="translate(double,double)">
+        <access modifier="private"/>
+        <rename to="translate_private"/>
+    </modify-function>
+    <inject-code>
+    /**
+     * Translates the transformation using x and y.
+     *
+     * @return The translated transformation.
+     */
+        <insert-template name="core.private_function_return_self">
+            <replace from="%RETURN_TYPE" to="QTransform"/>
+            <replace from="%FUNCTION_NAME" to="translate"/>
+            <replace from="%ARGUMENTS" to="double x, double y"/>
+            <replace from="%ARGUMENT_NAMES" to="x, y"/>
+        </insert-template>
+    </inject-code>
+
+    <modify-function signature="quadToQuad(QPolygonF,QPolygonF,QTransform&amp;)">
+        <access modifier="private"/>
+        <rename to="quadToQuadPrivate"/>
+    </modify-function>
+
+    <modify-function signature="quadToSquare(QPolygonF,QTransform&amp;)">
+        <access modifier="private"/>
+        <rename to="quadToSquarePrivate"/>
+    </modify-function>
+
+    <modify-function signature="squareToQuad(QPolygonF,QTransform&amp;)">
+        <access modifier="private"/>
+        <rename to="squareToQuadPrivate"/>
+    </modify-function>
+
+    </value-type>
+
+    <value-type name="QBitmap">
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QBitmap___" quote-before-line="}// class"/>
+        </inject-code>
+    </value-type>
+
+
+
+    <value-type name="QTextLine">
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QTextLine___" quote-before-line="}// class"/>
+        </inject-code>
+        <modify-function signature="draw(QPainter*,QPointF,const QTextLayout::FormatRange*)const">
+            <access modifier="private"/>
+            <modify-argument index="3">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+
+    </value-type>
+
+
+
+    <value-type name="QKeySequence">
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QKeySequence___" quote-before-line="}// class"/>
+        </inject-code>
+
+    </value-type>
+
+
+
+    <value-type name="QPicture">
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QPicture___" quote-before-line="}// class"/>
+        </inject-code>
+        <extra-includes>
+            <include file-name="qt.core.QIODevice" location="java"/>
+        </extra-includes>
+        <modify-function signature="load(QIODevice*,const char*)">
+            <access modifier="private"/>
+            <modify-argument index="2">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+
+
+        <modify-function signature="load(QString,const char*)">
+            <access modifier="private"/>
+            <modify-argument index="2">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+
+
+        <modify-function signature="save(QIODevice*,const char*)">
+            <access modifier="private"/>
+            <modify-argument index="2">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+
+
+        <modify-function signature="save(QString,const char*)">
+            <access modifier="private"/>
+            <modify-argument index="2">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+
+
+        <modify-function signature="setData(const char*,uint)">
+            <modify-argument index="1">
+                <replace-type modified-type="byte[]"/>
+                <conversion-rule class="shell">
+                    jbyteArray %out = __jni_env-&gt;NewByteArray(%2);
+                    __jni_env-&gt;SetByteArrayRegion(%out, 0, %2, (jbyte *) %in);
+                </conversion-rule>
+                <conversion-rule class="native">
+                    char *%out = (char *) __jni_env-&gt;GetByteArrayElements((jbyteArray) %in, 0);
+                    char *__ptr = %out;
+                    Q_UNUSED(__ptr)
+                </conversion-rule>
+            </modify-argument>
+
+            <modify-argument index="2">
+                <remove-argument/>
+                <conversion-rule class="shell">
+                    // nothing
+                </conversion-rule>
+                <conversion-rule class="native">
+                    int %out = %1 == 0 ? 0 : __jni_env-&gt;GetArrayLength((jarray) %1);
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="pictureFormat(QString)">
+            <remove/>
+        </modify-function>
+
+        <modify-function signature="data()const">
+            <access modifier="private"/>
+            <rename to="data_private"/>
+        </modify-function>
+
+    </value-type>
+
+
+    <value-type name="QRegion">
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QRegion___" quote-before-line="}// class"/>
+        </inject-code>
+        <modify-function signature="setRects(const QRect*,int)">
+            <access modifier="private"/>
+        </modify-function>
+
+    </value-type>
+
+    <value-type name="QPolygon">
+        <extra-includes>
+            <include file-name="qt.core.QPoint" location="java"/>
+        </extra-includes>
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QPolygon___" quote-before-line="}// class"/>
+        </inject-code>
+
+        <inject-code class="native">
+      extern "C" JNIEXPORT void JNICALL QTJAMBI_FUNCTION_PREFIX(Java_com_trolltech_qt_gui_QPolygon_add_1private)
+      (JNIEnv *__jni_env, jobject, jlong nativeId, jint x, jint y)
+      {
+          Q_UNUSED(__jni_env);
+          QPolygon *polygon = (QPolygon *) qtjambi_from_jlong(nativeId);
+          if (!polygon)
+              return;
+          *polygon &lt;&lt; QPoint(x, y);
+      }
+        </inject-code>
+    </value-type>
+
+    <value-type name="QPolygonF">
+        <extra-includes>
+            <include file-name="qt.core.QPoint" location="java"/>
+        </extra-includes>
+
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QPolygonF___" quote-before-line="}// class"/>
+        </inject-code>
+<!--
+        <inject-code class="native">
+      extern "C" JNIEXPORT void JNICALL QTJAMBI_FUNCTION_PREFIX(Java_com_trolltech_qt_gui_QPolygonF_add_1private)
+      (JNIEnv *__jni_env, jobject, jlong nativeId, jdouble x, jdouble y)
+      {
+          Q_UNUSED(__jni_env);
+          QPolygonF *polygon = (QPolygonF *) qtjambi_from_jlong(nativeId);
+          if (!polygon)
+              return;
+          *polygon &lt;&lt; QPointF(x, y);
+      }
+        </inject-code>
+		-->
+    </value-type>
+
+
+    <value-type name="QTextFrame::iterator">
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QTextFrame_iterator___" quote-before-line="}// class"/>
+        </inject-code>
+
+    </value-type>
+
+    <value-type name="QTreeWidgetItemIterator">
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QTreeWidgetItemIterator___" quote-before-line="}// class"/>
+        </inject-code>
+
+    </value-type>
+
+
+    <value-type name="QTextBlock::iterator">
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QTextBlock_iterator___" quote-before-line="}// class"/>
+        </inject-code>
+
+    </value-type>
+
+
+    <value-type name="QPixmap">
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QPixmap___" quote-before-line="}// class"/>
+        </inject-code>
+        <modify-function signature="fill(const QColor &amp;)">
+            <modify-argument index="1">
+                <replace-default-expression with="QColor.white"/>
+            </modify-argument>
+        </modify-function>
+
+
+        <template name="gui.pixmap_load">
+            <insert-template name="gui.pixmap_loadconstructor">
+                <replace from="%RETURN_TYPE" to="final boolean"/>
+                <replace from="%FUNCTION_CALL" to="return %FUNCTION_NAME"/>
+            </insert-template>
+        </template>
+
+        <template name="gui.pixmap_constructor">
+            <insert-template name="gui.pixmap_loadconstructor">
+                <replace from="%RETURN_TYPE" to=""/>
+                <replace from="%FUNCTION_NAME" to="QPixmap"/>
+                <replace from="%FUNCTION_CALL" to="this"/>
+                <replace from="%INPUT_TYPE" to="String"/>
+                <replace from="%INPUT_NAME" to="fileName"/>
+                <replace from="%OUTPUT_NAME" to="fileName"/>
+            </insert-template>
+        </template>
+
+        <extra-includes>
+            <include file-name="QBitmap" location="global"/>
+            <include file-name="QMatrix" location="global"/>
+        </extra-includes>
+        <modify-function signature="save(QIODevice *, const char *, int) const">
+            <access modifier="private"/>
+            <rename to="private_save"/>
+            <modify-argument index="2">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="3">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+        <inject-code>
+            <insert-template name="gui.pixmap_save">
+                <replace from="%INPUT_TYPE" to="qt.core.QIODevice"/>
+                <replace from="%INPUT_NAME" to="dev"/>
+            </insert-template>
+        </inject-code>
+
+        <modify-function signature="save(const QString &amp;, const char *, int) const">
+            <access modifier="private"/>
+            <rename to="private_save"/>
+            <modify-argument index="2">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="3">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+        <inject-code>
+            <insert-template name="gui.pixmap_save">
+                <replace from="%INPUT_TYPE" to="String"/>
+                <replace from="%INPUT_NAME" to="fileName"/>
+            </insert-template>
+        </inject-code>
+
+        <modify-function signature="QPixmap(QString,const char*,QFlags&lt;Qt::ImageConversionFlag&gt;)">
+            <access modifier="private"/>
+            <modify-argument index="2">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="3">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+        <inject-code>
+            <insert-template name="gui.pixmap_constructor"/>
+        </inject-code>
+
+        <modify-function signature="load(QString,const char*,QFlags&lt;Qt::ImageConversionFlag&gt;)">
+            <access modifier="private"/>
+            <modify-argument index="2">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="3">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+        <inject-code>
+            <insert-template name="gui.pixmap_load">
+                <replace from="%FUNCTION_NAME" to="load"/>
+                <replace from="%INPUT_TYPE" to="String"/>
+                <replace from="%INPUT_NAME" to="fileName"/>
+                <replace from="%OUTPUT_NAME" to="fileName"/>
+            </insert-template>
+        </inject-code>
+
+        <modify-function signature="loadFromData(const unsigned char*,uint,const char*,QFlags&lt;Qt::ImageConversionFlag&gt;)">
+            <access modifier="private"/>
+            <modify-argument index="3">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="4">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+        <inject-code>
+            <insert-template name="gui.pixmap_load">
+                <replace from="%FUNCTION_NAME" to="loadFromData"/>
+                <replace from="%INPUT_TYPE" to="byte[]"/>
+                <replace from="%INPUT_NAME" to="data"/>
+                <replace from="%OUTPUT_NAME" to="qt.internal.QtJambiInternal.byteArrayToNativePointer(data), data.length"/>
+            </insert-template>
+        </inject-code>
+
+        <modify-function signature="loadFromData(QByteArray,const char*,QFlags&lt;Qt::ImageConversionFlag&gt;)">
+            <access modifier="private"/>
+            <modify-argument index="2">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="3">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+        <inject-code>
+            <insert-template name="gui.pixmap_load">
+                <replace from="%FUNCTION_NAME" to="loadFromData"/>
+                <replace from="%INPUT_TYPE" to="qt.core.QByteArray"/>
+                <replace from="%INPUT_NAME" to="data"/>
+                <replace from="%OUTPUT_NAME" to="data"/>
+            </insert-template>
+        </inject-code>
+    </value-type>
+
+    <value-type name="QTextCursor">
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QTextCursor___" quote-before-line="}// class"/>
+        </inject-code>
+    </value-type>
+
+
+    <value-type name="QItemSelection">
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QItemSelection___" quote-before-line="}// class"/>
+        </inject-code>
+        <modify-function signature="split(QItemSelectionRange,QItemSelectionRange,QItemSelection*)">
+            <access modifier="private"/>
+        </modify-function>
+
+
+    </value-type>
+
+    <value-type name="QMatrix">
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QMatrix___" quote-before-line="}// class"/>
+        </inject-code>
+
+    </value-type>
+
+
+    <value-type name="QPainterPath::Element">
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QPainterPath_Element___" quote-before-line="}// class"/>
+        </inject-code>
+
+    </value-type>
+
+    <value-type name="QImage">
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QImage___" quote-before-line="}// class"/>
+        </inject-code>
+        <inject-code>
+            <insert-template name="gui.pixmap_save">
+                <replace from="%INPUT_TYPE" to="String"/>
+                <replace from="%INPUT_NAME" to="fileName"/>
+            </insert-template>
+        </inject-code>
+
+        <modify-function signature="save(QIODevice *, const char *, int) const">
+            <access modifier="private"/>
+            <rename to="private_save"/>
+            <modify-argument index="2">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="3">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+        <inject-code>
+            <insert-template name="gui.pixmap_save">
+                <replace from="%INPUT_TYPE" to="qt.core.QIODevice"/>
+                <replace from="%INPUT_NAME" to="dev"/>
+            </insert-template>
+        </inject-code>
+
+        <template name="gui.image_load">
+        public final boolean %FUNCTION_NAME(%ARGUMENT_TYPE %ARGUMENT_NAME, String format) {
+            return %FUNCTION_NAME(%OUT_ARGUMENT_NAME, format != null ? QNativePointer.createCharPointer(format) : null);
+        }
+
+        public final boolean %FUNCTION_NAME(%ARGUMENT_TYPE %ARGUMENT_NAME) {
+            return %FUNCTION_NAME(%ARGUMENT_NAME, (String) null);
+        }
+        </template>
+
+        <inject-code>
+            <insert-template name="gui.image_load">
+                <replace from="%FUNCTION_NAME" to="load"/>
+                <replace from="%ARGUMENT_TYPE" to="String"/>
+                <replace from="%ARGUMENT_NAME" to="fileName"/>
+                <replace from="%OUT_ARGUMENT_NAME" to="fileName"/>
+            </insert-template>
+        </inject-code>
+
+        <inject-code>
+            <insert-template name="gui.image_load">
+                <replace from="%FUNCTION_NAME" to="load"/>
+                <replace from="%ARGUMENT_TYPE" to="qt.core.QIODevice"/>
+                <replace from="%ARGUMENT_NAME" to="device"/>
+                <replace from="%OUT_ARGUMENT_NAME" to="device"/>
+            </insert-template>
+        </inject-code>
+
+        <inject-code>
+            <insert-template name="gui.image_load">
+                <replace from="%FUNCTION_NAME" to="loadFromData"/>
+                <replace from="%ARGUMENT_TYPE" to="byte[]"/>
+                <replace from="%ARGUMENT_NAME" to="data"/>
+                <replace from="%OUT_ARGUMENT_NAME" to="qt.internal.QtJambiInternal.byteArrayToNativePointer(data), data.length"/>
+            </insert-template>
+        </inject-code>
+
+        <inject-code>
+            <insert-template name="gui.image_load">
+                <replace from="%FUNCTION_NAME" to="loadFromData"/>
+                <replace from="%ARGUMENT_TYPE" to="qt.core.QByteArray"/>
+                <replace from="%ARGUMENT_NAME" to="data"/>
+                <replace from="%OUT_ARGUMENT_NAME" to="data"/>
+            </insert-template>
+        </inject-code>
+
+        <inject-code>
+            <insert-template name="gui.image_load">
+                <replace from="%FUNCTION_NAME" to="fromData"/>
+                <replace from="%ARGUMENT_TYPE" to="qt.core.QByteArray"/>
+                <replace from="%ARGUMENT_NAME" to="data"/>
+                <replace from="%OUT_ARGUMENT_NAME" to="data"/>
+                <replace from="boolean" to="QImage"/>
+                <replace from="final" to="static"/>
+            </insert-template>
+        </inject-code>
+    </value-type>
+
+    <value-type name="QCursor">
+        <template name="gui.cursor_bitmap_getter">
+            <insert-template name="gui.getter_returning_nativepointer">
+                <replace from="%RETURN_TYPE" to="QBitmap"/>
+            </insert-template>
+        </template>
+
+        <modify-function signature="bitmap()const">
+            <access modifier="private"/>
+            <rename to="bitmap_private"/>
+        </modify-function>
+        <inject-code>
+            <insert-template name="gui.cursor_bitmap_getter">
+                <replace from="%FUNCTION_NAME" to="bitmap"/>
+            </insert-template>
+        </inject-code>
+
+        <modify-function signature="mask()const">
+            <access modifier="private"/>
+            <rename to="mask_private"/>
+        </modify-function>
+        <inject-code>
+            <insert-template name="gui.cursor_bitmap_getter">
+                <replace from="%FUNCTION_NAME" to="mask"/>
+            </insert-template>
+        </inject-code>
+    </value-type>
+
+    <value-type name="QPen">
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QPen___" quote-before-line="}// class"/>
+        </inject-code>
+    </value-type>
+
+
+    <value-type name="QBrush">
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QBrush___" quote-before-line="}// class"/>
+        </inject-code>
+
+
+        <modify-function signature="gradient()const">
+            <!-- Use custom constructors already defined for gradient -->
+            <modify-argument index="0">
+                <replace-type modified-type="qt.gui.QGradient"/>
+                <conversion-rule class="native">
+                    jobject %out = qtjambi_from_object(__jni_env, %in, "QGradient", "com/trolltech/qt/gui/", "Lcom_trolltech_qt_gui_QGradient_2", true);
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+    </value-type>
+
+    <value-type name="QColor">
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QColor___" quote-before-line="}// class"/>
+        </inject-code>
+    </value-type>
+
+    <value-type name="QFontInfo"/>
+
+    <value-type name="QFontMetricsF">
+        <template name="gui.fontmetricsf_boundingrect">
+            <insert-template name="gui.fontmetrics_tabarray_function">
+                <replace from="%RETURN_TYPE" to="qt.core.QRectF"/>
+                <replace from="%FUNCTION_NAME" to="boundingRect"/>
+                <replace from="%RECT_ARGUMENTS" to="%RECT_ARGUMENTS, "/>
+                <replace from="%RECT_CALL_ARGUMENTS" to="%RECT_CALL_ARGUMENTS, "/>
+            </insert-template>
+        </template>
+
+        <inject-code>
+            <insert-template name="gui.fontmetricsf_boundingrect">
+                <replace from="%RECT_ARGUMENTS" to="qt.core.QRectF rect"/>
+                <replace from="%RECT_CALL_ARGUMENTS" to="rect"/>
+            </insert-template>
+        </inject-code>
+
+        <inject-code>
+            <insert-template name="gui.fontmetrics_tabarray_function">
+                <replace from="%RETURN_TYPE" to="qt.core.QSizeF"/>
+                <replace from="%FUNCTION_NAME" to="size"/>
+                <replace from="%RECT_ARGUMENTS" to=""/>
+                <replace from="%RECT_CALL_ARGUMENTS" to=""/>
+            </insert-template>
+        </inject-code>
+    </value-type>
+
+    <value-type name="QFontMetrics">
+        <template name="gui.fontmetrics_tabarray_function">
+        public final %RETURN_TYPE %FUNCTION_NAME(%RECT_ARGUMENTSint flags, String text, int tabStops, int tabArray[]) {
+            QNativePointer np = tabArray == null ? null : new QNativePointer(QNativePointer.Type.Int, tabArray.length + 1);
+            if (np != null) {
+                for (int i=0; i&lt;tabArray.length; ++i) np.setIntAt(i, tabArray[i]);
+                np.setIntAt(tabArray.length, 0);
+            }
+            return %FUNCTION_NAME(%RECT_CALL_ARGUMENTSflags, text, tabStops, np);
+        }
+
+        public final %RETURN_TYPE %FUNCTION_NAME(%RECT_ARGUMENTSint flags, String text, int tabStops) {
+            return %FUNCTION_NAME(%RECT_CALL_ARGUMENTSflags, text, tabStops, (int []) null);
+        }
+
+        public final %RETURN_TYPE %FUNCTION_NAME(%RECT_ARGUMENTSint flags, String text) {
+            return %FUNCTION_NAME(%RECT_CALL_ARGUMENTSflags, text, 0);
+        }
+        </template>
+
+        <template name="gui.fontmetrics_boundingrect">
+            <insert-template name="gui.fontmetrics_tabarray_function">
+                <replace from="%RETURN_TYPE" to="qt.core.QRect"/>
+                <replace from="%FUNCTION_NAME" to="boundingRect"/>
+                <replace from="%RECT_ARGUMENTS" to="%RECT_ARGUMENTS, "/>
+                <replace from="%RECT_CALL_ARGUMENTS" to="%RECT_CALL_ARGUMENTS, "/>
+            </insert-template>
+        </template>
+
+        <inject-code>
+            <insert-template name="gui.fontmetrics_boundingrect">
+                <replace from="%RECT_ARGUMENTS" to="int x, int y, int width, int height"/>
+                <replace from="%RECT_CALL_ARGUMENTS" to="x, y, width, height"/>
+            </insert-template>
+        </inject-code>
+
+        <inject-code>
+            <insert-template name="gui.fontmetrics_boundingrect">
+                <replace from="%RECT_ARGUMENTS" to="qt.core.QRect rect"/>
+                <replace from="%RECT_CALL_ARGUMENTS" to="rect"/>
+            </insert-template>
+        </inject-code>
+
+        <inject-code>
+            <insert-template name="gui.fontmetrics_tabarray_function">
+                <replace from="%RETURN_TYPE" to="qt.core.QSize"/>
+                <replace from="%FUNCTION_NAME" to="size"/>
+                <replace from="%RECT_ARGUMENTS" to=""/>
+                <replace from="%RECT_CALL_ARGUMENTS" to=""/>
+            </insert-template>
+        </inject-code>
+    </value-type>
+
+    <interface-type name="QGraphicsItem">
+
+        <modify-function signature="QGraphicsItem(QGraphicsItem*,QGraphicsScene*)">
+            <inject-code position="end">
+                <argument-map index="1" meta-name="%1"/>
+            if (%1 != null)
+                disableGarbageCollection();
+            </inject-code>
+        </modify-function>
+
+        <modify-function signature="paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *)">
+            <modify-argument index="2">
+                <conversion-rule class="shell">
+                    jobject %out = qtjambi_from_object(__jni_env, %in, "QStyleOptionGraphicsItem", "com/trolltech/qt/gui/", "Lcom_trolltech_qt_gui_QStyleOption_2", true);
+                </conversion-rule>
+                <conversion-rule class="native">
+                    const QStyleOptionGraphicsItem *%out = (QStyleOptionGraphicsItem *) qtjambi_to_object(__jni_env, %in);
+                </conversion-rule>
+                <replace-type modified-type="qt.gui.QStyleOptionGraphicsItem"/>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="setGroup(QGraphicsItemGroup*)">
+            <modify-argument index="1">
+                <reference-count action="ignore"/>
+            </modify-argument>
+            <inject-code position="beginning">
+                qt.gui.QGraphicsItemGroup oldGroup = group();
+            </inject-code>
+            <inject-code position="end">
+                <argument-map index="1" meta-name="%1"/>
+            if (%1 == null &amp;&amp; oldGroup != null &amp;&amp; oldGroup.parentItem() == null)
+                reenableGarbageCollection();
+            else
+                disableGarbageCollection();
+            </inject-code>
+        </modify-function>
+
+        <modify-function signature="setParentItem(QGraphicsItem*)">
+            <modify-argument index="1">
+                <reference-count action="ignore"/>
+            </modify-argument>
+            <inject-code position="end">
+                <argument-map index="1" meta-name="%1"/>
+            if (%1 == null)
+                reenableGarbageCollection();
+            else
+                disableGarbageCollection();
+            </inject-code>
+        </modify-function>
+    </interface-type>
+
+    <object-type name="QAbstractGraphicsShapeItem">
+        <modify-function signature="QAbstractGraphicsShapeItem(QGraphicsItem*,QGraphicsScene*)">
+            <inject-code position="end">
+                <argument-map index="1" meta-name="%1"/>
+            if (%1 != null) disableGarbageCollection();
+            </inject-code>
+        </modify-function>
+    </object-type>
+
+
+    <object-type name="QAbstractItemView">
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QAbstractItemView___" quote-before-line="}// class"/>
+        </inject-code>
+
+
+        <modify-function signature="setIndexWidget(const QModelIndex &amp;,QWidget *)">
+            <modify-argument index="2">
+                <!-- Safe to ignore because view reparents widget -->
+                <reference-count action="ignore"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="setItemDelegate(QAbstractItemDelegate *)">
+            <modify-argument index="1">
+                <reference-count action="set" variable-name="__rcItemDelegate"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="setModel(QAbstractItemModel *)">
+            <modify-argument index="1">
+                <reference-count action="set" variable-name="__rcItemModel"/>
+            </modify-argument>
+            <inject-code class="java" position="end">
+                // setModel() creates a new selection model for the object
+                qt.GeneratorUtilities.setField(this, qt.gui.QAbstractItemView.class, "__rcItemSelectionModel", null);
+            </inject-code>
+        </modify-function>
+        <modify-function signature="setSelectionModel(QItemSelectionModel *)">
+            <modify-argument index="1">
+                <no-null-pointer/>
+                <reference-count action="set" variable-name="__rcItemSelectionModel"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="setItemDelegateForColumn(int,QAbstractItemDelegate*)">
+            <modify-argument index="2">
+                <reference-count action="ignore"/>
+            </modify-argument>
+            <inject-code position="end">
+                <argument-map index="1" meta-name="%1"/>
+                <argument-map index="2" meta-name="%2"/>
+                if (%2 == null)
+                    __rcDelegatesForColumns.remove(%1);
+                else
+                    __rcDelegatesForColumns.put(%1,%2);
+            </inject-code>
+        </modify-function>
+        <modify-function signature="setItemDelegateForRow(int,QAbstractItemDelegate*)">
+            <modify-argument index="2">
+                <reference-count action="ignore"/>
+            </modify-argument>
+            <inject-code position="end">
+                <argument-map index="1" meta-name="%1"/>
+                <argument-map index="2" meta-name="%2"/>
+                if (%2 == null)
+                    __rcDelegatesForRows.remove(%1);
+                else
+                    __rcDelegatesForRows.put(%1,%2);
+            </inject-code>
+        </modify-function>
+    </object-type>
+
+
+    <object-type name="QAccessibleTableInterface">
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QAccessibleTableInterface___" quote-before-line="}// class"/>
+        </inject-code>
+
+
+        <modify-function signature="cellAtIndex(int,int*,int*,int*,int*,bool*)">
+        <modify-argument index="2">
+            <remove-argument/>
+            <conversion-rule class="native">
+                int rowHolder;
+                int *%out = &amp;rowHolder;
+            </conversion-rule>
+            <conversion-rule class="shell">
+                // nothing
+            </conversion-rule>
+        </modify-argument>
+        <modify-argument index="3">
+            <remove-argument/>
+            <conversion-rule class="native">
+                int columnHolder;
+                int *%out = &amp;columnHolder;
+            </conversion-rule>
+            <conversion-rule class="shell">
+                // nothing
+            </conversion-rule>
+        </modify-argument>
+        <modify-argument index="4">
+            <remove-argument/>
+            <conversion-rule class="native">
+                int rowSpanHolder;
+                int *%out = &amp;rowSpanHolder;
+            </conversion-rule>
+            <conversion-rule class="shell">
+                // nothing
+            </conversion-rule>
+        </modify-argument>
+        <modify-argument index="5">
+            <remove-argument/>
+            <conversion-rule class="native">
+                int columnSpanHolder;
+                int *%out = &amp;columnSpanHolder;
+            </conversion-rule>
+            <conversion-rule class="shell">
+                // nothing
+            </conversion-rule>
+        </modify-argument>
+        <modify-argument index="6">
+            <remove-argument/>
+            <conversion-rule class="native">
+                bool isSelectedHolder = false;
+                bool *%out = &amp;isSelectedHolder;
+            </conversion-rule>
+            <conversion-rule class="shell">
+                // no conversion
+            </conversion-rule>
+        </modify-argument>
+        <modify-argument index="return">
+            <replace-type modified-type="qt.gui.QAccessibleTableInterface$CellAtIndex"/>
+            <conversion-rule class="native">
+                jobject %out = qtjambi_to_cellatindex(__jni_env, rowHolder, columnHolder, rowSpanHolder, columnSpanHolder, isSelectedHolder);
+            </conversion-rule>
+            <conversion-rule class="shell">
+                qtjambi_from_cellatindex(__jni_env, %in, %2, %3, %4, %5, %6);
+            </conversion-rule>
+        </modify-argument>
+        </modify-function>
+
+        <modify-function signature="selectedColumns(int,QList&lt;int&gt;*)">
+        <modify-argument index="2">
+            <replace-type modified-type="java.util.List&lt;Integer&gt;"/>
+            <conversion-rule class="shell">
+                StaticCache *sc = StaticCache::instance();
+                sc-&gt;resolveArrayList();
+                sc-&gt;resolveCollection();
+                sc-&gt;resolveInteger();
+
+                jobject columnsHolder = 0;
+                if (%in != 0) {
+                    columnsHolder = __jni_env-&gt;NewObject(sc-&gt;ArrayList.class_ref, sc-&gt;ArrayList.constructor, %in-&gt;size());
+                    qtjambi_exception_check(__jni_env);
+                    if (columnsHolder != 0) for (int i=0; i&lt;%in-&gt;size(); i++) {
+                        __jni_env-&gt;CallVoidMethod(columnsHolder, sc-&gt;Collection.add, qtjambi_from_int(__jni_env, %in-&gt;at(i)));
+                    }
+                    qtjambi_exception_check(__jni_env);
+                }
+                jobject %out = columnsHolder;
+            </conversion-rule>
+            <conversion-rule class="native">
+                StaticCache *sc = StaticCache::instance();
+                sc-&gt;resolveCollection();
+
+                QList&lt;int&gt; columnHolder;
+                if (%in != 0) {
+                    jobjectArray columnsAsArray = (jobjectArray) __jni_env-&gt;CallObjectMethod(%in, sc-&gt;Collection.toArray);
+                    if (columnsAsArray != 0) {
+                        int len = __jni_env-&gt;GetArrayLength(columnsAsArray);
+                        for (int i=0; i&lt;len; ++i) {
+                            columnHolder.append(qtjambi_to_int(__jni_env, __jni_env-&gt;GetObjectArrayElement(columnsAsArray, i)));
+                        }
+                    }
+                    qtjambi_exception_check(__jni_env);
+                }
+                QList&lt;int&gt; *%out = &amp;columnHolder;
+            </conversion-rule>
+        </modify-argument>
+        <modify-argument index="return">
+            <conversion-rule class="shell">
+                // Copy back
+                if (columnsHolder != 0) {
+                    jobjectArray columnsAsArray = (jobjectArray) __jni_env-&gt;CallObjectMethod(columnsHolder, sc-&gt;Collection.toArray);
+                    if (columnsAsArray != 0) {
+                        int len = __jni_env-&gt;GetArrayLength(columnsAsArray);
+                        %2-&gt;clear();
+                        for (int i=0; i&lt;len; ++i) {
+                            %2-&gt;append(qtjambi_to_int(__jni_env, __jni_env-&gt;GetObjectArrayElement(columnsAsArray, i)));
+                        }
+                    }
+                }
+
+                int %out = %in;
+            </conversion-rule>
+            <conversion-rule class="native">
+                // Copy back
+                if (%2 != 0) {
+                    __jni_env-&gt;CallVoidMethod(%2, sc-&gt;Collection.clear);
+                    for (int i=0; i&lt;columnHolder.size(); ++i) {
+                        __jni_env-&gt;CallVoidMethod(%2, sc-&gt;Collection.add, qtjambi_from_int(__jni_env, columnHolder.at(i)));
+                    }
+                    qtjambi_exception_check(__jni_env);
+                }
+
+                jint %out = %in;
+            </conversion-rule>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="selectedRows(int,QList&lt;int&gt;*)">
+        <modify-argument index="2">
+            <replace-type modified-type="java.util.List&lt;Integer&gt;"/>
+            <conversion-rule class="shell">
+                StaticCache *sc = StaticCache::instance();
+                sc-&gt;resolveArrayList();
+                sc-&gt;resolveCollection();
+                sc-&gt;resolveInteger();
+
+                jobject rowsHolder = 0;
+                if (%in != 0) {
+                    rowsHolder = __jni_env-&gt;NewObject(sc-&gt;ArrayList.class_ref, sc-&gt;ArrayList.constructor, %in-&gt;size());
+                    qtjambi_exception_check(__jni_env);
+                    if (rowsHolder != 0) for (int i=0; i&lt;%in-&gt;size(); i++) {
+                        __jni_env-&gt;CallVoidMethod(rowsHolder, sc-&gt;Collection.add, qtjambi_from_int(__jni_env, %in-&gt;at(i)));
+                    }
+                    qtjambi_exception_check(__jni_env);
+                }
+                jobject %out = rowsHolder;
+            </conversion-rule>
+            <conversion-rule class="native">
+                StaticCache *sc = StaticCache::instance();
+                sc-&gt;resolveCollection();
+
+                QList&lt;int&gt; rowsHolder;
+                if (%in != 0) {
+                    jobjectArray rowsAsArray = (jobjectArray) __jni_env-&gt;CallObjectMethod(%in, sc-&gt;Collection.toArray);
+                    if (rowsAsArray != 0) {
+                        int len = __jni_env-&gt;GetArrayLength(rowsAsArray);
+                        for (int i=0; i&lt;len; ++i) {
+                            rowsHolder.append(qtjambi_to_int(__jni_env, __jni_env-&gt;GetObjectArrayElement(rowsAsArray, i)));
+                        }
+                    }
+                    qtjambi_exception_check(__jni_env);
+                }
+                QList&lt;int&gt; *%out = &amp;rowsHolder;
+            </conversion-rule>
+        </modify-argument>
+        <modify-argument index="return">
+            <conversion-rule class="shell">
+                // Copy back
+                if (rowsHolder != 0) {
+                    jobjectArray rowsAsArray = (jobjectArray) __jni_env-&gt;CallObjectMethod(rowsHolder, sc-&gt;Collection.toArray);
+                    if (rowsAsArray != 0) {
+                        int len = __jni_env-&gt;GetArrayLength(rowsAsArray);
+                        %2-&gt;clear();
+                        for (int i=0; i&lt;len; ++i) {
+                            %2-&gt;append(qtjambi_to_int(__jni_env, __jni_env-&gt;GetObjectArrayElement(rowsAsArray, i)));
+                        }
+                    }
+                }
+
+                int %out = %in;
+            </conversion-rule>
+            <conversion-rule class="native">
+                // Copy back
+                if (%2 != 0) {
+                    __jni_env-&gt;CallVoidMethod(%2, sc-&gt;Collection.clear);
+                    for (int i=0; i&lt;rowsHolder.size(); ++i) {
+                        __jni_env-&gt;CallVoidMethod(%2, sc-&gt;Collection.add, qtjambi_from_int(__jni_env, rowsHolder.at(i)));
+                    }
+                    qtjambi_exception_check(__jni_env);
+                }
+
+                jint %out = %in;
+            </conversion-rule>
+        </modify-argument>
+        </modify-function>
+    </object-type>
+
+
+    <object-type name="QAccessibleInterface">
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QAccessibleInterface___" quote-before-line="}// class"/>
+        </inject-code>
+
+
+        <template name="gui.accessible_interface_to_target">
+        jclass __target_class = resolveClass(__jni_env, "QAccessibleInterface$Target", "com/trolltech/qt/gui/");
+        QTJAMBI_EXCEPTION_CHECK(__jni_env);
+        Q_ASSERT(__target_class);
+
+        jmethodID __target_constructor = resolveMethod(__jni_env, "&lt;init&gt;", "(ILcom/trolltech/qt/gui/QAccessibleInterface;)V", "QAccessibleInterface$Target", "com/trolltech/qt/gui/");
+        QTJAMBI_EXCEPTION_CHECK(__jni_env);
+        Q_ASSERT(__target_constructor);
+
+        jobject __java_interface = %TARGET != 0 ? qtjambi_from_object(__jni_env, %TARGET, "QAccessibleInterface$ConcreteWrapper", "com/trolltech/qt/gui/", true) : 0;
+
+        jobject %OUTPUT = __jni_env-&gt;NewObject(__target_class, __target_constructor, %CHILD_INDEX, __java_interface);
+        </template>
+
+        <modify-function signature="navigate(QAccessible::RelationFlag,int,QAccessibleInterface**)const">
+            <modify-argument index="3">
+                <remove-argument/>
+                <conversion-rule class="shell">
+                    // nothing
+                </conversion-rule>
+                <conversion-rule class="native">
+                    QAccessibleInterface *__qt_interface = 0;
+                    QAccessibleInterface **%out = &amp;__qt_interface;
+                </conversion-rule>
+            </modify-argument>
+
+            <modify-argument index="0">
+                <replace-type modified-type="qt.gui.QAccessibleInterface$Target"/>
+                <conversion-rule class="native">
+                    <insert-template name="gui.accessible_interface_to_target">
+                        <replace from="%TARGET" to="__qt_interface"/>
+                        <replace from="%CHILD_INDEX" to="%in"/>
+                        <replace from="%OUTPUT" to="%out"/>
+                    </insert-template>
+                </conversion-rule>
+                <conversion-rule class="shell">
+                    jfieldID __childIndex_id = resolveField(__jni_env, "childIndex", "I", "QAccessibleInterface$Target", "com/trolltech/qt/gui/");
+                    Q_ASSERT(__childIndex_id);
+
+                    jfieldID __target_id = resolveField(__jni_env, "target", "Lcom/trolltech/qt/gui/QAccessibleInterface;", "QAccessibleInterface$Target", "com/trolltech/qt/gui/");
+                    Q_ASSERT(__target_id);
+
+                    jint %out = __jni_env-&gt;GetIntField(%in, __childIndex_id);
+
+                    jobject __java_interface = __jni_env-&gt;GetObjectField(%in, __target_id);
+                    QtJambiLink *__qt_link = __java_interface != 0 ? QtJambiLink::findLink(__jni_env, __java_interface) : 0;
+                    if (__qt_link != 0) __qt_link-&gt;disableGarbageCollection(__jni_env, __java_interface);
+                    QAccessibleInterface *__qt_interface = __qt_link != 0 ? (QAccessibleInterface *) __qt_link-&gt;pointer() : 0;
+
+                    if (%3 != 0) *%3 = __qt_interface;
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+    </object-type>
+
+    <object-type name="QActionGroup">
+        <modify-function signature="addAction(QAction*)">
+            <modify-argument index="1">
+                <reference-count action="add" variable-name="__rcActions"/>
+            </modify-argument>
+            <inject-code position="end">
+                <argument-map index="1" meta-name="%1"/>
+                qt.GeneratorUtilities.setField(%1, QAction.class, "__rcActionGroup", this);
+            </inject-code>
+        </modify-function>
+        <modify-function signature="removeAction(QAction*)">
+            <modify-argument index="1">
+                <reference-count action="remove" variable-name="__rcActions"/>
+            </modify-argument>
+            <inject-code position="end">
+                <argument-map index="1" meta-name="%1"/>
+                qt.GeneratorUtilities.setField(%1, QAction.class, "__rcActionGroup", null);
+            </inject-code>
+        </modify-function>
+    </object-type>
+
+    <object-type name="QCheckBox">
+        <inject-code>
+            <insert-template name="gui.init_style_option">
+                <replace from="%TYPE" to="QStyleOptionButton"/>
+            </insert-template>
+        </inject-code>
+    </object-type>
+
+
+    <object-type name="QDesktopServices">
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QDesktopServices___" quote-before-line="}// class"/>
+        </inject-code>
+
+    </object-type>
+
+
+    <object-type name="QWizardPage">
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QWizardPage___" quote-before-line="}// class"/>
+        </inject-code>
+
+    </object-type>
+
+
+    <object-type name="QFontDialog">
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QFontDialog___" quote-before-line="}// class"/>
+        </inject-code>
+
+        <template name="gui.fontdialog_get_font_general">
+            public static Result getFont(%FONT_ARGUMENT %COMMA QWidget parent %STRING_ARGUMENT) {
+                QNativePointer np = new QNativePointer(QNativePointer.Type.Boolean);
+                QFont returned = getFont(np, %FONT_CALL_ARGUMENT %COMMA parent %STRING_CALL_ARGUMENT);
+                return new Result(returned, np.booleanValue());
+            }
+        </template>
+
+        <template name="gui.fontdialog_get_font_nocaption">
+            <insert-template name="gui.fontdialog_get_font_general">
+                <replace from="%STRING_ARGUMENT" to=""/>
+                <replace from="%STRING_CALL_ARGUMENT" to=""/>
+            </insert-template>
+
+            public static Result getFont(%FONT_ARGUMENT) {
+                return getFont(%FONT_CALL_ARGUMENT %COMMA (QWidget) null);
+            }
+        </template>
+
+        <modify-function signature="getFont(bool*,QFont,QWidget*,QString)">
+            <access modifier="private"/>
+        </modify-function>
+        <inject-code>
+            <insert-template name="gui.fontdialog_get_font_general">
+                <replace from="%FONT_ARGUMENT %COMMA" to="QFont initial,"/>
+                <replace from="%STRING_ARGUMENT" to=", String caption"/>
+                <replace from="%FONT_CALL_ARGUMENT %COMMA" to="initial,"/>
+                <replace from="%STRING_CALL_ARGUMENT" to=", caption"/>
+            </insert-template>
+        </inject-code>
+
+        <modify-function signature="getFont(bool*,QWidget*)">
+            <access modifier="private"/>
+            <modify-argument index="2">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+        <inject-code>
+            <insert-template name="gui.fontdialog_get_font_nocaption">
+                <replace from="%FONT_ARGUMENT" to=""/>
+                <replace from="%COMMA" to=""/>
+                <replace from="%FONT_CALL_ARGUMENT" to=""/>
+            </insert-template>
+        </inject-code>
+
+        <modify-function signature="getFont(bool*,QFont,QWidget*)">
+            <access modifier="private"/>
+            <modify-argument index="3">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+        <inject-code>
+            <insert-template name="gui.fontdialog_get_font_nocaption">
+                <replace from="%FONT_ARGUMENT" to="QFont initial"/>
+                <replace from="%COMMA" to=", "/>
+                <replace from="%FONT_CALL_ARGUMENT" to="initial"/>
+            </insert-template>
+        </inject-code>
+    </object-type>
+
+    <object-type name="QGraphicsEllipseItem">
+        <modify-function signature="QGraphicsEllipseItem(QGraphicsItem*,QGraphicsScene*)">
+            <inject-code position="end">
+                <argument-map index="1" meta-name="%1"/>
+                if (%1 != null) disableGarbageCollection();
+            </inject-code>
+        </modify-function>
+        <modify-function signature="QGraphicsEllipseItem(const QRectF &amp;,QGraphicsItem*,QGraphicsScene*)">
+            <inject-code position="end">
+                <argument-map index="2" meta-name="%2"/>
+                if (%2 != null) disableGarbageCollection();
+            </inject-code>
+        </modify-function>
+        <modify-function signature="QGraphicsEllipseItem(double,double,double,double,QGraphicsItem*,QGraphicsScene*)">
+            <inject-code position="end">
+                <argument-map index="5" meta-name="%5"/>
+                if (%5 != null) disableGarbageCollection();
+            </inject-code>
+        </modify-function>
+    </object-type>
+
+    <object-type name="QGraphicsItemGroup">
+        <modify-function signature="QGraphicsItemGroup(QGraphicsItem*,QGraphicsScene*)">
+            <inject-code position="end">
+                <argument-map index="1" meta-name="%1"/>
+                if (%1 != null) disableGarbageCollection();
+            </inject-code>
+        </modify-function>
+        <modify-function signature="addToGroup(QGraphicsItem*)">
+            <modify-argument index="1">
+                <define-ownership class="java" owner="c++"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="removeFromGroup(QGraphicsItem*)">
+            <modify-argument index="1">
+                <reference-count action="ignore"/>
+            </modify-argument>
+            <inject-code position="end">
+                <argument-map index="1" meta-name="%1"/>
+                if (parentItem() == null)
+                %1.reenableGarbageCollection();
+            </inject-code>
+        </modify-function>
+    </object-type>
+
+    <object-type name="QGraphicsLineItem">
+        <modify-function signature="QGraphicsLineItem(QGraphicsItem*,QGraphicsScene*)">
+            <inject-code position="end">
+                <argument-map index="1" meta-name="%1"/>
+                if (%1 != null) disableGarbageCollection();
+            </inject-code>
+        </modify-function>
+        <modify-function signature="QGraphicsLineItem(const QLineF &amp;,QGraphicsItem*,QGraphicsScene*)">
+            <inject-code position="end">
+                <argument-map index="2" meta-name="%2"/>
+                if (%2 != null) disableGarbageCollection();
+            </inject-code>
+        </modify-function>
+        <modify-function signature="QGraphicsLineItem(double,double,double,double,QGraphicsItem*,QGraphicsScene*)">
+            <inject-code position="end">
+                <argument-map index="5" meta-name="%5"/>
+                if (%5 != null) disableGarbageCollection();
+            </inject-code>
+        </modify-function>
+    </object-type>
+
+    <object-type name="QGraphicsPathItem">
+        <modify-function signature="QGraphicsPathItem(QGraphicsItem*,QGraphicsScene*)">
+            <inject-code position="end">
+                <argument-map index="1" meta-name="%1"/>
+                if (%1 != null) disableGarbageCollection();
+            </inject-code>
+        </modify-function>
+        <modify-function signature="QGraphicsPathItem(const QPainterPath &amp;,QGraphicsItem*,QGraphicsScene*)">
+            <inject-code position="end">
+                <argument-map index="2" meta-name="%2"/>
+                if (%2 != null) disableGarbageCollection();
+            </inject-code>
+        </modify-function>
+    </object-type>
+
+    <object-type name="QGraphicsPixmapItem">
+        <modify-function signature="QGraphicsPixmapItem(QGraphicsItem*,QGraphicsScene*)">
+            <inject-code position="end">
+                <argument-map index="1" meta-name="%1"/>
+                if (%1 != null) disableGarbageCollection();
+            </inject-code>
+        </modify-function>
+        <modify-function signature="QGraphicsPixmapItem(const QPixmap &amp;,QGraphicsItem*,QGraphicsScene*)">
+            <inject-code position="end">
+                <argument-map index="2" meta-name="%2"/>
+                if (%2 != null) disableGarbageCollection();
+            </inject-code>
+        </modify-function>
+    </object-type>
+
+    <object-type name="QGraphicsPolygonItem">
+        <modify-function signature="QGraphicsPolygonItem(QGraphicsItem*,QGraphicsScene*)">
+            <inject-code position="end">
+                <argument-map index="1" meta-name="%1"/>
+                if (%1 != null) disableGarbageCollection();
+            </inject-code>
+        </modify-function>
+        <modify-function signature="QGraphicsPolygonItem(const QPolygonF &amp;,QGraphicsItem*,QGraphicsScene*)">
+            <inject-code position="end">
+                <argument-map index="2" meta-name="%2"/>
+                if (%2 != null) disableGarbageCollection();
+            </inject-code>
+        </modify-function>
+    </object-type>
+
+
+    <object-type name="QGraphicsRectItem">
+        <modify-function signature="QGraphicsRectItem(QGraphicsItem*,QGraphicsScene*)">
+            <inject-code position="end">
+                <argument-map index="1" meta-name="%1"/>
+                if (%1 != null) disableGarbageCollection();
+            </inject-code>
+        </modify-function>
+        <modify-function signature="QGraphicsRectItem(double,double,double,double,QGraphicsItem*,QGraphicsScene*)">
+            <inject-code position="end">
+                <argument-map index="5" meta-name="%5"/>
+                if (%5 != null) disableGarbageCollection();
+            </inject-code>
+        </modify-function>
+        <modify-function signature="QGraphicsRectItem(const QRectF &amp;,QGraphicsItem*,QGraphicsScene*)">
+            <inject-code position="end">
+                <argument-map index="2" meta-name="%2"/>
+                if (%2 != null) disableGarbageCollection();
+            </inject-code>
+        </modify-function>
+    </object-type>
+
+    <object-type name="QGraphicsSimpleTextItem">
+        <modify-function signature="QGraphicsSimpleTextItem(QGraphicsItem*,QGraphicsScene*)">
+            <inject-code position="end">
+                <argument-map index="1" meta-name="%1"/>
+                if (%1 != null) disableGarbageCollection();
+            </inject-code>
+        </modify-function>
+        <modify-function signature="QGraphicsSimpleTextItem(const QString &amp;,QGraphicsItem*,QGraphicsScene*)">
+            <inject-code position="end">
+                <argument-map index="2" meta-name="%2"/>
+                if (%2 != null) disableGarbageCollection();
+            </inject-code>
+        </modify-function>
+    </object-type>
+
+    <object-type name="QItemEditorFactory">
+        <modify-function signature="setDefaultFactory(QItemEditorFactory*)">
+            <modify-argument index="1">
+                <define-ownership class="java" owner="c++"/>
+            </modify-argument>
+        </modify-function>
+    </object-type>
+
+
+    <object-type name="QMenu">
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QMenu___" quote-before-line="}// class"/>
+        </inject-code>
+
+
+        <template name="gui.addAction">
+        public final QAction addAction(%EXTRA String text, Object receiver, String method %END_EXTRA) {
+            QAction returned = addAction(%CALL_EXTRA text %END_CALL_EXTRA);
+            %POST_CALL
+            returned.triggered.connect(receiver, method);
+
+            return returned;
+        }
+
+        public final QAction addAction(%EXTRA String text, qt.QSignalEmitter.AbstractSignal signal %END_EXTRA) {
+            QAction returned = addAction(%CALL_EXTRA text %END_CALL_EXTRA);
+            %POST_CALL
+            returned.triggered.connect(signal);
+            return returned;
+        }
+        </template>
+
+        <template name="gui.addAction_with_shortcut">
+            <insert-template name="gui.addAction">
+                <replace from="%POST_CALL" to="returned.setShortcut(shortcut);"/>
+                <replace from=" %END_EXTRA" to=", QKeySequence shortcut"/>
+                <replace from=" %END_CALL_EXTRA" to=""/>
+            </insert-template>
+
+        public final QAction addAction(%EXTRA String text, Object receiver, String method) {
+            return addAction(%CALL_EXTRA text, receiver, method, new QKeySequence(0));
+        }
+
+        public final QAction addAction(%EXTRA String text, qt.QSignalEmitter.AbstractSignal signal) {
+            return addAction(%CALL_EXTRA text, signal, new QKeySequence(0));
+        }
+        </template>
+
+        <inject-code>
+            <insert-template name="gui.addAction_with_shortcut">
+                <replace from="%EXTRA " to=""/>
+                <replace from="%CALL_EXTRA " to=""/>
+            </insert-template>
+        </inject-code>
+
+        <inject-code>
+            <insert-template name="gui.addAction_with_shortcut">
+                <replace from="%EXTRA" to="QIcon icon,"/>
+                <replace from="%CALL_EXTRA" to="icon,"/>
+            </insert-template>
+        </inject-code>
+    </object-type>
+
+
+    <object-type name="QMenuBar">
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QMenuBar___" quote-before-line="}// class"/>
+        </inject-code>
+        <inject-code>
+            <insert-template name="gui.addAction">
+                <replace from="%POST_CALL" to=""/>
+                <replace from=" %END_EXTRA" to=""/>
+                <replace from=" %END_CALL_EXTRA" to=""/>
+                <replace from="%EXTRA " to=""/>
+                <replace from="%CALL_EXTRA " to=""/>
+            </insert-template>
+        </inject-code>
+
+
+    </object-type>
+
+    <object-type name="QPictureIO">
+        <extra-includes>
+            <include file-name="qt.QNativePointer" location="java"/>
+        </extra-includes>
+        <inject-code>
+        public QPictureIO(qt.core.QIODevice ioDevice, String format) {
+            this(ioDevice, QNativePointer.createCharPointer(format));
+        }
+
+        public QPictureIO(String fileName, String format) {
+            this(fileName, QNativePointer.createCharPointer(format));
+        }
+
+            <insert-template name="core.return_string_instead_of_char*">
+                <replace from="%FUNCTION_NAME" to="format"/>
+            </insert-template>
+            <insert-template name="core.return_string_instead_of_char*">
+                <replace from="%FUNCTION_NAME" to="parameters"/>
+            </insert-template>
+            <insert-template name="core.call_with_string_instead_of_char*">
+                <replace from="%FUNCTION_NAME" to="setFormat"/>
+                <replace from="%ARG_NAME" to="format"/>
+            </insert-template>
+            <insert-template name="core.call_with_string_instead_of_char*">
+                <replace from="%FUNCTION_NAME" to="setParameters"/>
+                <replace from="%ARG_NAME" to="parameters"/>
+            </insert-template>
+        </inject-code>
+    </object-type>
+
+
+    <object-type name="QPixmapCache">
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QPixmapCache___" quote-before-line="}// class"/>
+        </inject-code>
+
+    </object-type>
+
+    <object-type name="QProgressBar">
+        <inject-code>
+            <insert-template name="gui.init_style_option">
+                <replace from="%TYPE" to="QStyleOptionProgressBar"/>
+            </insert-template>
+        </inject-code>
+    </object-type>
+
+    <object-type name="QPushButton">
+        <inject-code>
+            <insert-template name="gui.init_style_option">
+                <replace from="%TYPE" to="QStyleOptionButton"/>
+            </insert-template>
+        </inject-code>
+    </object-type>
+
+
+    <object-type name="QShortcut">
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QShortcut___" quote-before-line="}// class"/>
+        </inject-code>
+
+    </object-type>
+
+    <object-type name="QStandardItem">
+        <modify-function signature="appendColumn(const QList&lt;QStandardItem *&gt; &amp;)">
+            <modify-argument index="1">
+                <define-ownership class="java" owner="c++"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="appendRow(const QList&lt;QStandardItem *&gt; &amp;)">
+            <modify-argument index="1">
+                <define-ownership class="java" owner="c++"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="appendRow(QStandardItem *)">
+            <modify-argument index="1">
+                <define-ownership class="java" owner="c++"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="insertColumn(int, const QList&lt;QStandardItem *&gt; &amp;)">
+            <modify-argument index="2">
+                <define-ownership class="java" owner="c++"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="insertRow(int, const QList&lt;QStandardItem *&gt; &amp;)">
+            <modify-argument index="2">
+                <define-ownership class="java" owner="c++"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="insertRow(int, QStandardItem *)">
+            <modify-argument index="2">
+                <define-ownership class="java" owner="c++"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="setChild(int,int,QStandardItem *)">
+            <modify-argument index="3">
+                <define-ownership class="java" owner="c++"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="setChild(int,QStandardItem *)">
+            <modify-argument index="2">
+                <define-ownership class="java" owner="c++"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="takeChild(int,int)">
+            <modify-argument index="return">
+                <define-ownership class="java" owner="default"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="takeColumn(int)">
+            <modify-argument index="return">
+                <define-ownership class="java" owner="default"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="takeRow(int)">
+            <modify-argument index="return">
+                <define-ownership class="java" owner="default"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="clone()const">
+            <modify-argument index="return">
+                <define-ownership class="shell" owner="c++"/>
+            </modify-argument>
+        </modify-function>
+    </object-type>
+
+    <object-type name="QToolButton">
+        <inject-code>
+            <insert-template name="gui.init_style_option">
+                <replace from="%TYPE" to="QStyleOptionToolButton"/>
+            </insert-template>
+        </inject-code>
+    </object-type>
+
+    <object-type name="QUndoStack">
+        <modify-function signature="push(QUndoCommand *)">
+            <modify-argument index="1">
+                <define-ownership class="java" owner="c++"/>
+            </modify-argument>
+        </modify-function>
+    </object-type>
+
+
+    <object-type name="QValidator">
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QValidator___" quote-before-line="}// class"/>
+        </inject-code>
+
+
+        <modify-function signature="fixup(QString&amp;)const">
+            <modify-argument index="1">
+                <replace-type modified-type="java.lang.String"/>
+                <conversion-rule class="shell">
+                    jobject %out = (jobject) qtjambi_from_qstring(__jni_env, %in);
+                </conversion-rule>
+                <conversion-rule class="native">
+                    QString %out = qtjambi_to_qstring(__jni_env, (jstring) %in);
+                    QString *__qt_converted = &amp;%out;
+                </conversion-rule>
+            </modify-argument>
+
+            <modify-argument index="0">
+                <replace-type modified-type="java.lang.String"/>
+                <conversion-rule class="native">
+                    jobject %out = (jobject) qtjambi_from_qstring(__jni_env, *__qt_converted);
+                </conversion-rule>
+                <conversion-rule class="shell">
+                    %1 = qtjambi_to_qstring(__jni_env, (jstring) %in);
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="validate(QString&amp;,int&amp;)const">
+            <modify-argument index="1">
+                <replace-type modified-type="qt.gui.QValidator$QValidationData"/>
+                <conversion-rule class="shell">
+                    <insert-template name="gui.convert_validationdata_to_java">
+                        <replace from="%STRING" to="%1"/>
+                        <replace from="%POS" to="%2"/>
+                    </insert-template>
+                </conversion-rule>
+                <conversion-rule class="native">
+                    <insert-template name="gui.convert_validationdata_to_string"/>
+                </conversion-rule>
+            </modify-argument>
+
+            <modify-argument index="2">
+                <remove-argument/>
+                <conversion-rule class="shell">
+                    // nothing needed
+                </conversion-rule>
+                <conversion-rule class="native">
+                    <insert-template name="gui.convert_validationdata_to_pos">
+                        <replace from="%VALIDATIONDATA" to="%1"/>
+                    </insert-template>
+                </conversion-rule>
+            </modify-argument>
+
+            <modify-argument index="return">
+                <conversion-rule class="native">
+                    <insert-template name="gui.cleanup_validationdata_from_java"/>
+                    jint %out = %in;
+                </conversion-rule>
+                <conversion-rule class="shell">
+                    <insert-template name="gui.cleanup_validationdata_to_java">
+                        <replace from="%STRING" to="%1"/>
+                        <replace from="%POS" to="%2"/>
+                    </insert-template>
+                    QValidator::State %out = (QValidator::State) qtjambi_to_enumerator(__jni_env, %in);
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+    </object-type>
+
+    <object-type name="QWidgetAction">
+        <modify-function signature="setDefaultWidget(QWidget*)">
+            <modify-argument index="1">
+                <define-ownership class="java" owner="c++"/>
+            </modify-argument>
+        </modify-function>
+    </object-type>
+
+
+    <object-type name="QAbstractButton">
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QAbstractButton___" quote-before-line="}// class"/>
+        </inject-code>
+
+    </object-type>
+
+    <template name="gui::qstyleoption_from_object">
+        jobject %out = qtjambi_from_object(__jni_env, %in, "QStyleOption", "com/trolltech/qt/gui/", "Lcom_trolltech_qt_gui_QStyleOption_2", true);
+    </template>
+
+    <template name="gui::qstyleoptioncomplex_from_object">
+        jobject %out = qtjambi_from_object(__jni_env, %in, "QStyleOptionComplex", "com/trolltech/qt/gui/", "Lcom_trolltech_qt_gui_QStyleOption_2", true);
+    </template>
+
+    <template name="gui::qstyleoption_to_object">
+        QStyleOption *%out = (QStyleOption *) qtjambi_to_object(__jni_env, %in);
+    </template>
+
+
+    <object-type name="QStyle">
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QStyle___" quote-before-line="}// class"/>
+        </inject-code>
+        <modify-function signature="drawControl(QStyle::ControlElement, const QStyleOption *, QPainter *, const QWidget *) const">
+            <modify-argument index="2">
+                <replace-type modified-type="qt.gui.QStyleOption"/>
+                <conversion-rule class="shell">
+                    <insert-template name="gui::qstyleoption_from_object"/>
+                </conversion-rule>
+                <conversion-rule class="native">
+                    <insert-template name="gui::qstyleoption_to_object"/>
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="drawComplexControl(QStyle::ComplexControl, const QStyleOptionComplex *, QPainter *, const QWidget *) const">
+            <modify-argument index="2">
+                <replace-type modified-type="qt.gui.QStyleOptionComplex"/>
+                <conversion-rule class="shell">
+                    <insert-template name="gui::qstyleoptioncomplex_from_object"/>
+                </conversion-rule>
+                <conversion-rule class="native">
+                    <insert-template name="gui::qstyleoption_to_object"/>
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="drawPrimitive(QStyle::PrimitiveElement, const QStyleOption *, QPainter *, const QWidget *) const">
+            <modify-argument index="2">
+                <replace-type modified-type="qt.gui.QStyleOption"/>
+                <conversion-rule class="shell">
+                    <insert-template name="gui::qstyleoption_from_object"/>
+                </conversion-rule>
+                <conversion-rule class="native">
+                    <insert-template name="gui::qstyleoption_to_object"/>
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="hitTestComplexControl(QStyle::ComplexControl, const QStyleOptionComplex *, const QPoint &amp;, const QWidget *) const">
+            <modify-argument index="2">
+                <replace-type modified-type="qt.gui.QStyleOptionComplex"/>
+                <conversion-rule class="shell">
+                    <insert-template name="gui::qstyleoptioncomplex_from_object"/>
+                </conversion-rule>
+                <conversion-rule class="native">
+                    <insert-template name="gui::qstyleoption_to_object"/>
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="pixelMetric(QStyle::PixelMetric, const QStyleOption *, const QWidget *) const">
+            <modify-argument index="2">
+                <replace-type modified-type="qt.gui.QStyleOption"/>
+                <conversion-rule class="shell">
+                    <insert-template name="gui::qstyleoption_from_object"/>
+                </conversion-rule>
+                <conversion-rule class="native">
+                    <insert-template name="gui::qstyleoption_to_object"/>
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="sizeFromContents(QStyle::ContentsType, const QStyleOption *, const QSize &amp;, const QWidget *) const">
+            <modify-argument index="2">
+                <replace-type modified-type="qt.gui.QStyleOption"/>
+                <conversion-rule class="shell">
+                    <insert-template name="gui::qstyleoption_from_object"/>
+                </conversion-rule>
+                <conversion-rule class="native">
+                    <insert-template name="gui::qstyleoption_to_object"/>
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="standardIcon(QStyle::StandardPixmap, const QStyleOption *, const QWidget *) const">
+            <modify-argument index="2">
+                <replace-type modified-type="qt.gui.QStyleOption"/>
+                <conversion-rule class="shell">
+                    <insert-template name="gui::qstyleoption_from_object"/>
+                </conversion-rule>
+                <conversion-rule class="native">
+                    <insert-template name="gui::qstyleoption_to_object"/>
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="standardPixmap(QStyle::StandardPixmap, const QStyleOption *, const QWidget *) const">
+            <modify-argument index="2">
+                <replace-type modified-type="qt.gui.QStyleOption"/>
+                <conversion-rule class="shell">
+                    <insert-template name="gui::qstyleoption_from_object"/>
+                </conversion-rule>
+                <conversion-rule class="native">
+                    <insert-template name="gui::qstyleoption_to_object"/>
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="styleHint(QStyle::StyleHint, const QStyleOption *, const QWidget *, QStyleHintReturn *) const">
+            <modify-argument index="2">
+                <replace-type modified-type="qt.gui.QStyleOption"/>
+                <conversion-rule class="shell">
+                    <insert-template name="gui::qstyleoption_from_object"/>
+                </conversion-rule>
+                <conversion-rule class="native">
+                    <insert-template name="gui::qstyleoption_to_object"/>
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="subControlRect(QStyle::ComplexControl, const QStyleOptionComplex *, QStyle::SubControl, const QWidget *) const">
+            <modify-argument index="2">
+                <replace-type modified-type="qt.gui.QStyleOptionComplex"/>
+                <conversion-rule class="shell">
+                    <insert-template name="gui::qstyleoptioncomplex_from_object"/>
+                </conversion-rule>
+                <conversion-rule class="native">
+                    QStyleOptionComplex *%out = (QStyleOptionComplex *) qtjambi_to_object(__jni_env, %in);
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="subElementRect(QStyle::SubElement, const QStyleOption *, const QWidget *) const">
+            <modify-argument index="2">
+                <replace-type modified-type="qt.gui.QStyleOption"/>
+                <conversion-rule class="shell">
+                    <insert-template name="gui::qstyleoption_from_object"/>
+                </conversion-rule>
+                <conversion-rule class="native">
+                    <insert-template name="gui::qstyleoption_to_object"/>
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="generatedIconPixmap(QIcon::Mode,QPixmap,const QStyleOption*)const">
+            <modify-argument index="3">
+                <replace-type modified-type="qt.gui.QStyleOption"/>
+                <conversion-rule class="shell">
+                    <insert-template name="gui::qstyleoption_from_object"/>
+                </conversion-rule>
+                <conversion-rule class="native">
+                    <insert-template name="gui::qstyleoption_to_object"/>
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="polish(QPalette&amp;)">
+            <modify-argument index="1">
+                <replace-type modified-type="qt.gui.QPalette"/>
+                <conversion-rule class="shell">
+                    jobject %out = qtjambi_from_object(__jni_env, &amp;%in, "QPalette", "com/trolltech/qt/gui/", false);
+                    jobject __invalidate_me = %out;
+                </conversion-rule>
+                <conversion-rule class="native">
+                    QtJambiLink *link = QtJambiLink::findLink(__jni_env, %in);
+                    Q_ASSERT(link != 0);
+
+                    QPalette dummy;
+                    QPalette &amp;%out = link != 0 ? * (QPalette *) link-&gt;pointer() : dummy;
+                </conversion-rule>
+            </modify-argument>
+            <modify-argument index="0">
+                <conversion-rule class="shell">
+                    if (__invalidate_me != 0)
+                    qtjambi_invalidate_object(__jni_env, __invalidate_me);
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="standardIconImplementation(QStyle::StandardPixmap,const QStyleOption*,const QWidget*)const">
+            <modify-argument index="2">
+                <replace-type modified-type="qt.gui.QStyleOption"/>
+                <conversion-rule class="shell">
+                    <insert-template name="gui::qstyleoption_from_object"/>
+                </conversion-rule>
+                <conversion-rule class="native">
+                    <insert-template name="gui::qstyleoption_to_object"/>
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="combinedLayoutSpacing(QFlags&lt;QSizePolicy::ControlType&gt;,QFlags&lt;QSizePolicy::ControlType&gt;,Qt::Orientation,QStyleOption*,QWidget*)const">
+            <access modifier="private"/>
+            <modify-argument index="4">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="5">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+
+
+        <modify-function signature="layoutSpacing(QSizePolicy::ControlType,QSizePolicy::ControlType,Qt::Orientation,const QStyleOption*,const QWidget*)const">
+            <access modifier="private"/>
+            <modify-argument index="4">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="5">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+
+
+        <modify-function signature="layoutSpacingImplementation(QSizePolicy::ControlType,QSizePolicy::ControlType,Qt::Orientation,const QStyleOption*,const QWidget*)const">
+            <modify-argument index="4">
+                <replace-type modified-type="qt.gui.QStyleOption"/>
+                <conversion-rule class="shell">
+                    <insert-template name="gui::qstyleoption_from_object"/>
+                </conversion-rule>
+                <conversion-rule class="native">
+                    <insert-template name="gui::qstyleoption_to_object"/>
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+
+
+        <inject-code class="shell-declaration"> <!-- Remove in Qt 5 -->
+            QPixmap standardPixmap(QStyle::StandardPixmap, const QStyleOption*, const QWidget*) const { return QPixmap(); }
+        </inject-code>
+
+        <modify-function signature="standardPixmap(QStyle::StandardPixmap, const QStyleOption*, const QWidget*)const" remove="all"/> <!--### Obsolete in 4.3-->
+    </object-type>
+
+
+    <object-type name="QLayout">
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QLayout___" quote-before-line="}// class"/>
+        </inject-code>
+        <modify-function signature="addItem(QLayoutItem *)">
+            <modify-argument index="1">
+                <define-ownership class="java" owner="c++"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="removeItem(QLayoutItem *)">
+            <modify-argument index="1">
+                <define-ownership class="java" owner="default"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="addChildLayout(QLayout *)">
+            <modify-argument index="1">
+                <define-ownership class="java" owner="c++"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="addChildLayout(QLayout *)">
+            <modify-argument index="1">
+                <define-ownership class="java" owner="c++"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="itemAt(int) const">
+            <modify-argument index="return">
+                <define-ownership class="java" owner="c++"/>
+            </modify-argument>
+        </modify-function>
+
+
+    </object-type>
+
+
+    <object-type name="QGridLayout">
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QGridLayout___" quote-before-line="}// class"/>
+        </inject-code>
+        <extra-includes>
+            <include file-name="qt.QNativePointer" location="java"/>
+        </extra-includes>
+
+
+    </object-type>
+
+    <template name="gui.inputDialog_get_input">
+    public static %RETURN_TYPE %FUNCTION_NAME(qt.gui.QWidget parent, java.lang.String title, java.lang.String label, %EXTRA, qt.core.Qt.WindowFlags f) {
+        qt.QNativePointer ok = new qt.QNativePointer(qt.QNativePointer.Type.Boolean);
+        %RETURN_TYPE result = %FUNCTION_NAME_internal(parent, title, label, %CALL, ok, f);
+        return ok.booleanValue() ? result : null;
+    }
+
+    public static %RETURN_TYPE %FUNCTION_NAME(qt.gui.QWidget parent, java.lang.String title, java.lang.String label, %EXTRA, qt.core.Qt.WindowType ... f) {
+        qt.QNativePointer ok = new qt.QNativePointer(qt.QNativePointer.Type.Boolean);
+        %RETURN_TYPE result = %FUNCTION_NAME_internal(parent, title, label, %CALL, ok, f);
+        return ok.booleanValue() ? result : null;
+    }
+
+    public static %RETURN_TYPE %FUNCTION_NAME(qt.gui.QWidget parent, java.lang.String title, java.lang.String label, %EXTRA) {
+        return %FUNCTION_NAME(parent, title, label, %CALL, qt.core.Qt.WindowType.Widget);
+    }
+
+    </template>
+
+    <object-type name="QInputDialog">
+        <inject-code>
+        <insert-template name="gui.inputDialog_get_input">
+            <replace from="%RETURN_TYPE" to="Double"/>
+            <replace from="%EXTRA" to="double value, double minValue, double maxValue, int decimals"/>
+            <replace from="%FUNCTION_NAME" to="getDouble"/>
+            <replace from="%CALL" to="value, minValue, maxValue, decimals"/>
+        </insert-template>
+
+        public static Double getDouble(qt.gui.QWidget parent, java.lang.String title, java.lang.String label, double value, double minValue, double maxValue) {
+            return getDouble(parent, title, label, value, minValue, maxValue, 1);
+        }
+
+        public static Double getDouble(qt.gui.QWidget parent, java.lang.String title, java.lang.String label, double value, double minValue) {
+            return getDouble(parent, title, label, value, minValue, (double)2147483647);
+        }
+
+
+        public static Double getDouble(qt.gui.QWidget parent, java.lang.String title, java.lang.String label, double value) {
+            return getDouble(parent, title, label, value, (double)-2147483647);
+        }
+
+        public static Double getDouble(qt.gui.QWidget parent, java.lang.String title, java.lang.String label) {
+            return getDouble(parent, title, label, 0.0);
+        }
+        </inject-code>
+
+        <inject-code>
+            <insert-template name="gui.inputDialog_get_input">
+                <replace from="%RETURN_TYPE" to="Integer"/>
+                <replace from="%EXTRA" to="int value, int minValue, int maxValue, int step"/>
+                <replace from="%FUNCTION_NAME" to="getInteger"/>
+                <replace from="%CALL" to="value, minValue, maxValue, step"/>
+            </insert-template>
+
+        public static Integer getInteger(qt.gui.QWidget parent, java.lang.String title, java.lang.String label, int value, int minValue, int maxValue) {
+            return getInteger(parent, title, label, value, minValue, maxValue, 1);
+        }
+
+        public static Integer getInteger(qt.gui.QWidget parent, java.lang.String title, java.lang.String label, int value, int minValue) {
+            return getInteger(parent, title, label, value, minValue, (int)2147483647);
+        }
+
+        public static Integer getInteger(qt.gui.QWidget parent, java.lang.String title, java.lang.String label, int value) {
+            return getInteger(parent, title, label, value, (int)-2147483647);
+        }
+
+        public static Integer getInteger(qt.gui.QWidget parent, java.lang.String title, java.lang.String label) {
+            return getInteger(parent, title, label, 0);
+        }
+        </inject-code>
+
+        <inject-code>
+            <insert-template name="gui.inputDialog_get_input">
+                <replace from="%RETURN_TYPE" to="String"/>
+                <replace from="%EXTRA" to="java.util.List&lt;java.lang.String&gt; list, int current, boolean editable"/>
+                <replace from="%FUNCTION_NAME" to="getItem"/>
+                <replace from="%CALL" to="list, current, editable"/>
+            </insert-template>
+
+        public static java.lang.String getItem(qt.gui.QWidget parent, java.lang.String title, java.lang.String label, java.util.List&lt;java.lang.String&gt; list, int current) {
+            return getItem(parent, title, label, list, current, true);
+        }
+
+        public static java.lang.String getItem(qt.gui.QWidget parent, java.lang.String title, java.lang.String label, java.util.List&lt;java.lang.String&gt; list) {
+            return getItem(parent, title, label, list, 0);
+        }
+        </inject-code>
+        <inject-code>
+            <insert-template name="gui.inputDialog_get_input">
+                <replace from="%RETURN_TYPE" to="String"/>
+                <replace from="%EXTRA" to="qt.gui.QLineEdit.EchoMode echo, java.lang.String text"/>
+                <replace from="%FUNCTION_NAME" to="getText"/>
+                <replace from="%CALL" to="echo, text"/>
+            </insert-template>
+
+        public static java.lang.String getText(qt.gui.QWidget parent, java.lang.String title, java.lang.String label, qt.gui.QLineEdit.EchoMode echo) {
+            return getText(parent, title, label, echo, "");
+        }
+
+        public static java.lang.String getText(qt.gui.QWidget parent, java.lang.String title, java.lang.String label) {
+            return getText(parent, title, label, qt.gui.QLineEdit.EchoMode.Normal);
+        }
+        </inject-code>
+    </object-type>
+
+    <object-type name="QGraphicsScene">
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QGraphicsScene___" quote-before-line="}// class"/>
+        </inject-code>
+
+        <modify-function signature="addEllipse(const QRectF &amp;, const QPen &amp;, const QBrush &amp;)" remove="all" />
+        <modify-function signature="addEllipse(double, double, double, double, const QPen &amp;, const QBrush &amp;)" remove="all" />
+        <modify-function signature="addLine(const QLineF &amp;, const QPen &amp;)" remove="all" />
+        <modify-function signature="addLine(double, double, double, double, const QPen &amp;)" remove="all" />
+        <modify-function signature="addPath(const QPainterPath &amp;, const QPen &amp;, const QBrush &amp;)" remove="all" />
+        <modify-function signature="addPixmap(const QPixmap &amp;)" remove="all" />
+        <modify-function signature="addPolygon(const QPolygonF &amp;, const QPen &amp;, const QBrush &amp;)" remove="all" />
+        <modify-function signature="addRect(const QRectF &amp;, const QPen &amp;, const QBrush &amp;)" remove="all" />
+        <modify-function signature="addRect(double, double, double, double, const QPen &amp;, const QBrush &amp;)" remove="all" />
+        <modify-function signature="addSimpleText(const QString &amp;, const QFont &amp;)" remove="all" />
+        <modify-function signature="addText(const QString &amp;, const QFont &amp;)" remove="all" />
+
+        <modify-function signature="drawItems(QPainter*,int,QGraphicsItem**,const QStyleOptionGraphicsItem*,QWidget*)">
+            <modify-argument index="2">
+                <remove-argument/>
+                <conversion-rule class="shell">
+                    // nothing
+                </conversion-rule>
+                <conversion-rule class="native">
+                    <insert-template name="core.get_array_length">
+                        <replace from="%ARRAY" to="%3"/>
+                    </insert-template>
+                    int __length = %out;
+                </conversion-rule>
+
+            </modify-argument>
+
+            <modify-argument index="3">
+                <replace-type modified-type="qt.gui.QGraphicsItemInterface[]"/>
+                <conversion-rule class="shell">
+                    <insert-template name="gui.convert_graphicsitem_array_to_java">
+                        <replace from="%LENGTH" to="%2"/>
+                    </insert-template>
+                    jobjectArray graphicsItemArrayHolder = %out;
+                </conversion-rule>
+                <conversion-rule class="native">
+                    <insert-template name="gui.convert_graphicsitem_array_from_java"/>
+                </conversion-rule>
+            </modify-argument>
+
+            <modify-argument index="return">
+                <conversion-rule class="shell">
+                    qtjambi_invalidate_array(__jni_env, styleOptionArrayHolder);
+                    qtjambi_invalidate_array(__jni_env, graphicsItemArrayHolder);
+                </conversion-rule>
+            </modify-argument>
+
+            <modify-argument index="4">
+                <replace-type modified-type="qt.gui.QStyleOptionGraphicsItem[]"/>
+                <conversion-rule class="shell">
+                    <insert-template name="gui.convert_styleoptiongraphicsitem_array_to_java">
+                        <replace from="%LENGTH" to="%2"/>
+                    </insert-template>
+                    jobjectArray styleOptionArrayHolder = %out;
+                </conversion-rule>
+                <conversion-rule class="native">
+                    <insert-template name="gui.convert_styleoptiongraphicsitem_array_from_java"/>
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+    </object-type>
+
+
+    <object-type name="QWidget">
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QWidget___" quote-before-line="}// class"/>
+        </inject-code>
+        <modify-function signature="setWindowTitle(const QString &amp;)">
+            <inject-code class="java">
+                <argument-map index="1" meta-name="%1"/>
+            if (this instanceof QMessageBox) {
+                qt.GeneratorUtilities.threadCheck(this);
+                if (nativeId() == 0)
+                    throw new QNoNativeResourcesException("Function call on incomplete object of type: " +getClass().getName());
+                __qt_QMessageBox_setWindowTitle(nativeId(), %1);
+                return ;
+            }
+            </inject-code>
+        </modify-function>
+
+
+        <modify-function signature="setWindowModality(Qt::WindowModality)">
+            <inject-code class="java">
+                <argument-map index="1" meta-name="%1"/>
+            if (this instanceof QMessageBox) {
+                qt.GeneratorUtilities.threadCheck(this);
+                if (nativeId() == 0)
+                    throw new QNoNativeResourcesException("Function call on incomplete object of type: " +getClass().getName());
+                __qt_QMessageBox_setWindowModality(nativeId(), %1.value());
+                return ;
+            }
+            </inject-code>
+        </modify-function>
+
+
+
+
+    </object-type>
+
+    <object-type name="QAbstractSpinBox">
+        <inject-code>
+            <insert-template name="gui.init_style_option">
+                <replace from="%TYPE" to="QStyleOptionSpinBox"/>
+                <replace from="final" to=""/>
+            </insert-template>
+        </inject-code>
+
+        <modify-function signature="fixup(QString&amp;)const">
+            <modify-argument index="1">
+                <replace-type modified-type="java.lang.String"/>
+                <conversion-rule class="shell">
+                    jobject %out = (jobject) qtjambi_from_qstring(__jni_env, %in);
+                </conversion-rule>
+                <conversion-rule class="native">
+                    QString %out = qtjambi_to_qstring(__jni_env, (jstring) %in);
+                    QString *__qt_converted = &amp;%out;
+                </conversion-rule>
+            </modify-argument>
+
+            <modify-argument index="0">
+                <replace-type modified-type="java.lang.String"/>
+                <conversion-rule class="native">
+                    jobject %out = (jobject) qtjambi_from_qstring(__jni_env, *__qt_converted);
+                </conversion-rule>
+                <conversion-rule class="shell">
+                    %1 = qtjambi_to_qstring(__jni_env, (jstring) %in);
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="validate(QString&amp;,int&amp;)const">
+            <modify-argument index="1">
+                <replace-type modified-type="qt.gui.QValidator$QValidationData"/>
+                <conversion-rule class="shell">
+                    <insert-template name="gui.convert_validationdata_to_java">
+                        <replace from="%STRING" to="%1"/>
+                        <replace from="%POS" to="%2"/>
+                    </insert-template>
+                </conversion-rule>
+                <conversion-rule class="native">
+                    <insert-template name="gui.convert_validationdata_to_string"/>
+                </conversion-rule>
+            </modify-argument>
+
+            <modify-argument index="2">
+                <remove-argument/>
+                <conversion-rule class="shell">
+                    // nothing needed
+                </conversion-rule>
+                <conversion-rule class="native">
+                    <insert-template name="gui.convert_validationdata_to_pos">
+                        <replace from="%VALIDATIONDATA" to="%1"/>
+                    </insert-template>
+                </conversion-rule>
+            </modify-argument>
+
+            <modify-argument index="0">
+                <conversion-rule class="native">
+                    <insert-template name="gui.cleanup_validationdata_from_java"/>
+                    jint %out = %in;
+                </conversion-rule>
+                <conversion-rule class="shell">
+                    <insert-template name="gui.cleanup_validationdata_to_java">
+                        <replace from="%STRING" to="%1"/>
+                        <replace from="%POS" to="%2"/>
+                    </insert-template>
+                    QValidator::State %out = (QValidator::State) qtjambi_to_enumerator(__jni_env, %in);
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+    </object-type>
+
+    <object-type name="QDateTimeEdit">
+        <inject-code>
+            <insert-template name="gui.init_style_option">
+                <replace from="%TYPE" to="QStyleOptionSpinBox"/>
+                <replace from="initStyleOption" to="initDateTimeEditStyleOption"/>
+            </insert-template>
+        </inject-code>
+    </object-type>
+
+    <object-type name="QSortFilterProxyModel">
+        <modify-function signature="match(QModelIndex, int, QVariant, int, QFlags&lt;Qt::MatchFlag&gt;) const">
+            <modify-argument index="5">
+                <replace-default-expression with="Qt.MatchFlag.MatchStartsWith, Qt.MatchFlag.MatchWrap"/>
+            </modify-argument>
+        </modify-function>
+    </object-type>
+
+    <object-type name="QSlider">
+        <inject-code>
+            <insert-template name="gui.init_style_option">
+                <replace from="%TYPE" to="QStyleOptionSlider"/>
+            </insert-template>
+        </inject-code>
+    </object-type>
+
+    <object-type name="QLabel">
+        <extra-includes>
+            <include file-name="qt.QNativePointer" location="java"/>
+        </extra-includes>
+
+        <inject-code>
+            <insert-template name="gui.getter_returning_nativepointer">
+                <replace from="%RETURN_TYPE" to="QPicture"/>
+                <replace from="%FUNCTION_NAME" to="picture"/>
+            </insert-template>
+        </inject-code>
+        <inject-code>
+            <insert-template name="gui.getter_returning_nativepointer">
+                <replace from="%RETURN_TYPE" to="QPixmap"/>
+                <replace from="%FUNCTION_NAME" to="pixmap"/>
+            </insert-template>
+        </inject-code>
+    </object-type>
+
+
+    <object-type name="QFileDialog">
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QFileDialog___" quote-before-line="}// class"/>
+        </inject-code>
+        <extra-includes>
+            <include file-name="qt.QNativePointer" location="java"/>
+        </extra-includes>
+
+        <template name="gui.filedialog_get_xxx_filename">
+        public static %TYPE %FUNCTION_NAME(QWidget parent, String caption, String dir, Filter filter, Options options) {
+            QNativePointer np = filter != null ? new QNativePointer(QNativePointer.Type.String) : null;
+            %TYPE returned = %FUNCTION_NAME(parent, caption, dir, filter != null ? filter.filter : "", np, options);
+            if (filter != null)
+                filter.selectedFilter = np.stringValue();
+            return returned;
+        }
+
+        public static %TYPE %FUNCTION_NAME(QWidget parent, String caption, String dir, Filter filter, Option ... options) {
+            QNativePointer np = filter != null ? new QNativePointer(QNativePointer.Type.String) : null;
+            %TYPE returned = %FUNCTION_NAME(parent, caption, dir, filter != null ? filter.filter : "", np, options);
+            if (filter != null)
+                filter.selectedFilter = np.stringValue();
+            return returned;
+        }
+
+        public static %TYPE %FUNCTION_NAME(QWidget parent, String caption, String dir, Filter filter) {
+            return %FUNCTION_NAME(parent, caption, dir, filter, new Options(0));
+        }
+
+        public static %TYPE %FUNCTION_NAME(QWidget parent, String caption, String dir) {
+            return %FUNCTION_NAME(parent, caption, dir, null);
+        }
+
+        public static %TYPE %FUNCTION_NAME(QWidget parent, String caption) {
+            return %FUNCTION_NAME(parent, caption, "");
+        }
+
+        public static %TYPE %FUNCTION_NAME(QWidget parent) {
+            return %FUNCTION_NAME(parent, "");
+        }
+
+        public static %TYPE %FUNCTION_NAME() {
+            return %FUNCTION_NAME(null);
+        }
+
+        </template>
+        <inject-code>
+            <insert-template name="gui.filedialog_get_xxx_filename">
+                <replace from="%FUNCTION_NAME" to="getOpenFileName"/>
+                <replace from="%TYPE" to="String"/>
+            </insert-template>
+        </inject-code>
+        <inject-code>
+            <insert-template name="gui.filedialog_get_xxx_filename">
+                <replace from="%FUNCTION_NAME" to="getOpenFileNames"/>
+                <replace from="%TYPE" to="java.util.List&lt;String&gt;"/>
+            </insert-template>
+        </inject-code>
+        <inject-code>
+            <insert-template name="gui.filedialog_get_xxx_filename">
+                <replace from="%FUNCTION_NAME" to="getSaveFileName"/>
+                <replace from="%TYPE" to="String"/>
+            </insert-template>
+        </inject-code>
+    </object-type>
+
+
+    <object-type name="QTabBar">
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QTabBar___" quote-before-line="}// class"/>
+        </inject-code>
+
+    </object-type>
+
+    <object-type name="QRadioButton">
+        <inject-code>
+            <insert-template name="gui.init_style_option">
+                <replace from="%TYPE" to="QStyleOptionButton"/>
+            </insert-template>
+        </inject-code>
+    </object-type>
+
+    <object-type name="QScrollBar">
+        <inject-code>
+            <insert-template name="gui.init_style_option">
+                <replace from="%TYPE" to="QStyleOptionSlider"/>
+            </insert-template>
+        </inject-code>
+    </object-type>
+
+
+    <object-type name="QClipboard">
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QClipboard___" quote-before-line="}// class"/>
+        </inject-code>
+        <extra-includes>
+            <include file-name="qt.QNativePointer" location="java"/>
+        </extra-includes>
+
+    </object-type>
+
+
+    <object-type name="QAbstractScrollArea">
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QAbstractScrollArea___" quote-before-line="}// class"/>
+        </inject-code>
+
+    </object-type>
+
+    <object-type name="QRubberBand">
+        <inject-code>
+            <insert-template name="gui.init_style_option">
+                <replace from="%TYPE" to="QStyleOptionRubberBand"/>
+            </insert-template>
+        </inject-code>
+    </object-type>
+
+
+    <object-type name="QTextDocument">
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QTextDocument___" quote-before-line="}// class"/>
+        </inject-code>
+
+    </object-type>
+
+
+    <object-type name="QSplitter">
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QSplitter___" quote-before-line="}// class"/>
+        </inject-code>
+        <extra-includes>
+            <include file-name="qt.QNativePointer" location="java"/>
+        </extra-includes>
+
+    </object-type>
+
+    <object-type name="QGroupBox">
+        <inject-code>
+            <insert-template name="gui.init_style_option">
+                <replace from="%TYPE" to="QStyleOptionGroupBox"/>
+            </insert-template>
+        </inject-code>
+    </object-type>
+
+    <object-type name="QDial">
+        <inject-code>
+            <insert-template name="gui.init_style_option">
+                <replace from="%TYPE" to="QStyleOptionSlider"/>
+            </insert-template>
+        </inject-code>
+    </object-type>
+
+    <object-type name="QLineEdit">
+        <inject-code>
+            <insert-template name="gui.init_style_option">
+                <replace from="%TYPE" to="QStyleOptionFrame"/>
+            </insert-template>
+        </inject-code>
+    </object-type>
+
+    <object-type name="QToolBar">
+        <inject-code>
+            <insert-template name="gui.init_style_option">
+                <replace from="%TYPE" to="QStyleOptionToolBar"/>
+            </insert-template>
+        </inject-code>
+        <inject-code>
+            <insert-template name="gui.addAction">
+                <replace from="%POST_CALL" to=""/>
+                <replace from=" %END_EXTRA" to=""/>
+                <replace from=" %END_CALL_EXTRA" to=""/>
+                <replace from="%EXTRA" to="QIcon icon,"/>
+                <replace from="%CALL_EXTRA" to="icon,"/>
+            </insert-template>
+        </inject-code>
+        <inject-code>
+            <insert-template name="gui.addAction">
+                <replace from="%POST_CALL" to=""/>
+                <replace from=" %END_EXTRA" to=""/>
+                <replace from=" %END_CALL_EXTRA" to=""/>
+                <replace from="%EXTRA " to=""/>
+                <replace from="%CALL_EXTRA " to=""/>
+            </insert-template>
+        </inject-code>
+    </object-type>
+
+    <object-type name="QPaintEngine">
+        <modify-function signature="drawLines(const QLine *, int)">
+            <modify-argument index="1">
+                <replace-type modified-type="qt.gui.QLine[]"/>
+                <conversion-rule class="shell">
+                jobjectArray %out = qtjambi_from_array(__jni_env, %in, %2,
+                                                       "QLine", "com/trolltech/qt/gui/");
+                </conversion-rule>
+                <conversion-rule class="native">
+                QVarLengthArray&lt;QLine, 32&gt; __lines;
+                int __size = %1 == 0 ? 0 : __jni_env-&gt;GetArrayLength((jarray) %1);
+                for (int i=0; i&lt;__size; ++i)
+                    __lines.append(*(QLine *)qtjambi_to_object(__jni_env, __jni_env-&gt;GetObjectArrayElement((jobjectArray) %in, i)));
+                const QLine *%out = %1 == 0 ? 0 : __lines.constData();
+                </conversion-rule>
+
+            </modify-argument>
+            <modify-argument index="2">
+                <remove-argument/>
+                <conversion-rule class="shell">
+                /* nothing */
+                </conversion-rule>
+                <conversion-rule class="native">
+                int %out = %1 == 0 ? 0 : __jni_env-&gt;GetArrayLength((jarray) %1);
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="drawLines(const QLineF *, int)">
+            <modify-argument index="1">
+                <replace-type modified-type="qt.gui.QLineF[]"/>
+                <conversion-rule class="shell">
+                jobjectArray %out = qtjambi_from_array(__jni_env, %in, %2,
+                                                       "QLineF", "com/trolltech/qt/gui/");
+                </conversion-rule>
+                <conversion-rule class="native">
+                QVarLengthArray&lt;QLineF, 32&gt; __data;
+                int __size = %1 == 0 ? 0 : __jni_env-&gt;GetArrayLength((jarray) %1);
+                for (int i=0; i&lt;__size; ++i)
+                    __data.append(*(QLineF *)qtjambi_to_object(__jni_env, __jni_env-&gt;GetObjectArrayElement((jobjectArray) %in, i)));
+                const QLineF *%out = %1 == 0 ? 0 : __data.constData();
+                </conversion-rule>
+            </modify-argument>
+            <modify-argument index="2">
+                <remove-argument/>
+                <conversion-rule class="shell">
+                /* nothing */
+                </conversion-rule>
+                <conversion-rule class="native">
+                int %out = %1 == 0 ? 0 : __jni_env-&gt;GetArrayLength((jarray) %1);
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="drawRects(const QRectF *, int)">
+            <modify-argument index="1">
+                <replace-type modified-type="qt.core.QRectF[]"/>
+                <conversion-rule class="shell">
+                jobjectArray %out = qtjambi_from_array(__jni_env, %in, %2,
+                                                       "QRectF", "com/trolltech/qt/core/");
+                </conversion-rule>
+                <conversion-rule class="native">
+                QVarLengthArray&lt;QRectF, 32&gt; __data;
+                int __size = %1 == 0 ? 0 : __jni_env-&gt;GetArrayLength((jarray) %1);
+                for (int i=0; i&lt;__size; ++i)
+                    __data.append(*(QRectF *)qtjambi_to_object(__jni_env, __jni_env-&gt;GetObjectArrayElement((jobjectArray) %in, i)));
+                const QRectF *%out = %1 == 0 ? 0 : __data.constData();
+                </conversion-rule>
+            </modify-argument>
+            <modify-argument index="2">
+                <remove-argument/>
+                <conversion-rule class="shell">
+                /* nothing */
+                </conversion-rule>
+                <conversion-rule class="native">
+                int %out = %1 == 0 ? 0 : __jni_env-&gt;GetArrayLength((jarray) %1);
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="drawRects(const QRect *, int)">
+            <modify-argument index="1">
+                <replace-type modified-type="qt.core.QRect[]"/>
+                <conversion-rule class="shell">
+                jobjectArray %out = qtjambi_from_array(__jni_env, %in, %2,
+                                                       "QRect", "com/trolltech/qt/core/");
+                </conversion-rule>
+                <conversion-rule class="native">
+                QVarLengthArray&lt;QRect, 32&gt; __data;
+                int __size = %1 == 0 ? 0 : __jni_env-&gt;GetArrayLength((jarray) %1);
+                for (int i=0; i&lt;__size; ++i)
+                    __data.append(*(QRect *)qtjambi_to_object(__jni_env, __jni_env-&gt;GetObjectArrayElement((jobjectArray) %in, i)));
+                const QRect *%out = %1 == 0 ? 0 : __data.constData();
+                </conversion-rule>
+            </modify-argument>
+            <modify-argument index="2">
+                <remove-argument/>
+                <conversion-rule class="shell">
+                /* nothing */
+                </conversion-rule>
+                <conversion-rule class="native">
+                int %out = %1 == 0 ? 0 : __jni_env-&gt;GetArrayLength((jarray) %1);
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="drawPoints(const QPoint *, int)">
+            <modify-argument index="1">
+                <replace-type modified-type="qt.core.QPoint[]"/>
+                <conversion-rule class="shell">
+                jobjectArray %out = qtjambi_from_array(__jni_env, %in, %2,
+                                                       "QPoint", "com/trolltech/qt/core/");
+                </conversion-rule>
+                <conversion-rule class="native">
+                QVarLengthArray&lt;QPoint, 32&gt; __data;
+                int __size = %1 == 0 ? 0 : __jni_env-&gt;GetArrayLength((jarray) %1);
+                for (int i=0; i&lt;__size; ++i)
+                    __data.append(*(QPoint *)qtjambi_to_object(__jni_env, __jni_env-&gt;GetObjectArrayElement((jobjectArray) %in, i)));
+                const QPoint *%out = %1 == 0 ? 0 : __data.constData();
+                </conversion-rule>
+            </modify-argument>
+
+            <modify-argument index="2">
+                <remove-argument/>
+                <conversion-rule class="shell">
+                /* nothing */
+                </conversion-rule>
+                <conversion-rule class="native">
+                int %out = %1 == 0 ? 0 : __jni_env-&gt;GetArrayLength((jarray) %1);
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="drawPoints(const QPointF *, int)">
+            <modify-argument index="1">
+                <replace-type modified-type="qt.core.QPointF[]"/>
+                <conversion-rule class="shell">
+                jobjectArray %out = qtjambi_from_array(__jni_env, %in, %2,
+                                                       "QPointF", "com/trolltech/qt/core/");
+                </conversion-rule>
+                <conversion-rule class="native">
+                QVarLengthArray&lt;QPointF, 32&gt; __data;
+                int __size = %1 == 0 ? 0 : __jni_env-&gt;GetArrayLength((jarray) %1);
+                for (int i=0; i&lt;__size; ++i)
+                    __data.append(*(QPointF *)qtjambi_to_object(__jni_env, __jni_env-&gt;GetObjectArrayElement((jobjectArray) %in, i)));
+                const QPointF *%out = %1 == 0 ? 0 : __data.constData();
+                </conversion-rule>
+            </modify-argument>
+            <modify-argument index="2">
+                <remove-argument/>
+                <conversion-rule class="shell">
+                /* nothing */
+                </conversion-rule>
+                <conversion-rule class="native">
+                int %out = %1 == 0 ? 0 : __jni_env-&gt;GetArrayLength((jarray) %1);
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="drawPolygon(const QPoint *, int, QPaintEngine::PolygonDrawMode)">
+            <modify-argument index="1">
+                <replace-type modified-type="qt.core.QPoint[]"/>
+                <conversion-rule class="shell">
+                jobjectArray %out = qtjambi_from_array(__jni_env, %in, %2,
+                                                       "QPoint", "com/trolltech/qt/core/");
+                </conversion-rule>
+                <conversion-rule class="native">
+                QVarLengthArray&lt;QPoint, 32&gt; __data;
+                int __size = %1 == 0 ? 0 : __jni_env-&gt;GetArrayLength((jarray) %1);
+                for (int i=0; i&lt;__size; ++i)
+                    __data.append(*(QPoint *)qtjambi_to_object(__jni_env, __jni_env-&gt;GetObjectArrayElement((jobjectArray) %in, i)));
+                const QPoint *%out = %1 == 0 ? 0 : __data.constData();
+                </conversion-rule>
+            </modify-argument>
+            <modify-argument index="2">
+                <remove-argument/>
+                <conversion-rule class="shell">
+                /* nothing */
+                </conversion-rule>
+                <conversion-rule class="native">
+                int %out = %1 == 0 ? 0 : __jni_env-&gt;GetArrayLength((jarray) %1);
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="drawPolygon(const QPointF *, int, QPaintEngine::PolygonDrawMode)">
+            <modify-argument index="1">
+                <replace-type modified-type="qt.core.QPointF[]"/>
+                <conversion-rule class="shell">
+                jobjectArray %out = qtjambi_from_array(__jni_env, %in, %2,
+                                                       "QPointF", "com/trolltech/qt/core/");
+                </conversion-rule>
+                <conversion-rule class="native">
+                QVarLengthArray&lt;QPointF, 32&gt; __data;
+                int __size = %1 == 0 ? 0 : __jni_env-&gt;GetArrayLength((jarray) %1);
+                for (int i=0; i&lt;__size; ++i)
+                    __data.append(*(QPointF *)qtjambi_to_object(__jni_env, __jni_env-&gt;GetObjectArrayElement((jobjectArray) %in, i)));
+                const QPointF *%out = %1 == 0 ? 0 : __data.constData();
+                </conversion-rule>
+            </modify-argument>
+            <modify-argument index="2">
+                <remove-argument/>
+                <conversion-rule class="shell">
+                /* nothing */
+                </conversion-rule>
+                <conversion-rule class="native">
+                int %out = %1 == 0 ? 0 : __jni_env-&gt;GetArrayLength((jarray) %1);
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+    </object-type>
+
+    <object-type name="QGuiSignalMapper">
+        <modify-function signature="setMapping(QObject*,QWidget*)">
+            <modify-argument index="1">
+                <reference-count action="add" declare-variable="qt.core.QSignalMapper" variable-name="__rcMappings"/>
+            </modify-argument>
+            <inject-code class="java" position="end">
+                <argument-map index="1" meta-name="%1"/>
+                <argument-map index="2" meta-name="%2"/>
+                java.util.Hashtable&lt;qt.core.QObject, Object&gt; __rcWidgetForObject = (java.util.Hashtable&lt;qt.core.QObject, Object&gt;) qt.GeneratorUtilities.fetchField(this, qt.core.QSignalMapper.class, "__rcWidgetForObject");
+                if (%2 == null)
+                    __rcWidgetForObject.remove(%1);
+                else
+                    __rcWidgetForObject.put(%1,%2);
+            </inject-code>
+        </modify-function>
+    </object-type>
+
+
+    <object-type name="QAction">
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QAction___" quote-before-line="}// class"/>
+        </inject-code>
+
+        <modify-function signature="setActionGroup(QActionGroup*)">
+            <modify-argument index="1">
+                <reference-count action="ignore"/>
+            </modify-argument>
+            <inject-code position="end">
+                <argument-map index="1" meta-name="%1"/>
+            java.util.Collection&lt;Object&gt; __rcTmp = null;
+            if (__rcActionGroup != null) {
+                __rcTmp = (java.util.Collection&lt;Object&gt;)qt.GeneratorUtilities.fetchField(__rcActionGroup, QActionGroup.class, "__rcActions");
+                while (__rcTmp.contains(this))
+                    __rcTmp.remove(this);
+            }
+            __rcActionGroup = %1;
+            if (__rcActionGroup != null) {
+                __rcTmp = (java.util.Collection&lt;Object&gt;)qt.GeneratorUtilities.fetchField(__rcActionGroup, QActionGroup.class, "__rcActions");
+                __rcTmp.add(this);
+            }
+            </inject-code>
+        </modify-function>
+    </object-type>
+
+
+    <object-type name="QPainter">
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QPainter___" quote-before-line="}// class"/>
+        </inject-code>
+
+    <inject-code class="destructor-function">
+      if (((QPainter *) ptr)->isActive()) {
+          qWarning("QPainter: trying to delete an active painter, "
+                       "did you forget to call \"end()\"?\n");
+              return;
+          }
+        </inject-code>
+
+        <template name="gui.painter_draw_text_general">
+        public final void drawText(%RECT_ARGUMENTS, int flags, String text, %RECT_TYPE boundingRect) {
+            drawText(%RECT_CALL_ARGUMENTS, flags, text, boundingRect == null ? null : boundingRect.nativePointer());
+        }
+
+        public final void drawText(%RECT_ARGUMENTS, int flags, String text) {
+            drawText(%RECT_CALL_ARGUMENTS, flags, text, (%RECT_TYPE) null);
+        }
+        </template>
+
+        <template name="gui.painter_draw_text_qrect">
+            <insert-template name="gui.painter_draw_text_general">
+                <replace from="%RECT_ARGUMENTS" to="%RECT_TYPE rectangle"/>
+                <replace from="%RECT_CALL_ARGUMENTS" to="rectangle"/>
+            </insert-template>
+        </template>
+        <inject-code>
+            <insert-template name="gui.painter_draw_text_qrect">
+                <replace from="%RECT_TYPE" to="qt.core.QRect"/>
+            </insert-template>
+        </inject-code>
+        <inject-code>
+            <insert-template name="gui.painter_draw_text_qrect">
+                <replace from="%RECT_TYPE" to="qt.core.QRectF"/>
+            </insert-template>
+        </inject-code>
+        <inject-code>
+            <insert-template name="gui.painter_draw_text_general">
+                <replace from="%RECT_TYPE" to="qt.core.QRect"/>
+                <replace from="%RECT_ARGUMENTS" to="int x, int y, int width, int height"/>
+                <replace from="%RECT_CALL_ARGUMENTS" to="x, y, width, height"/>
+            </insert-template>
+        </inject-code>
+
+
+        <modify-function signature="setRedirected(const QPaintDevice*, QPaintDevice*, const QPoint &amp;)">
+            <modify-argument index="1">
+                <reference-count action="ignore"/>
+            </modify-argument>
+            <modify-argument index="2">
+                <reference-count action="ignore"/>
+            </modify-argument>
+            <inject-code position="end">
+                <argument-map index="1" meta-name="%1"/>
+                <argument-map index="2" meta-name="%2"/>
+            __rcRedirections.push(%1);
+            __rcRedirections.push(%2);
+            </inject-code>
+        </modify-function>
+        <modify-function signature="restoreRedirected(const QPaintDevice*)">
+            <inject-code position="end">
+            if (!__rcRedirections.empty()) __rcRedirections.pop();
+            if (!__rcRedirections.empty()) __rcRedirections.pop();
+            </inject-code>
+        </modify-function>
+    </object-type>
+
+    <object-type name="QApplication">
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QApplication___" quote-before-line="}// class"/>
+        </inject-code>
+        <extra-includes>
+            <include file-name="qt.QNativePointer" location="java"/>
+        </extra-includes>
+<!--        <modify-function signature="QApplication(int &amp;, char  **, int)">
+            <inject-code class="shell">
+                qtjambi_register_variant_handler();
+            </inject-code> -->
+        </modify-function>
+        <template name="gui.application_char_pointer_function">
+        public static %RETURN_TYPE %FUNCTION_NAME(%PRE_ARGUMENTS %COMMA QByteArray className) {
+            return %FUNCTION_NAME(%PRE_CALL_ARGUMENTS %COMMA className == null ? null : className.data());
+        }
+        </template>
+    </object-type>
+
+    <object-type name="QFormLayout">
+        <modify-function signature="getLayoutPosition(QLayout*,int*,QFormLayout::ItemRole*)const" access="private"/>
+        <modify-function signature="getWidgetPosition(QWidget*,int*,QFormLayout::ItemRole*)const" access="private"/>
+        <modify-function signature="getItemPosition(int,int*,QFormLayout::ItemRole*)const" access="private"/>
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QFormLayout___" quote-before-line="}// class"/>
+        </inject-code>
+    </object-type>
+
+    <interface-type name="QGraphicsLayoutItem">
+        <modify-function signature="getContentsMargins(double*,double*,double*,double*)const" access="private" />
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class Subclass_of_QGraphicsLayoutItem___" quote-before-line="}// class"/>
+        </inject-code>
+        <inject-code class="interface">
+            public QMarginsF getContentsMargins();
+        </inject-code>
+    </interface-type>
+    <object-type name="QGraphicsLayout">
+        <modify-function signature="getContentsMargins(double*,double*,double*,double*)const" access="private" />
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class Subclass_of_QGraphicsLayoutItem___" quote-before-line="}// class"/>
+        </inject-code>
+    </object-type>
+    <object-type name="QGraphicsProxyWidget">
+    <modify-function signature="setWidget(QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore" />
+        </modify-argument>
+        <inject-code>
+            <argument-map index="1" meta-name="%1" />
+            if (%1 != null)
+                %1.disableGarbageCollection();
+            else if (widget() != null)
+                widget().reenableGarbageCollection();
+        </inject-code>
+    </modify-function>
+    </object-type>
+    <object-type name="QGraphicsWidget">
+        <modify-function signature="getContentsMargins(double*,double*,double*,double*)const" access="private" />
+        <modify-function signature="getWindowFrameMargins(double*,double*,double*,double*)const" access="private"/>
+
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QGraphicsWidget___" quote-before-line="}// class"/>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class Subclass_of_QGraphicsLayoutItem___" quote-before-line="}// class"/>
+        </inject-code>
+
+        <modify-function signature="initStyleOption(QStyleOption*)const">
+            <modify-argument index="1">
+                <replace-type modified-type="qt.gui.QStyleOption" />
+                <conversion-rule class="shell">
+                    jobject %out = qtjambi_from_object(__jni_env, %in, "QStyleOption", "com/trolltech/qt/gui/", "Lcom_trolltech_qt_gui_QStyleOption_2", false);
+                    jobject __tmp = %out;
+                </conversion-rule>
+                <conversion-rule class="native">
+                    QStyleOption *%out = (QStyleOption *) qtjambi_to_object(__jni_env, %in);
+                </conversion-rule>
+            </modify-argument>
+            <modify-argument index="return">
+                <conversion-rule class="shell">
+                    // Make sure the java object is not usable after this, since
+                    // the QStyleOption* may be deleted at any time.
+                    qtjambi_invalidate_object(__jni_env, __tmp);
+                    __tmp = 0;
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="paintWindowFrame(QPainter*,const QStyleOptionGraphicsItem*,QWidget*)">
+            <modify-argument index="2">
+                <conversion-rule class="shell">
+                    jobject %out = qtjambi_from_object(__jni_env, %in, "QStyleOptionGraphicsItem", "com/trolltech/qt/gui/", "Lcom_trolltech_qt_gui_QStyleOption_2", true);
+                </conversion-rule>
+                <conversion-rule class="native">
+                    const QStyleOptionGraphicsItem *%out = (QStyleOptionGraphicsItem *) qtjambi_to_object(__jni_env, %in);
+                </conversion-rule>
+                <replace-type modified-type="qt.gui.QStyleOptionGraphicsItem"/>
+            </modify-argument>
+        </modify-function>
+
+    </object-type>
+
+    <object-type name="QPrinter">
+        <modify-function signature="getPageMargins(double*,double*,double*,double*,QPrinter::Unit)const" access="private" />
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QPrinter___" quote-before-line="}// class"/>
+        </inject-code>
+    </object-type>
+
+    <object-type name="QStyledItemDelegate">
+        <modify-function signature="initStyleOption(QStyleOptionViewItem*,QModelIndex)const">
+            <modify-argument index="1">
+                <conversion-rule class="shell">
+                    jobject %out = qtjambi_from_object(__jni_env, %in, "QStyleOptionViewItem", "com/trolltech/qt/gui/", "Lcom_trolltech_qt_gui_QStyleOption_2", false);
+                </conversion-rule>
+                <conversion-rule class="native">
+                    QStyleOptionViewItem *%out = (QStyleOptionViewItem *) qtjambi_to_object(__jni_env, %in);
+                </conversion-rule>
+                <replace-type modified-type="qt.gui.QStyleOptionViewItem" />
+            </modify-argument>
+        </modify-function>
+    </object-type>
+
+    <object-type name="QListWidget">
+        <modify-function signature="addItem(const QString &amp;)" remove="all" />
+        <modify-function signature="addItems(const QStringList&lt;QString&gt; &amp;)" remove="all" />
+        <modify-function signature="insertItem(int, const QString &amp;)" remove="all" />
+        <modify-function signature="insertItems(int, const QStringList&lt;QString&gt; &amp;)" remove="all" />
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QListWidget___" quote-before-line="}// class" />
+        </inject-code>
+    </object-type>
+
+    <interface-type name="QPictureFormatInterface">
+        <modify-function signature="loadPicture(QString,QString,QPicture*)">
+            <modify-argument index="3">
+                <replace-type modified-type="qt.gui.QPicture" />
+                <conversion-rule class="shell">
+                    jobject %out = qtjambi_from_object(__jni_env, %in, "QPicture", "com/trolltech/qt/gui/", false);
+                    jobject __tmp = %out;
+                </conversion-rule>
+                <conversion-rule class="native">
+                    QPicture *%out = (QPicture *) qtjambi_to_object(__jni_env, %in);
+                </conversion-rule>
+            </modify-argument>
+            <modify-argument index="return">
+                <conversion-rule class="shell">
+                    // Make sure the java object is not usable after this, since
+                    // the QPicture* may be deleted at any time.
+                    qtjambi_invalidate_object(__jni_env, __tmp);
+                    __tmp = 0;
+                    bool %out = (bool) %in;
+                </conversion-rule>
+                <conversion-rule class="native">
+                    jboolean %out = (jboolean) %in;
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+    </interface-type>
+
+    <suppress-warning text="WARNING(JavaGenerator) :: either add or remove specified for reference count variable '__rcItems' in 'qt.gui.QGraphicsGridLayout' but not both" />
+
+</typesystem>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/typesystem_gui.xml	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,7981 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<typesystem package="qt.gui" default-superclass="QtDObject">
+<inject-code>
+        qt.Utilities.loadQtLibrary("QtGui");
+    </inject-code>
+<template name="gui.getter_returning_nativepointer">
+        public final %RETURN_TYPE %FUNCTION_NAME() {
+            QNativePointer np = %FUNCTION_NAME_private();
+            %RETURN_TYPE tmp = np == null ? null : %RETURN_TYPE.fromNativePointer(np);
+            return tmp == null ? null : new %RETURN_TYPE(tmp);
+        }
+
+    </template>
+<template name="gui.init_style_option">
+        protected final void initStyleOption(%TYPE option) {
+            initStyleOption(option.nativePointer());
+        }
+    </template>
+<template name="gui.convert_validationdata_to_java">
+        StaticCache *sc = StaticCache::instance();
+        sc-&gt;resolveValidationData();
+        jstring __qt_converted_input = qtjambi_from_qstring(__jni_env, %STRING);
+        jobject %out = __jni_env-&gt;NewObject(sc-&gt;ValidationData.class_ref, sc-&gt;ValidationData.constructor, __qt_converted_input, %POS);
+        jobject __java_validation_data = %out;
+    </template>
+<template name="gui.cleanup_validationdata_from_java">
+        __jni_env-&gt;SetIntField(%1, sc-&gt;ValidationData.position, *__position_ptr);
+        __jni_env-&gt;SetObjectField(%1, sc-&gt;ValidationData.string, qtjambi_from_qstring(__jni_env, *__string_ptr));
+    </template>
+<template name="gui.convert_validationdata_to_string">
+        StaticCache *sc = StaticCache::instance();
+        sc-&gt;resolveValidationData();
+        jstring __java_string = (jstring) __jni_env-&gt;GetObjectField(%in, sc-&gt;ValidationData.string);
+        QString %out = __java_string == 0 ? QString() : qtjambi_to_qstring(__jni_env, __java_string);
+        QString *__string_ptr = &amp;%out;
+    </template>
+<template name="gui.convert_validationdata_to_pos">
+        int %out = __jni_env-&gt;GetIntField(%1, sc-&gt;ValidationData.position);
+        int *__position_ptr = &amp;%out;
+    </template>
+<template name="gui.cleanup_validationdata_to_java">
+        jstring __java_string = (jstring) __jni_env-&gt;GetObjectField(__java_validation_data, sc-&gt;ValidationData.string);
+        %STRING = __java_string == 0 ? QString() : qtjambi_to_qstring(__jni_env, __java_string);
+        %POS = __jni_env-&gt;GetIntField(__java_validation_data, sc-&gt;ValidationData.position);
+    </template>
+<template name="gui.convert_object_array_to_java">
+        jobjectArray %out = 0;
+
+        {
+            jclass __resolved_class = resolveClass(__jni_env, "%CLASSNAME_ARRAY", "%PACKAGE_ARRAY");
+            QTJAMBI_EXCEPTION_CHECK(__jni_env);
+            Q_ASSERT(__resolved_class != 0);
+
+            %out = %in == 0 ? 0 : __jni_env-&gt;NewObjectArray(%LENGTH, __resolved_class, 0);
+            QTJAMBI_EXCEPTION_CHECK(__jni_env);
+            if (%out != 0) {
+                for (int i=0; i&lt;%LENGTH; ++i) {
+                    __jni_env-&gt;SetObjectArrayElement(%out, i, qtjambi_from_object(__jni_env, %REFERENCE %in[i], "%CLASSNAME", "%PACKAGE", %LOOKUP true));
+                }
+            }
+       }
+    </template>
+<template name="gui.convert_graphicsitem_array_to_java">
+        <insert-template name="gui.convert_object_array_to_java">
+            <replace from="%CLASSNAME_ARRAY" to="QGraphicsItemInterface"/>
+            <replace from="%PACKAGE_ARRAY" to="com/trolltech/qt/gui/"/>
+            <replace from="%CLASSNAME" to="QGraphicsItem$ConcreteWrapper"/>
+            <replace from="%PACKAGE" to="com/trolltech/qt/gui/"/>
+            <replace from="%LOOKUP" to=""/>
+            <replace from="%REFERENCE" to=""/>
+        </insert-template>
+    </template>
+<template name="gui.convert_styleoptiongraphicsitem_array_to_java">
+        <insert-template name="gui.convert_object_array_to_java">
+            <replace from="%CLASSNAME_ARRAY" to="QStyleOptionGraphicsItem"/>
+            <replace from="%PACKAGE_ARRAY" to="com/trolltech/qt/gui/"/>
+            <replace from="%CLASSNAME" to="QStyleOptionGraphicsItem"/>
+            <replace from="%PACKAGE" to="com/trolltech/qt/gui/"/>
+            <replace from="%LOOKUP" to="&quot;Lcom_trolltech_qt_gui_QStyleOption_2&quot;,"/>
+            <replace from="%REFERENCE" to="&amp;"/>
+        </insert-template>
+    </template>
+<template name="gui.convert_interface_array_from_java">
+        %CLASSNAME *%out = 0;
+        QVarLengthArray&lt;%CLASSNAME, 256&gt; __interfaceArray(__length);
+        if (%in != 0) {
+            for (int i=0; i&lt;__length; ++i) {
+                __interfaceArray[i] = (%CLASSNAME) %CONVERSION_FUNCTION(__jni_env, __jni_env-&gt;GetObjectArrayElement((jobjectArray) %in, i) %EXTRA);
+            }
+        }
+        %out = %in == 0 ? 0 : __interfaceArray.data();
+    </template>
+<template name="gui.convert_object_array_from_java">
+        %CLASSNAME *%out = 0;
+        QVarLengthArray&lt;%CLASSNAME, 256&gt; __array(__length);
+        if (%in != 0) {
+            for (int i=0; i&lt;__length; ++i) {
+                __array[i] = *(%CLASSNAME *) %CONVERSION_FUNCTION(__jni_env, __jni_env-&gt;GetObjectArrayElement((jobjectArray) %in, i) %EXTRA);
+            }
+        }
+        %out = %in == 0 ? 0 : __array.data();
+    </template>
+<template name="gui.convert_graphicsitem_array_from_java">
+        <insert-template name="gui.convert_interface_array_from_java">
+            <replace from="%CLASSNAME" to="QGraphicsItem *"/>
+            <replace from="%EXTRA" to=", &quot;QGraphicsItemInterface&quot;, &quot;com/trolltech/qt/gui/&quot;, &quot;__qt_cast_to_QGraphicsItem&quot;"/>
+            <replace from="%CONVERSION_FUNCTION" to="qtjambi_to_interface"/>
+        </insert-template>
+    </template>
+<template name="gui.convert_styleoptiongraphicsitem_array_from_java">
+        <insert-template name="gui.convert_object_array_from_java">
+            <replace from="%CLASSNAME" to="QStyleOptionGraphicsItem"/>
+            <replace from="%EXTRA" to=""/>
+            <replace from="%CONVERSION_FUNCTION" to="qtjambi_to_object"/>
+        </insert-template>
+    </template>
+<template name="gui::qstyleoption_from_object">
+        jobject %out = qtjambi_from_object(__jni_env, %in, "QStyleOption", "com/trolltech/qt/gui/", "Lcom_trolltech_qt_gui_QStyleOption_2", true);
+    </template>
+<template name="gui::qstyleoptioncomplex_from_object">
+        jobject %out = qtjambi_from_object(__jni_env, %in, "QStyleOptionComplex", "com/trolltech/qt/gui/", "Lcom_trolltech_qt_gui_QStyleOption_2", true);
+    </template>
+<template name="gui::qstyleoption_to_object">
+        QStyleOption *%out = (QStyleOption *) qtjambi_to_object(__jni_env, %in);
+    </template>
+<template name="gui.inputDialog_get_input">
+    public static %RETURN_TYPE %FUNCTION_NAME(qt.gui.QWidget parent, java.lang.String title, java.lang.String label, %EXTRA, qt.core.Qt.WindowFlags f) {
+        qt.QNativePointer ok = new qt.QNativePointer(qt.QNativePointer.Type.Boolean);
+        %RETURN_TYPE result = %FUNCTION_NAME_internal(parent, title, label, %CALL, ok, f);
+        return ok.booleanValue() ? result : null;
+    }
+
+    public static %RETURN_TYPE %FUNCTION_NAME(qt.gui.QWidget parent, java.lang.String title, java.lang.String label, %EXTRA, qt.core.Qt.WindowType ... f) {
+        qt.QNativePointer ok = new qt.QNativePointer(qt.QNativePointer.Type.Boolean);
+        %RETURN_TYPE result = %FUNCTION_NAME_internal(parent, title, label, %CALL, ok, f);
+        return ok.booleanValue() ? result : null;
+    }
+
+    public static %RETURN_TYPE %FUNCTION_NAME(qt.gui.QWidget parent, java.lang.String title, java.lang.String label, %EXTRA) {
+        return %FUNCTION_NAME(parent, title, label, %CALL, qt.core.Qt.WindowType.Widget);
+    }
+
+    </template>
+<suppress-warning text="WARNING(JavaGenerator) :: either add or remove specified for reference count variable '__rcItems' in 'qt.gui.QGraphicsGridLayout' but not both"/>
+
+  <rejection class="*" function-name="d_func"/>
+
+  <rejection class="*" field-name="d_ptr"/>
+  <rejection class="*" field-name="d"/>
+
+  <rejection class="QWindowsCEStyle"/>
+  <rejection class="QWindowsMobileStyle"/>
+  <rejection class="QAbstractUndoItem"/>
+  <rejection class="QAccessibleApplication"/>
+  <rejection class="QBrushData"/>
+  <rejection class="QImageTextKeyLang"/>
+  <rejection class="QItemEditorCreator"/>
+  <rejection class="QLibrary"/>
+  <rejection class="QLinkedList"/>
+  <rejection class="QLinkedListData"/>
+  <rejection class="QLinkedListIterator"/>
+  <rejection class="QLinkedListNode"/>
+  <rejection class="QMimeSource"/>
+  <rejection class="QPainterPathPrivate"/>
+  <rejection class="QRegionData"/>
+  <rejection class="QStandardItemEditorCreator"/>
+  <rejection class="QStyleOptionQ3DockWindow"/>
+  <rejection class="QStyleOptionQ3ListView"/>
+  <rejection class="QStyleOptionQ3ListViewItem"/>
+  <rejection class="QTextFrameLayoutData"/>
+  <rejection class="QUpdateLaterEvent"/>
+  <rejection class="QVFbHeader"/>
+  <rejection class="QWidgetData"/>
+  <rejection class="QWindowSurface"/>
+  <rejection class="QWindowsXPStyle"/>
+  <rejection class="QWindowsVistaStyle"/>
+  <rejection class="QWSEmbedWidget"/>
+  <rejection class="QRegion::QRegionData"/>
+  <rejection class="JObject_key"/>
+  <rejection class="QAccessibleEditableTextInterface"/>
+  <rejection class="QAccessibleSimpleEditableTextInterface"/>
+  <rejection class="QAccessibleTextInterface"/>
+  <rejection class="QAccessibleValueInterface"/>
+  <rejection class="QIconEngineFactoryInterface"/>
+  <rejection class="QIconEnginePlugin"/>
+  <rejection class="QWidgetItemV2"/>
+  <rejection class="QAbstractItemDelegate" function-name="operator="/>
+  <rejection class="QAccessible" function-name="installFactory"/>
+  <rejection class="QAccessible" function-name="installRootObjectHandler"/>
+  <rejection class="QAccessible" function-name="installUpdateHandler"/>
+  <rejection class="QAccessible" function-name="removeFactory"/>
+  <rejection class="QApplication" function-name="compressEvent"/>
+  <rejection class="QBrush" function-name="cleanUp"/>
+  <rejection class="QPictureIO" function-name="defineIOHandler"/>
+  <rejection class="QPolygon" function-name="putPoints"/>
+  <rejection class="QPolygon" function-name="setPoints"/>
+  <rejection class="QPolygon" function-name="setPoint"/>
+  <rejection class="QPolygon" function-name="points"/>
+  <rejection class="QPolygon" function-name="point"/>
+  <rejection class="QPrinter" function-name="printerSelectionOption"/>
+  <rejection class="QPrinter" function-name="setPrinterSelectionOption"/>
+  <rejection class="QWidget" function-name="create"/>
+  <rejection class="QWidget" function-name="find"/>
+  <rejection class="QWidget" function-name="handle"/>
+  <rejection class="QWidget" function-name="styleChange"/>
+  <rejection class="QWidget" function-name="internalWinId"/>
+  <rejection class="QActionGroup" function-name="selected"/>
+  <rejection class="QPaintEngine" function-name="fix_neg_rect"/>
+  <rejection class="QTreeModel" function-name="node"/>
+  <rejection class="QTreeModel" function-name="initializeNode"/>
+  <rejection class="QTreeModel" function-name="queryChildren"/>
+  <rejection class="QAccessible" function-name="cast_helper"/>
+  <rejection class="QAccessible2"/>
+  <rejection class="QAccessibleInterface" function-name="backgroundColor"/>
+  <rejection class="QAccessibleInterface" function-name="foregroundColor"/>
+  <rejection class="QAccessibleInterface" function-name="textInterface"/>
+  <rejection class="QAccessibleInterface" function-name="valueInterface"/>
+  <rejection class="QAccessibleInterface" function-name="tableInterface"/>
+  <rejection class="QAccessibleInterface" function-name="editableTextInterface"/>
+  <rejection class="QAccessibleInterface" function-name="cast_helper"/>
+  <rejection class="QAccessibleInterfaceEx" function-name="interface_cast"/>
+  <rejection class="QAccessibleBridgePlugin"/>
+  <rejection class="QAccessibleBridgeFactoryInterface"/>
+  <rejection class="QTabletEvent" field-name="mExtra"/>
+  <rejection class="QWidgetItem" field-name="wid"/>
+  <rejection class="QFont" enum-name="ResolveProperties"/>
+
+  <enum-type name="QAbstractItemDelegate::EndEditHint"/>
+  <enum-type name="QAbstractItemView::CursorAction"/>
+  <enum-type name="QAbstractItemView::DragDropMode"/>
+  <enum-type name="QAbstractItemView::DropIndicatorPosition"/>
+  <enum-type name="QAbstractItemView::EditTrigger" flags="QAbstractItemView::EditTriggers"/>
+  <enum-type name="QAbstractItemView::ScrollHint"/>
+  <enum-type name="QAbstractItemView::ScrollMode"/>
+  <enum-type name="QAbstractItemView::SelectionBehavior"/>
+  <enum-type name="QAbstractItemView::SelectionMode"/>
+  <enum-type name="QAbstractItemView::State"/>
+  <enum-type name="QAbstractPrintDialog::PrintDialogOption" flags="QAbstractPrintDialog::PrintDialogOptions"/>
+  <enum-type name="QAbstractPrintDialog::PrintRange"/>
+  <enum-type name="QAbstractSlider::SliderAction"/>
+  <enum-type name="QAbstractSlider::SliderChange"/>
+  <enum-type name="QAbstractSpinBox::ButtonSymbols"/>
+  <enum-type name="QAbstractSpinBox::CorrectionMode"/>
+  <enum-type name="QAbstractSpinBox::StepEnabledFlag" flags="QAbstractSpinBox::StepEnabled"/>
+  <enum-type name="QAccessible::Event"/>
+  <enum-type name="QAccessible::Method"/>
+  <enum-type name="QAccessible::RelationFlag" flags="QAccessible::Relation"/>
+  <enum-type name="QAccessible::Role"/>
+  <enum-type name="QAccessible::StateFlag" flags="QAccessible::State"/>
+  <enum-type name="QAccessible::Text"/>
+  <enum-type name="QDesktopServices::StandardLocation"/>
+  <enum-type name="QDirModel::Roles"/>
+  <enum-type name="QFont::Capitalization"/>
+  <enum-type name="QFont::SpacingType"/>
+  <enum-type name="QGraphicsItem::CacheMode"/>
+  <enum-type name="QMdiArea::AreaOption" flags="QMdiArea::AreaOptions"/>
+  <enum-type name="QMdiArea::WindowOrder"/>
+  <enum-type name="QMdiArea::ViewMode"/>
+  <enum-type name="QFileSystemModel::Roles"/>
+  <enum-type name="QFormLayout::FieldGrowthPolicy"/>
+  <enum-type name="QFormLayout::FormStyle"/>
+  <enum-type name="QFormLayout::ItemRole"/>
+  <enum-type name="QFormLayout::RowWrapPolicy"/>
+  <enum-type name="QGraphicsProxyWidget::enum_1"/>
+  <enum-type name="QGraphicsWidget::enum_1"/>
+  <enum-type name="QPlainTextEdit::LineWrapMode"/>
+  <enum-type name="QPrintPreviewWidget::ViewMode"/>
+  <enum-type name="QPrintPreviewWidget::ZoomMode"/>
+  <enum-type name="QStyleOptionViewItemV4::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionViewItemV4::ViewItemPosition"/>
+
+  <enum-type name="QMdiSubWindow::SubWindowOption" flags="QMdiSubWindow::SubWindowOptions"/>
+
+  <enum-type name="QAction::ActionEvent"/>
+  <enum-type name="QAction::MenuRole"/>
+  <enum-type name="QApplication::ColorSpec"/>
+  <enum-type name="QApplication::Type"/>
+  <enum-type name="QCalendarWidget::HorizontalHeaderFormat"/>
+  <enum-type name="QCalendarWidget::SelectionMode"/>
+  <enum-type name="QCalendarWidget::VerticalHeaderFormat"/>
+  <enum-type name="QColor::Spec"/>
+  <enum-type name="QColormap::Mode"/>
+  <enum-type name="QComboBox::InsertPolicy"/>
+  <enum-type name="QComboBox::SizeAdjustPolicy"/>
+  <enum-type name="QCompleter::CompletionMode"/>
+  <enum-type name="QCompleter::ModelSorting"/>
+  <enum-type name="QContextMenuEvent::Reason"/>
+  <enum-type name="QDataWidgetMapper::SubmitPolicy"/>
+  <enum-type name="QDateTimeEdit::Section" flags="QDateTimeEdit::Sections"/>
+  <enum-type name="QDialog::DialogCode"/>
+  <enum-type name="QDialogButtonBox::ButtonLayout"/>
+  <enum-type name="QDialogButtonBox::ButtonRole"/>
+  <enum-type name="QFileDialog::AcceptMode"/>
+  <enum-type name="QFileDialog::DialogLabel"/>
+  <enum-type name="QFileDialog::FileMode"/>
+  <enum-type name="QFileDialog::Option" flags="QFileDialog::Options"/>
+  <enum-type name="QFileDialog::ViewMode"/>
+  <enum-type name="QFileIconProvider::IconType"/>
+  <enum-type name="QFont::Stretch"/>
+  <enum-type name="QFont::Style"/>
+  <enum-type name="QFont::StyleStrategy"/>
+  <enum-type name="QFont::Weight"/>
+  <enum-type name="QFontComboBox::FontFilter" flags="QFontComboBox::FontFilters"/>
+  <enum-type name="QFrame::Shadow" extensible="yes"/>
+  <enum-type name="QFrame::Shape"/>
+  <enum-type name="QFrame::StyleMask"/>
+  <enum-type name="QGradient::CoordinateMode"/>
+  <enum-type name="QGradient::Spread" lower-bound="QGradient.PadSpread" upper-bound="QGradient.RepeatSpread"/>
+  <enum-type name="QGradient::Type"/>
+  <enum-type name="QGraphicsEllipseItem::enum_1"/>
+  <enum-type name="QGraphicsItem::Extension"/>
+  <enum-type name="QGraphicsItem::GraphicsItemChange"/>
+  <enum-type name="QGraphicsItem::GraphicsItemFlag" flags="QGraphicsItem::GraphicsItemFlags"/>
+  <enum-type name="QGraphicsItem::enum_1"/>
+  <enum-type name="QGraphicsItemGroup::enum_1"/>
+  <enum-type name="QGraphicsLineItem::enum_1"/>
+  <enum-type name="QGraphicsPathItem::enum_1"/>
+  <enum-type name="QGraphicsPixmapItem::ShapeMode"/>
+  <enum-type name="QGraphicsPixmapItem::enum_1"/>
+  <enum-type name="QGraphicsPolygonItem::enum_1"/>
+  <enum-type name="QGraphicsRectItem::enum_1"/>
+  <enum-type name="QGraphicsScene::ItemIndexMethod"/>
+  <enum-type name="QGraphicsSceneContextMenuEvent::Reason"/>
+  <enum-type name="QGraphicsSimpleTextItem::enum_1"/>
+  <enum-type name="QGraphicsTextItem::enum_1"/>
+  <enum-type name="QGraphicsView::CacheModeFlag" flags="QGraphicsView::CacheMode"/>
+  <enum-type name="QGraphicsView::DragMode"/>
+  <enum-type name="QGraphicsView::OptimizationFlag" flags="QGraphicsView::OptimizationFlags"/>
+  <enum-type name="QGraphicsView::ViewportAnchor"/>
+  <enum-type name="QGraphicsView::ViewportUpdateMode"/>
+  <enum-type name="QIcon::Mode"/>
+  <enum-type name="QIcon::State"/>
+  <enum-type name="QImage::Format"/>
+  <enum-type name="QImage::InvertMode"/>
+  <enum-type name="QImageIOHandler::ImageOption"/>
+  <enum-type name="QImageReader::ImageReaderError"/>
+  <enum-type name="QImageWriter::ImageWriterError"/>
+  <enum-type name="QInputContext::StandardFormat"/>
+  <enum-type name="QInputMethodEvent::AttributeType"/>
+  <enum-type name="QItemSelectionModel::SelectionFlag" flags="QItemSelectionModel::SelectionFlags"/>
+  <enum-type name="QKeySequence::SequenceFormat"/>
+  <enum-type name="QKeySequence::SequenceMatch"/>
+  <enum-type name="QKeySequence::StandardKey"/>
+  <enum-type name="QLCDNumber::Mode"/>
+  <enum-type name="QLCDNumber::SegmentStyle"/>
+  <enum-type name="QLayout::SizeConstraint"/>
+  <enum-type name="QLineEdit::EchoMode"/>
+  <enum-type name="QLineF::IntersectType"/>
+  <enum-type name="QListView::Flow"/>
+  <enum-type name="QListView::LayoutMode"/>
+  <enum-type name="QListView::Movement"/>
+  <enum-type name="QListView::ResizeMode"/>
+  <enum-type name="QListView::ViewMode"/>
+  <enum-type name="QListWidgetItem::ItemType"/>
+  <enum-type name="QMainWindow::DockOption" flags="QMainWindow::DockOptions"/>
+  <enum-type name="QMessageBox::ButtonRole"/>
+  <enum-type name="QMessageBox::Icon"/>
+  <enum-type name="QMovie::CacheMode"/>
+  <enum-type name="QMovie::MovieState"/>
+  <enum-type name="QPaintDevice::PaintDeviceMetric"/>
+  <enum-type name="QPaintEngine::DirtyFlag" flags="QPaintEngine::DirtyFlags"/>
+  <enum-type name="QPaintEngine::PaintEngineFeature" flags="QPaintEngine::PaintEngineFeatures"/>
+  <enum-type name="QPaintEngine::PolygonDrawMode"/>
+  <enum-type name="QPaintEngine::Type"/>
+  <enum-type name="QPageSetupDialog::PageSetupDialogOption" flags="QPageSetupDialog::PageSetupDialogOptions"/>
+  <enum-type name="QPainter::CompositionMode"/>
+  <enum-type name="QPainter::RenderHint" flags="QPainter::RenderHints"/>
+  <enum-type name="QPainterPath::ElementType"/>
+  <enum-type name="QPrintEngine::PrintEnginePropertyKey">
+    <reject-enum-value name="PPK_PaperSize"/>
+  </enum-type>
+  <enum-type name="QPrinter::ColorMode"/>
+  <enum-type name="QPrinter::Orientation"/>
+  <enum-type name="QPrinter::OutputFormat"/>
+  <enum-type name="QPrinter::PageOrder"/>
+  <enum-type name="QPrinter::PaperSource"/>
+  <enum-type name="QPrinter::PrintRange"/>
+  <enum-type name="QPrinter::PrinterMode"/>
+  <enum-type name="QPrinter::PrinterState"/>
+  <enum-type name="QPrinter::Unit"/>
+  <enum-type name="QPrinter::DuplexMode"/>
+  <enum-type name="QProgressBar::Direction"/>
+  <enum-type name="QRegion::RegionType"/>
+  <enum-type name="QRubberBand::Shape"/>
+  <enum-type name="QSessionManager::RestartHint"/>
+  <enum-type name="QSizePolicy::Policy"/>
+  <enum-type name="QSizePolicy::PolicyFlag"/>
+  <enum-type name="QSizePolicy::ControlType" flags="QSizePolicy::ControlTypes"/>
+  <enum-type name="QStandardItem::ItemType"/>
+  <enum-type name="QStyle::SubControl" flags="QStyle::SubControls" extensible="yes" force-integer="yes"/>
+  <enum-type name="QStyle::ComplexControl" extensible="yes"/>
+  <enum-type name="QStyle::ContentsType" extensible="yes"/>
+  <enum-type name="QStyle::ControlElement" extensible="yes"/>
+  <enum-type name="QStyle::PixelMetric" extensible="yes">
+    <reject-enum-value name="PM_MDIFrameWidth"/>
+    <reject-enum-value name="PM_MDIMinimizedWidth"/>
+  </enum-type>
+  <enum-type name="QStyle::PrimitiveElement" extensible="yes">
+    <reject-enum-value name="PE_IndicatorItemViewItemCheck"/>
+    <reject-enum-value name="PE_FrameStatusBarItem"/>
+  </enum-type>
+  <enum-type name="QStyle::StandardPixmap" extensible="yes"/>
+  <enum-type name="QStyle::StateFlag" flags="QStyle::State"/>
+  <enum-type name="QStyle::SubElement" extensible="yes">
+    <reject-enum-value name="SE_ItemViewItemCheckIndicator"/>
+  </enum-type>
+  <enum-type name="QStyleHintReturn::HintReturnType"/>
+  <enum-type name="QStyleHintReturn::StyleOptionType"/>
+  <enum-type name="QStyleHintReturn::StyleOptionVersion"/>
+  <enum-type name="QStyleHintReturnVariant::StyleOptionType"/>
+  <enum-type name="QStyleHintReturnVariant::StyleOptionVersion"/>
+
+  <enum-type name="QStyleHintReturnMask::StyleOptionType"/>
+  <enum-type name="QStyleHintReturnMask::StyleOptionVersion"/>
+  <enum-type name="QStyleOption::StyleOptionType"/>
+  <enum-type name="QStyleOption::OptionType" extensible="yes"/>
+  <enum-type name="QStyleOption::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionButton::ButtonFeature" flags="QStyleOptionButton::ButtonFeatures"/>
+  <enum-type name="QStyleOptionButton::StyleOptionType"/>
+  <enum-type name="QStyleOptionButton::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionComboBox::StyleOptionType"/>
+  <enum-type name="QStyleOptionComboBox::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionComplex::StyleOptionType"/>
+  <enum-type name="QStyleOptionComplex::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionDockWidget::StyleOptionType"/>
+  <enum-type name="QStyleOptionDockWidget::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionDockWidgetV2::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionFocusRect::StyleOptionType"/>
+  <enum-type name="QStyleOptionFocusRect::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionFrame::StyleOptionType"/>
+  <enum-type name="QStyleOptionFrame::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionFrameV2::FrameFeature" flags="QStyleOptionFrameV2::FrameFeatures"/>
+  <enum-type name="QStyleOptionFrameV2::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionGraphicsItem::StyleOptionType"/>
+  <enum-type name="QStyleOptionGraphicsItem::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionGroupBox::StyleOptionType"/>
+  <enum-type name="QStyleOptionGroupBox::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionHeader::SectionPosition"/>
+  <enum-type name="QStyleOptionHeader::SelectedPosition"/>
+  <enum-type name="QStyleOptionHeader::SortIndicator"/>
+  <enum-type name="QStyleOptionHeader::StyleOptionType"/>
+  <enum-type name="QStyleOptionHeader::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionMenuItem::CheckType"/>
+  <enum-type name="QStyleOptionMenuItem::MenuItemType"/>
+  <enum-type name="QStyleOptionMenuItem::StyleOptionType"/>
+  <enum-type name="QStyleOptionMenuItem::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionProgressBar::StyleOptionType"/>
+  <enum-type name="QStyleOptionProgressBar::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionProgressBarV2::StyleOptionType"/>
+  <enum-type name="QStyleOptionProgressBarV2::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionRubberBand::StyleOptionType"/>
+  <enum-type name="QStyleOptionRubberBand::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionSizeGrip::StyleOptionType"/>
+  <enum-type name="QStyleOptionSizeGrip::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionSlider::StyleOptionType"/>
+  <enum-type name="QStyleOptionSlider::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionSpinBox::StyleOptionType"/>
+  <enum-type name="QStyleOptionSpinBox::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionTab::CornerWidget" flags="QStyleOptionTab::CornerWidgets"/>
+  <enum-type name="QStyleOptionTab::SelectedPosition"/>
+  <enum-type name="QStyleOptionTab::StyleOptionType"/>
+  <enum-type name="QStyleOptionTab::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionTab::TabPosition"/>
+  <enum-type name="QStyleOptionTabBarBase::StyleOptionType"/>
+  <enum-type name="QStyleOptionTabBarBase::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionTabV2::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionTabWidgetFrame::StyleOptionType"/>
+  <enum-type name="QStyleOptionTabWidgetFrame::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionTitleBar::StyleOptionType"/>
+  <enum-type name="QStyleOptionTitleBar::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionToolBar::StyleOptionType"/>
+  <enum-type name="QStyleOptionToolBar::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionToolBar::ToolBarFeature" flags="QStyleOptionToolBar::ToolBarFeatures"/>
+  <enum-type name="QStyleOptionToolBar::ToolBarPosition"/>
+  <enum-type name="QStyleOptionToolBox::StyleOptionType"/>
+  <enum-type name="QStyleOptionToolBox::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionToolButton::StyleOptionType"/>
+  <enum-type name="QStyleOptionToolButton::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionToolButton::ToolButtonFeature" flags="QStyleOptionToolButton::ToolButtonFeatures">
+    <reject-enum-value name="MenuButtonPopup"/>
+  </enum-type>
+  <enum-type name="QStyleOptionViewItem::Position"/>
+  <enum-type name="QStyleOptionViewItem::StyleOptionType"/>
+  <enum-type name="QStyleOptionViewItem::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionViewItemV2::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionViewItemV2::ViewItemFeature" flags="QStyleOptionViewItemV2::ViewItemFeatures"/>
+  <enum-type name="QSystemTrayIcon::ActivationReason"/>
+  <enum-type name="QSystemTrayIcon::MessageIcon"/>
+  <enum-type name="QTabBar::Shape"/>
+  <enum-type name="QTabWidget::TabPosition"/>
+  <enum-type name="QTabWidget::TabShape"/>
+  <enum-type name="QTableWidgetItem::ItemType"/>
+  <enum-type name="QTabletEvent::PointerType"/>
+  <enum-type name="QTabletEvent::TabletDevice"/>
+  <enum-type name="QTextCharFormat::UnderlineStyle"/>
+  <enum-type name="QTextCharFormat::VerticalAlignment"/>
+  <enum-type name="QTextCursor::MoveMode"/>
+  <enum-type name="QTextCursor::MoveOperation"/>
+  <enum-type name="QTextCursor::SelectionType"/>
+  <enum-type name="QTextDocument::FindFlag" flags="QTextDocument::FindFlags"/>
+  <enum-type name="QTextDocument::MetaInformation"/>
+  <enum-type name="QTextDocument::ResourceType"/>
+  <enum-type name="QTextEdit::AutoFormattingFlag" flags="QTextEdit::AutoFormatting"/>
+  <enum-type name="QTextEdit::LineWrapMode"/>
+  <enum-type name="QTextFormat::ObjectTypes"/>
+  <enum-type name="QTextFormat::PageBreakFlag" flags="QTextFormat::PageBreakFlags"/>
+  <enum-type name="QTextFrameFormat::Position"/>
+  <enum-type name="QTextFrameFormat::BorderStyle"/>
+  <enum-type name="QTextItem::RenderFlag" flags="QTextItem::RenderFlags"/>
+  <enum-type name="QTextLayout::CursorMode"/>
+  <enum-type name="QTextLength::Type"/>
+  <enum-type name="QTextLine::CursorPosition"/>
+  <enum-type name="QTextLine::Edge"/>
+  <enum-type name="QTextListFormat::Style"/>
+  <enum-type name="QTextOption::Flag" flags="QTextOption::Flags"/>
+  <enum-type name="QTextOption::WrapMode"/>
+  <enum-type name="QTextOption::TabType"/>
+  <enum-type name="QToolButton::ToolButtonPopupMode"/>
+  <enum-type name="QTreeWidgetItem::ItemType"/>
+  <enum-type name="QTreeWidgetItemIterator::IteratorFlag" flags="QTreeWidgetItemIterator::IteratorFlags"/>
+  <enum-type name="QValidator::State"/>
+  <enum-type name="QWidget::RenderFlag" flags="QWidget::RenderFlags"/>
+  <enum-type name="QWorkspace::WindowOrder"/>
+  <enum-type name="QDoubleValidator::Notation"/>
+  <enum-type name="QGraphicsScene::SceneLayer" flags="QGraphicsScene::SceneLayers"/>
+  <enum-type name="QStyleOptionToolBoxV2::SelectedPosition"/>
+  <enum-type name="QStyleOptionToolBoxV2::StyleOptionVersion"/>
+  <enum-type name="QStyleOptionToolBoxV2::TabPosition"/>
+  <enum-type name="QStyleOptionViewItemV3::StyleOptionVersion"/>
+  <enum-type name="QTransform::TransformationType"/>
+  <enum-type name="QTreeWidgetItem::ChildIndicatorPolicy"/>
+  <enum-type name="QWizard::WizardOption" flags="QWizard::WizardOptions"/>
+  <enum-type name="QWizard::WizardPixmap"/>
+  <enum-type name="QWizard::WizardStyle"/>
+  <enum-type name="QImageIOPlugin::Capability" flags="QImageIOPlugin::Capabilities"/>
+  <enum-type name="QStackedLayout::StackingMode"/>
+
+  <enum-type name="QWizard::WizardButton">
+    <reject-enum-value name="NStandardButtons"/>
+    <reject-enum-value name="NButtons"/>
+  </enum-type>
+
+  <enum-type name="QAccessible::Action">
+    <reject-enum-value name="FirstStandardAction"/>
+    <reject-enum-value name="LastStandardAction"/>
+  </enum-type>
+
+  <enum-type name="QBoxLayout::Direction">
+    <reject-enum-value name="Down"/>
+    <reject-enum-value name="Up"/>
+  </enum-type>
+
+
+  <enum-type name="QClipboard::Mode">
+    <reject-enum-value name="LastMode"/>
+  </enum-type>
+
+  <enum-type name="QDialogButtonBox::StandardButton" flags="QDialogButtonBox::StandardButtons">
+    <reject-enum-value name="FirstButton"/>
+    <reject-enum-value name="LastButton"/>
+    <reject-enum-value name="YesAll"/>
+    <reject-enum-value name="NoAll"/>
+    <reject-enum-value name="Default"/>
+    <reject-enum-value name="Escape"/>
+    <reject-enum-value name="FlagMask"/>
+    <reject-enum-value name="ButtonMask"/>
+  </enum-type>
+
+  <enum-type name="QDockWidget::DockWidgetFeature" flags="QDockWidget::DockWidgetFeatures"/>
+
+  <enum-type name="QFont::StyleHint">
+    <reject-enum-value name="SansSerif"/>
+    <reject-enum-value name="Serif"/>
+    <reject-enum-value name="TypeWriter"/>
+    <reject-enum-value name="Decorative"/>
+  </enum-type>
+
+  <enum-type name="QFontDatabase::WritingSystem">
+    <reject-enum-value name="Other"/>
+  </enum-type>
+
+  <enum-type name="QHeaderView::ResizeMode">
+    <reject-enum-value name="Custom"/>
+  </enum-type>
+
+
+  <enum-type name="QMessageBox::StandardButton" flags="QMessageBox::StandardButtons">
+    <reject-enum-value name="FirstButton"/>
+    <reject-enum-value name="LastButton"/>
+    <reject-enum-value name="YesAll"/>
+    <reject-enum-value name="NoAll"/>
+  </enum-type>
+
+  <enum-type name="QPalette::ColorGroup">
+    <reject-enum-value name="Normal"/>
+  </enum-type>
+
+  <enum-type name="QPalette::ColorRole">
+    <reject-enum-value name="NColorRoles"/>
+    <reject-enum-value name="Foreground"/>
+    <reject-enum-value name="Background"/>
+  </enum-type>
+
+  <enum-type name="QPrinter::PageSize">
+    <reject-enum-value name="NPageSize"/>
+    <reject-enum-value name="NPaperSize"/>
+  </enum-type>
+
+  <enum-type name="QSlider::TickPosition">
+<!--    <reject-enum-value name="TicksLeft"/>
+    <reject-enum-value name="TicksRight"/>-->
+  </enum-type>
+
+  <enum-type name="QStyle::StyleHint" extensible="yes">
+    <reject-enum-value name="SH_ScrollBar_StopMouseOverSlider"/>
+  </enum-type>
+
+
+  <enum-type name="QTextFormat::FormatType"/>
+
+  <enum-type name="QTextFormat::Property">
+    <reject-enum-value name="FontSizeIncrement"/>
+    <reject-enum-value name="FirstFontProperty"/>
+    <reject-enum-value name="LastFontProperty"/>
+  </enum-type>
+
+  <value-type name="QTransform">
+    <modify-function signature="operator=(QTransform)" remove="all"/>
+    <modify-function signature="map(int,int,int*,int*)const" remove="all"/>
+    <modify-function signature="map(double,double,double*,double*)const" remove="all"/>
+
+    <modify-function signature="operator*=(double)" access="private"/>
+    <modify-function signature="operator+=(double)" access="private"/>
+    <modify-function signature="operator-=(double)" access="private"/>
+    <modify-function signature="operator/=(double)" access="private"/>
+    <modify-function signature="operator*(QTransform)const" rename="multiplied"/>
+    <modify-function signature="operator*=(QTransform)" access="private"/>
+  
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QTransform___" quote-before-line="}// class"/>
+        </inject-code>
+
+        <modify-function signature="inverted(bool*)const">
+            <access modifier="private"/>
+            <modify-argument index="1">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="rotate(double,Qt::Axis)">
+            <modify-argument index="1">
+                <remove-default-expression/>
+            </modify-argument>
+            <access modifier="private"/>
+            <rename to="rotate_private"/>
+        </modify-function>
+        <inject-code>
+    /**
+     * Rotates the transformation around the given axis.
+     *
+     * @return The rotated transformation.
+     */
+        <insert-template name="core.private_function_return_self">
+            <replace from="%RETURN_TYPE" to="QTransform"/>
+            <replace from="%FUNCTION_NAME" to="rotate"/>
+            <replace from="%ARGUMENTS" to="double angle, Qt.Axis axis"/>
+            <replace from="%ARGUMENT_NAMES" to="angle, axis"/>
+        </insert-template>
+
+    /**
+     * Rotates the transformation around the z-axis.
+     *
+     * @return The rotated transformation.
+     */
+        <insert-template name="core.private_function_return_self">
+            <replace from="%RETURN_TYPE" to="QTransform"/>
+            <replace from="%FUNCTION_NAME" to="rotate"/>
+            <replace from="%ARGUMENTS" to="double angle"/>
+            <replace from="%ARGUMENT_NAMES" to="angle"/>
+        </insert-template>
+        </inject-code>
+
+        <modify-function signature="rotateRadians(double,Qt::Axis)">
+        <modify-argument index="1">
+            <remove-default-expression/>
+        </modify-argument>
+        <access modifier="private"/>
+        <rename to="rotateRadians_private"/>
+    </modify-function>
+    <inject-code>
+    /**
+     * Rotates the transformation around the given axis.
+     *
+     * @return The rotated transformation.
+     */
+        <insert-template name="core.private_function_return_self">
+            <replace from="%RETURN_TYPE" to="QTransform"/>
+            <replace from="%FUNCTION_NAME" to="rotateRadians"/>
+            <replace from="%ARGUMENTS" to="double angle, Qt.Axis axis"/>
+            <replace from="%ARGUMENT_NAMES" to="angle, axis"/>
+        </insert-template>
+
+    /**
+     * Rotates the transformation around the z-axis.
+     *
+     * @return The rotated transformation.
+     */
+        <insert-template name="core.private_function_return_self">
+            <replace from="%RETURN_TYPE" to="QTransform"/>
+            <replace from="%FUNCTION_NAME" to="rotateRadians"/>
+            <replace from="%ARGUMENTS" to="double angle"/>
+            <replace from="%ARGUMENT_NAMES" to="angle"/>
+        </insert-template>
+    </inject-code>
+
+    <modify-function signature="scale(double,double)">
+        <access modifier="private"/>
+        <rename to="scale_private"/>
+    </modify-function>
+    <inject-code>
+    /**
+     * Scales the transformation using x and y.
+     *
+     * @return The scaled transformation.
+     */
+        <insert-template name="core.private_function_return_self">
+            <replace from="%RETURN_TYPE" to="QTransform"/>
+            <replace from="%FUNCTION_NAME" to="scale"/>
+            <replace from="%ARGUMENTS" to="double x, double y"/>
+            <replace from="%ARGUMENT_NAMES" to="x, y"/>
+        </insert-template>
+    </inject-code>
+
+    <modify-function signature="shear(double,double)">
+        <access modifier="private"/>
+        <rename to="shear_private"/>
+    </modify-function>
+    <inject-code>
+    /**
+      * Shears the transformation using x and y.
+      *
+      * @return The sheared transformation.
+      */
+        <insert-template name="core.private_function_return_self">
+            <replace from="%RETURN_TYPE" to="QTransform"/>
+            <replace from="%FUNCTION_NAME" to="shear"/>
+            <replace from="%ARGUMENTS" to="double x, double y"/>
+            <replace from="%ARGUMENT_NAMES" to="x, y"/>
+        </insert-template>
+    </inject-code>
+
+    <modify-function signature="translate(double,double)">
+        <access modifier="private"/>
+        <rename to="translate_private"/>
+    </modify-function>
+    <inject-code>
+    /**
+     * Translates the transformation using x and y.
+     *
+     * @return The translated transformation.
+     */
+        <insert-template name="core.private_function_return_self">
+            <replace from="%RETURN_TYPE" to="QTransform"/>
+            <replace from="%FUNCTION_NAME" to="translate"/>
+            <replace from="%ARGUMENTS" to="double x, double y"/>
+            <replace from="%ARGUMENT_NAMES" to="x, y"/>
+        </insert-template>
+    </inject-code>
+
+    <modify-function signature="quadToQuad(QPolygonF,QPolygonF,QTransform&amp;)">
+        <access modifier="private"/>
+        <rename to="quadToQuadPrivate"/>
+    </modify-function>
+
+    <modify-function signature="quadToSquare(QPolygonF,QTransform&amp;)">
+        <access modifier="private"/>
+        <rename to="quadToSquarePrivate"/>
+    </modify-function>
+
+    <modify-function signature="squareToQuad(QPolygonF,QTransform&amp;)">
+        <access modifier="private"/>
+        <rename to="squareToQuadPrivate"/>
+    </modify-function>
+
+    </value-type>
+
+  <value-type name="QStyleOption" delete-in-main-thread="yes" polymorphic-base="yes" polymorphic-id-expression="%1-&gt;type == QStyleOption::SO_Default">
+      <modify-function signature="operator=(QStyleOption)" remove="all"/>
+      <modify-function signature="init(const QWidget*)" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-field name="version">
+          <rename to="version_"/>
+      </modify-field>
+  </value-type>
+  <value-type name="QStyleOptionGraphicsItem" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionGraphicsItem::Type &amp;&amp; %1-&gt;version == QStyleOptionGraphicsItem::Version"/>
+  <value-type name="QStyleOptionSizeGrip" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionSizeGrip::Type &amp;&amp; %1-&gt;version == QStyleOptionSizeGrip::Version"/>
+  <value-type name="QStyleOptionButton" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionButton::Type &amp;&amp; %1-&gt;version == QStyleOptionButton::Version"/>
+  <value-type name="QStyleOptionComboBox" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionComboBox::Type &amp;&amp; %1-&gt;version == QStyleOptionComboBox::Version"/>
+  <value-type name="QStyleOptionComplex" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionComplex::Type &amp;&amp; %1-&gt;version == QStyleOptionComplex::Version"/>
+  <value-type name="QStyleOptionDockWidget" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionDockWidget::Type &amp;&amp; %1-&gt;version == QStyleOptionDockWidget::Version"/>
+  <value-type name="QStyleOptionDockWidgetV2" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionDockWidgetV2::Type &amp;&amp; %1-&gt;version == QStyleOptionDockWidgetV2::Version">
+      <modify-function signature="operator=(QStyleOptionDockWidget)" remove="all"/>
+  </value-type>
+  <value-type name="QStyleOptionFocusRect" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionFocusRect::Type &amp;&amp; %1-&gt;version == QStyleOptionFocusRect::Version"/>
+  <value-type name="QStyleOptionFrame" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionFrame::Type &amp;&amp; %1-&gt;version == QStyleOptionFrame::Version"/>
+
+  <value-type name="QStyleOptionFrameV2" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionFrameV2::Type &amp;&amp; %1-&gt;version == QStyleOptionFrameV2::Version">
+    <modify-function signature="operator=(QStyleOptionFrame)" remove="all"/>
+  </value-type>
+
+  <value-type name="QStyleOptionGroupBox" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionGroupBox::Type &amp;&amp; %1-&gt;version == QStyleOptionGroupBox::Version"/>
+  <value-type name="QStyleOptionHeader" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionHeader::Type &amp;&amp; %1-&gt;version == QStyleOptionHeader::Version"/>
+  <value-type name="QStyleOptionMenuItem" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionMenuItem::Type &amp;&amp; %1-&gt;version == QStyleOptionMenuItem::Version"/>
+  <value-type name="QStyleOptionProgressBar" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionProgressBar::Type &amp;&amp; %1-&gt;version == QStyleOptionProgressBar::Version"/>
+
+  <value-type name="QStyleOptionProgressBarV2" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionProgressBarV2::Type &amp;&amp; %1-&gt;version == QStyleOptionProgressBarV2::Version">
+    <modify-function signature="operator=(QStyleOptionProgressBar)" remove="all"/>
+  </value-type>
+
+  <value-type name="QStyleOptionRubberBand" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionRubberBand::Type &amp;&amp; %1-&gt;version == QStyleOptionRubberBand::Version"/>
+  <value-type name="QStyleOptionSlider" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionSlider::Type &amp;&amp; %1-&gt;version == QStyleOptionSlider::Version"/>
+  <value-type name="QStyleOptionSpinBox" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionSpinBox::Type &amp;&amp; %1-&gt;version == QStyleOptionSpinBox::Version"/>
+  <value-type name="QStyleOptionTab" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionTab::Type &amp;&amp; %1-&gt;version == QStyleOptionTab::Version"/>
+  <value-type name="QStyleOptionTabV2" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionTabV2::Type &amp;&amp; %1-&gt;version == QStyleOptionTabV2::Version">
+    <modify-function signature="operator=(const QStyleOptionTab &amp;)" remove="all"/>
+  </value-type>
+  <value-type name="QStyleOptionTabBarBase" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionTabBarBase::Type &amp;&amp; %1-&gt;version == QStyleOptionTabBarBase::Version"/>
+  <value-type name="QStyleOptionTabWidgetFrame" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionTabWidgetFrame::Type &amp;&amp; %1-&gt;version == QStyleOptionTabWidgetFrame::Version"/>
+  <value-type name="QStyleOptionTitleBar" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionTitleBar::Type &amp;&amp; %1-&gt;version == QStyleOptionTitleBar::Version"/>
+  <value-type name="QStyleOptionToolBar" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionToolBar::Type &amp;&amp; %1-&gt;version == QStyleOptionToolBar::Version"/>
+  <value-type name="QStyleOptionToolBox" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionToolBox::Type &amp;&amp; %1-&gt;version == QStyleOptionToolBox::Version"/>
+  <value-type name="QStyleOptionToolBoxV2" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionToolBoxV2::Type &amp;&amp; %1-&gt;version == QStyleOptionToolBoxV2::Version">
+    <modify-function signature="operator=(QStyleOptionToolBox)" remove="all"/>
+  </value-type>
+  <value-type name="QStyleOptionToolButton" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionToolButton::Type &amp;&amp; %1-&gt;version == QStyleOptionToolButton::Version"/>
+  <value-type name="QStyleOptionViewItem" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionViewItem::Type &amp;&amp; %1-&gt;version == QStyleOptionViewItem::Version"/>
+  <value-type name="QStyleOptionViewItemV2" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionViewItemV2::Type &amp;&amp; %1-&gt;version == QStyleOptionViewItemV2::Version">
+    <modify-function signature="operator=(QStyleOptionViewItem)" remove="all"/>
+  </value-type>
+  <value-type name="QStyleOptionViewItemV3" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionViewItemV3::Type &amp;&amp; %1-&gt;version == QStyleOptionViewItemV3::Version">
+    <modify-function signature="operator=(QStyleOptionViewItem)" remove="all"/>
+  </value-type>
+  <value-type name="QStyleOptionViewItemV4" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionViewItemV4::Type &amp;&amp; %1-&gt;version == QStyleOptionViewItemV4::Version">
+    <modify-function signature="operator=(QStyleOptionViewItem)" remove="all"/>
+  </value-type>
+  <value-type name="QTextFragment" delete-in-main-thread="yes">
+    <modify-function signature="operator=(QTextFragment)" remove="all"/>
+  </value-type>
+  <value-type name="QBitmap" delete-in-main-thread="yes">
+    <modify-function signature="operator=(const QPixmap &amp;)" remove="all"/>
+    <modify-function signature="QBitmap(QString,const char*)" access="private">
+        <modify-argument index="2"> <remove-default-expression/> </modify-argument>
+    </modify-function>
+
+    <modify-function signature="fromData(QSize,const unsigned char*,QImage::Format)">
+        <access modifier="private"/>
+        <modify-argument index="3">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+  
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QBitmap___" quote-before-line="}// class"/>
+        </inject-code>
+    </value-type>
+  <value-type name="QTextInlineObject" delete-in-main-thread="yes"/>
+  <value-type name="QSizePolicy"/>
+  <value-type name="QTableWidgetSelectionRange"/>
+  <value-type name="QTextDocumentFragment" delete-in-main-thread="yes">
+    <modify-function signature="operator=(QTextDocumentFragment)" remove="all"/>
+  </value-type>
+  <value-type name="QTextOption" delete-in-main-thread="yes">
+    <modify-function signature="operator=(const QTextOption &amp;)" remove="all"/>
+  </value-type>
+  <value-type name="QTextLine" delete-in-main-thread="yes">
+    <modify-function signature="cursorToX(int*,QTextLine::Edge)const">
+        <remove/>
+    </modify-function>
+  
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QTextLine___" quote-before-line="}// class"/>
+        </inject-code>
+    </value-type>
+  <value-type name="QTextTableFormat" delete-in-main-thread="yes"/>
+  <value-type name="QTextImageFormat" delete-in-main-thread="yes"/>
+  <value-type name="QTextFrameFormat" delete-in-main-thread="yes">
+    <modify-function signature="isValid()const" access="non-final"/>
+  </value-type>
+  <value-type name="QTextLength" delete-in-main-thread="yes"/>
+  <value-type name="QItemSelectionRange">
+      <modify-function signature="intersect(QItemSelectionRange)const" remove="all"/> <!--### Obsolete in 4.3-->
+  </value-type>
+
+  <value-type name="QPainterPath">
+    <modify-function signature="operator=(QPainterPath)" remove="all"/>
+  </value-type>
+  <value-type name="QPalette">
+    <modify-function signature="operator=(const QPalette&amp;)" remove="all"/>
+
+      <modify-function signature="QPalette(QColor, QColor, QColor, QColor, QColor, QColor, QColor)" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="background()const" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="foreground()const" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="serialNumber()const" remove="all"/> <!--### Obsolete in 4.3-->
+  </value-type>
+  <value-type name="QKeySequence">
+    <modify-function signature="operator=(QKeySequence)" remove="all"/>
+    <modify-function signature="operator int()const" access="private"/>
+    <modify-function signature="operator[](uint)const" access="private"/>
+
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QKeySequence___" quote-before-line="}// class"/>
+        </inject-code>
+
+    </value-type>
+
+  <value-type name="QPicture" delete-in-main-thread="yes">
+    <modify-function signature="operator=(QPicture)" remove="all"/>
+    <modify-function signature="pictureFormat(QString)">
+        <remove/>
+    </modify-function>
+
+    <modify-function signature="inputFormatList()" remove="all"/> <!--### Obsolete in 4.3-->
+    <modify-function signature="inputFormats()" remove="all"/> <!--### Obsolete in 4.3-->
+    <modify-function signature="outputFormatList()" remove="all"/> <!--### Obsolete in 4.3-->
+    <modify-function signature="outputFormats()" remove="all"/> <!--### Obsolete in 4.3-->
+  
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QPicture___" quote-before-line="}// class"/>
+        </inject-code>
+        <extra-includes>
+            <include file-name="qt.core.QIODevice" location="java"/>
+        </extra-includes>
+        <modify-function signature="load(QIODevice*,const char*)">
+            <access modifier="private"/>
+            <modify-argument index="2">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+
+
+        <modify-function signature="load(QString,const char*)">
+            <access modifier="private"/>
+            <modify-argument index="2">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+
+
+        <modify-function signature="save(QIODevice*,const char*)">
+            <access modifier="private"/>
+            <modify-argument index="2">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+
+
+        <modify-function signature="save(QString,const char*)">
+            <access modifier="private"/>
+            <modify-argument index="2">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+
+<!--
+        <modify-function signature="setData(const char*,uint)">
+            <modify-argument index="1">
+                <replace-type modified-type="byte[]"/>
+                <conversion-rule class="shell">
+                    jbyteArray %out = __jni_env-&gt;NewByteArray(%2);
+                    __jni_env-&gt;SetByteArrayRegion(%out, 0, %2, (jbyte *) %in);
+                </conversion-rule>
+                <conversion-rule class="native">
+                    char *%out = (char *) __jni_env-&gt;GetByteArrayElements((jbyteArray) %in, 0);
+                    char *__ptr = %out;
+                    Q_UNUSED(__ptr)
+                </conversion-rule>
+            </modify-argument>
+
+            <modify-argument index="2">
+                <remove-argument/>
+                <conversion-rule class="shell">
+                    // nothing
+                </conversion-rule>
+                <conversion-rule class="native">
+                    int %out = %1 == 0 ? 0 : __jni_env-&gt;GetArrayLength((jarray) %1);
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+-->
+        <modify-function signature="pictureFormat(QString)">
+            <remove/>
+        </modify-function>
+
+        <modify-function signature="data()const">
+            <access modifier="private"/>
+            <rename to="data_private"/>
+        </modify-function>
+
+    </value-type>
+
+  <value-type name="QRegion"> <!-- expense-limit="4096"> -->
+    <modify-function signature="operator=(QRegion)" remove="all"/>
+    <modify-function signature="operator&amp;=(QRegion)" remove="all"/>
+    <modify-function signature="operator+=(QRegion)" remove="all"/>
+    <modify-function signature="operator-=(QRegion)" remove="all"/>
+    <modify-function signature="operator^=(QRegion)" remove="all"/>
+    <modify-function signature="operator|=(QRegion)" remove="all"/>
+    <modify-function signature="operator&amp;(QRegion)const" remove="all"/>
+    <modify-function signature="operator+(QRegion)const" remove="all"/>
+    <modify-function signature="operator-(QRegion)const" remove="all"/>
+    <modify-function signature="operator^(QRegion)const" remove="all"/>
+    <modify-function signature="operator|(QRegion)const" remove="all"/>
+    <modify-function signature="eor(QRegion)const" remove="all"/> <!--### Obsolete in 4.3-->
+    <modify-function signature="intersect(QRegion)const" remove="all"/> <!--### Obsolete in 4.3-->
+    <modify-function signature="subtract(QRegion)const" remove="all"/> <!--### Obsolete in 4.3-->
+    <modify-function signature="unite(QRegion)const" remove="all"/> <!--### Obsolete in 4.3-->
+    <modify-function signature="operator&amp;=(QRect)" remove="all"/>
+    <modify-function signature="operator+=(QRect)" remove="all"/>
+
+  
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QRegion___" quote-before-line="}// class"/>
+        </inject-code>
+        <modify-function signature="setRects(const QRect*,int)">
+            <access modifier="private"/>
+        </modify-function>
+
+    </value-type>
+
+  <value-type name="QTextBlock" delete-in-main-thread="yes">
+    <modify-function signature="operator=(QTextBlock)" remove="all"/>
+    <modify-function signature="setUserData(QTextBlockUserData *)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+     </modify-function>
+  </value-type>
+  <value-type name="QTextBlockFormat" delete-in-main-thread="yes"/>
+  <value-type name="QTextTableCellFormat" delete-in-main-thread="yes"/>
+  <value-type name="QTextCharFormat" delete-in-main-thread="yes">
+    <modify-function signature="isValid()const" access="non-final"/>
+
+      <modify-function signature="anchorName()const" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="setAnchorName(QString)" remove="all"/> <!--### Obsolete in 4.3-->
+  </value-type>
+  <value-type name="QTextFormat" delete-in-main-thread="yes">
+    <modify-function signature="operator=(QTextFormat)" remove="all"/>
+    <modify-function signature="isValid()const" access="non-final"/>
+
+  </value-type>
+
+  <value-type name="QTextListFormat" delete-in-main-thread="yes"/>
+  <value-type name="QPolygon">
+    <modify-function signature="QPolygon(int, const int *)" remove="all"/>
+    <modify-function signature="operator+(QVector&lt;QPoint&gt;)const" remove="all"/>
+    <modify-function signature="operator&lt;&lt;(QPoint)" remove="all"/>
+    <modify-function signature="operator&lt;&lt;(QVector&lt;QPoint&gt;)" remove="all"/>
+
+
+  
+        <extra-includes>
+            <include file-name="qt.core.QPoint" location="java"/>
+        </extra-includes>
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QPolygon___" quote-before-line="}// class"/>
+        </inject-code>
+<!-- qtd2
+        <inject-code class="native">
+      extern "C" JNIEXPORT void JNICALL QTJAMBI_FUNCTION_PREFIX(Java_com_trolltech_qt_gui_QPolygon_add_1private)
+      (JNIEnv *__jni_env, jobject, jlong nativeId, jint x, jint y)
+      {
+          Q_UNUSED(__jni_env);
+          QPolygon *polygon = (QPolygon *) qtjambi_from_jlong(nativeId);
+          if (!polygon)
+              return;
+          *polygon &lt;&lt; QPoint(x, y);
+      }
+        </inject-code> -->
+    </value-type>
+
+  <value-type name="QPolygonF">
+    <modify-function signature="operator+(QVector&lt;QPointF&gt;)const" remove="all"/>
+    <modify-function signature="operator&lt;&lt;(QPointF)" remove="all"/>
+    <modify-function signature="operator&lt;&lt;(QVector&lt;QPointF&gt;)" remove="all"/>
+  
+        <extra-includes>
+            <include file-name="qt.core.QPoint" location="java"/>
+        </extra-includes>
+
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QPolygonF___" quote-before-line="}// class"/>
+        </inject-code>
+<!--
+        <inject-code class="native">
+      extern "C" JNIEXPORT void JNICALL QTJAMBI_FUNCTION_PREFIX(Java_com_trolltech_qt_gui_QPolygonF_add_1private)
+      (JNIEnv *__jni_env, jobject, jlong nativeId, jdouble x, jdouble y)
+      {
+          Q_UNUSED(__jni_env);
+          QPolygonF *polygon = (QPolygonF *) qtjambi_from_jlong(nativeId);
+          if (!polygon)
+              return;
+          *polygon &lt;&lt; QPointF(x, y);
+      }
+        </inject-code>
+		-->
+    </value-type>
+
+  <value-type name="QIcon" delete-in-main-thread="yes">
+    <modify-function signature="operator=(QIcon)" remove="all"/>
+    <modify-function signature="serialNumber()const" remove="all"/> <!--### Obsolete in 4.3-->
+    <modify-function signature="QIcon(QIconEngineV2 *)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="QIcon(QIconEngine *)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="operator QVariant()const" access="private"/>
+    <inject-code class="java">
+        public final QVariant toVariant() {
+            return operator_cast_QVariant();
+        }
+    </inject-code>
+
+  </value-type>
+
+  <value-type name="QTextFrame::iterator" delete-in-main-thread="yes">
+    <include file-name="QTextFrame" location="global"/>
+    <modify-function signature="operator++(int)" remove="all"/>
+    <modify-function signature="operator--(int)" remove="all"/>
+    <modify-function signature="operator=(QTextFrame::iterator)" remove="all"/>
+    <modify-function signature="operator++()" access="private"/>
+    <modify-function signature="operator--()" access="private"/>
+  
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QTextFrame_iterator___" quote-before-line="}// class"/>
+        </inject-code>
+
+    </value-type>
+
+  <value-type name="QTreeWidgetItemIterator" delete-in-main-thread="yes">
+    <custom-constructor>
+    return new QTreeWidgetItemIterator(*copy);
+    </custom-constructor>
+    <custom-destructor>
+    delete copy;
+    </custom-destructor>
+    <modify-function signature="operator=(QTreeWidgetItemIterator)" remove="all"/>
+    <modify-function signature="operator++(int)" remove="all"/>
+    <modify-function signature="operator--(int)" remove="all"/>
+    <modify-function signature="operator+=(int)" access="private"/>
+    <modify-function signature="operator-=(int)" access="private"/>
+    <modify-function signature="operator++()" access="private"/>
+    <modify-function signature="operator--()" access="private"/>
+    <modify-function signature="operator*()const" access="private"/>
+   
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QTreeWidgetItemIterator___" quote-before-line="}// class"/>
+        </inject-code>
+
+    </value-type>
+
+  <value-type name="QTextBlock::iterator" delete-in-main-thread="yes">
+    <include file-name="QTextBlock" location="global"/>
+
+    <modify-function signature="operator++()" access="private"/>
+    <modify-function signature="operator--()" access="private"/>
+    <modify-function signature="operator++(int)" remove="all"/>
+    <modify-function signature="operator--(int)" remove="all"/>
+   
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QTextBlock_iterator___" quote-before-line="}// class"/>
+        </inject-code>
+
+    </value-type>
+
+  <value-type name="QAbstractTextDocumentLayout::PaintContext" delete-in-main-thread="yes">
+    <include file-name="QAbstractTextDocumentLayout" location="global"/>
+  </value-type>
+  <value-type name="QAbstractTextDocumentLayout::Selection" delete-in-main-thread="yes"/>
+
+  <value-type name="QPixmap" delete-in-main-thread="yes">
+    <modify-function signature="operator=(QPixmap)" remove="all"/>
+    <modify-function signature="operator!()const" remove="all"/>
+    <modify-function signature="operator QVariant()const" access="private"/>
+    <modify-function signature="QPixmap(const char **)" access="private"/>
+    <modify-function signature="serialNumber()const" remove="all"/> <!--### Obsolete in 4.3-->
+  
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QPixmap___" quote-before-line="}// class"/>
+        </inject-code>
+        <modify-function signature="fill(const QColor &amp;)">
+            <modify-argument index="1">
+                <replace-default-expression with="QColor.White"/>
+            </modify-argument>
+        </modify-function>
+
+
+        <extra-includes>
+            <include file-name="QBitmap" location="global"/>
+            <include file-name="QMatrix" location="global"/>
+        </extra-includes>
+        <modify-function signature="save(QIODevice *, const char *, int) const">
+            <access modifier="private"/>
+            <rename to="private_save"/>
+            <modify-argument index="2">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="3">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+        <inject-code>
+            <insert-template name="gui.pixmap_save">
+                <replace from="%INPUT_TYPE" to="qt.core.QIODevice"/>
+                <replace from="%INPUT_NAME" to="dev"/>
+            </insert-template>
+        </inject-code>
+
+        <modify-function signature="save(const QString &amp;, const char *, int) const">
+            <access modifier="private"/>
+            <rename to="private_save"/>
+            <modify-argument index="2">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="3">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+        <inject-code>
+            <insert-template name="gui.pixmap_save">
+                <replace from="%INPUT_TYPE" to="String"/>
+                <replace from="%INPUT_NAME" to="fileName"/>
+            </insert-template>
+        </inject-code>
+
+        <modify-function signature="QPixmap(QString,const char*,QFlags&lt;Qt::ImageConversionFlag&gt;)">
+            <access modifier="private"/>
+            <modify-argument index="2">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="3">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+        <inject-code>
+            <insert-template name="gui.pixmap_constructor"/>
+        </inject-code>
+
+        <modify-function signature="load(QString,const char*,QFlags&lt;Qt::ImageConversionFlag&gt;)">
+            <access modifier="private"/>
+            <modify-argument index="2">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="3">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+        <inject-code>
+            <insert-template name="gui.pixmap_load">
+                <replace from="%FUNCTION_NAME" to="load"/>
+                <replace from="%INPUT_TYPE" to="String"/>
+                <replace from="%INPUT_NAME" to="fileName"/>
+                <replace from="%OUTPUT_NAME" to="fileName"/>
+            </insert-template>
+        </inject-code>
+
+        <modify-function signature="loadFromData(const unsigned char*,uint,const char*,QFlags&lt;Qt::ImageConversionFlag&gt;)">
+            <access modifier="private"/>
+            <modify-argument index="3">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="4">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+        <inject-code>
+            <insert-template name="gui.pixmap_load">
+                <replace from="%FUNCTION_NAME" to="loadFromData"/>
+                <replace from="%INPUT_TYPE" to="byte[]"/>
+                <replace from="%INPUT_NAME" to="data"/>
+                <replace from="%OUTPUT_NAME" to="qt.internal.QtJambiInternal.byteArrayToNativePointer(data), data.length"/>
+            </insert-template>
+        </inject-code>
+
+        <modify-function signature="loadFromData(QByteArray,const char*,QFlags&lt;Qt::ImageConversionFlag&gt;)">
+            <access modifier="private"/>
+            <modify-argument index="2">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="3">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+        <inject-code>
+            <insert-template name="gui.pixmap_load">
+                <replace from="%FUNCTION_NAME" to="loadFromData"/>
+                <replace from="%INPUT_TYPE" to="qt.core.QByteArray"/>
+                <replace from="%INPUT_NAME" to="data"/>
+                <replace from="%OUTPUT_NAME" to="data"/>
+            </insert-template>
+        </inject-code>
+    </value-type>
+
+  <value-type name="QTextCursor" delete-in-main-thread="yes">
+    <extra-includes>
+        <include file-name="QTextBlock" location="global"/>
+        <include file-name="QTextDocumentFragment" location="global"/>
+    </extra-includes>
+    <modify-function signature="operator=(QTextCursor)" remove="all"/>
+    <modify-function signature="selectedTableCells(int*,int*,int*,int*)const">
+        <access modifier="private"/>
+    </modify-function>
+  
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QTextCursor___" quote-before-line="}// class"/>
+        </inject-code>
+    </value-type>
+
+  <value-type name="QTextLayout::FormatRange">
+    <include file-name="QTextLayout" location="global"/>
+  </value-type>
+
+  <value-type name="QInputMethodEvent::Attribute">
+    <include file-name="QInputMethodEvent" location="global"/>
+    <custom-constructor>
+    return new QInputMethodEvent::Attribute(copy-&gt;type, copy-&gt;start, copy-&gt;length, copy-&gt;value);
+    </custom-constructor>
+    <custom-destructor>
+    delete copy;
+    </custom-destructor>
+  </value-type>
+
+  <value-type name="QItemSelection" delete-in-main-thread="yes">
+
+    <modify-function signature="operator+(const QList&lt;QItemSelectionRange&gt;&amp;)const" remove="all"/>
+    <modify-function signature="operator+=(const QList&lt;QItemSelectionRange&gt;&amp;)" remove="all"/>
+    <modify-function signature="operator+=(const QItemSelectionRange&amp;)" remove="all"/>
+    <modify-function signature="operator&lt;&lt;(const QList&lt;QItemSelectionRange&gt;&amp;)" remove="all"/>
+    <modify-function signature="operator&lt;&lt;(QItemSelectionRange)" remove="all"/>
+<!--  
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QItemSelection___" quote-before-line="}// class"/>
+        </inject-code>
+        <modify-function signature="split(QItemSelectionRange,QItemSelectionRange,QItemSelection*)">
+            <access modifier="private"/>
+        </modify-function>
+-->
+
+    </value-type>
+
+  <value-type name="QMatrix">
+      <extra-includes>
+        <include file-name="QPainterPath" location="global"/>
+      </extra-includes>
+
+      <modify-function signature="map(int,int,int*,int*)const" remove="all"/>
+      <modify-function signature="map(double,double,double*,double*)const" remove="all"/>
+      <modify-function signature="operator=(QMatrix)" remove="all"/>
+
+      <modify-function signature="operator*(QMatrix)const" access="private"/>
+      <modify-function signature="operator*=(QMatrix)" access="private"/>
+      <modify-function signature="rotate(double)" access="private" rename="rotate_private"/>
+      <modify-function signature="scale(double,double)" access="private" rename="scale_private"/>
+      <modify-function signature="shear(double,double)" access="private" rename="shear_private"/>
+      <modify-function signature="translate(double,double)" access="private" rename="translate_private"/>
+
+      <modify-function signature="inverted(bool*)const">
+        <access modifier="private"/>
+        <modify-argument index="1">
+            <remove-default-expression/>
+        </modify-argument>
+      </modify-function>
+
+    <inject-code>
+      <insert-template name="core.unary_other_type">
+        <replace from="%FUNCTION_NAME" to="rotate"/>
+        <replace from="%OUT_TYPE" to="QMatrix"/>
+        <replace from="%IN_TYPE" to="double"/>
+      </insert-template>
+
+      <insert-template name="core.private_function_return_self">
+        <replace from="%RETURN_TYPE" to="QMatrix"/>
+        <replace from="%FUNCTION_NAME" to="scale"/>
+        <replace from="%ARGUMENTS" to="double sx, double sy"/>
+        <replace from="%ARGUMENT_NAMES" to="sx, sy"/>
+      </insert-template>
+
+      <insert-template name="core.private_function_return_self">
+        <replace from="%RETURN_TYPE" to="QMatrix"/>
+        <replace from="%FUNCTION_NAME" to="shear"/>
+        <replace from="%ARGUMENTS" to="double sh, double sv"/>
+        <replace from="%ARGUMENT_NAMES" to="sh, sv"/>
+      </insert-template>
+
+      <insert-template name="core.private_function_return_self">
+        <replace from="%RETURN_TYPE" to="QMatrix"/>
+        <replace from="%FUNCTION_NAME" to="translate"/>
+        <replace from="%ARGUMENTS" to="double dx, double dy"/>
+        <replace from="%ARGUMENT_NAMES" to="dx, dy"/>
+      </insert-template>
+    </inject-code>
+  
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QMatrix___" quote-before-line="}// class"/>
+        </inject-code>
+
+    </value-type>
+
+  <value-type name="QConicalGradient" polymorphic-id-expression="%1-&gt;type() == QGradient::ConicalGradient">
+    <custom-constructor>
+    return new QConicalGradient(copy-&gt;center(), copy-&gt;angle());
+    </custom-constructor>
+    <custom-destructor>
+    delete copy;
+    </custom-destructor>
+  </value-type>
+
+  <value-type name="QFontInfo"> <!-- delete-in-main-thread="yes" expense-cost="1" expense-limit="1000"> -->
+    <custom-constructor>
+    return new QFontInfo(*copy);
+    </custom-constructor>
+    <custom-destructor>
+    delete copy;
+    </custom-destructor>
+    <modify-function signature="operator=(QFontInfo)" remove="all"/>
+
+  </value-type>
+
+  <value-type name="QRadialGradient" polymorphic-id-expression="%1-&gt;type() == QGradient::RadialGradient">
+    <custom-constructor>
+    return new QRadialGradient(copy-&gt;center(), copy-&gt;radius(), copy-&gt;focalPoint());
+    </custom-constructor>
+    <custom-destructor>
+    delete copy;
+    </custom-destructor>
+  </value-type>
+
+  <value-type name="QPainterPath::Element">
+    <modify-field name="x" write="false"/>
+    <modify-field name="y" write="false"/>
+    <modify-field name="type" write="false"/>
+    <include file-name="QPainterPath" location="global"/>
+    <modify-function signature="operator QPointF()const" access="private"/>
+  
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QPainterPath_Element___" quote-before-line="}// class"/>
+        </inject-code>
+
+    </value-type>
+
+  <value-type name="QTextEdit::ExtraSelection" delete-in-main-thread="yes">
+    <include file-name="QTextEdit" location="global"/>
+  </value-type>
+
+  <value-type name="QFont" delete-in-main-thread="yes"> <!-- <expense-cost="1" expense-limit="1000"> -->
+
+    <extra-includes>
+        <include file-name="QStringList" location="global"/>
+    </extra-includes>
+    <modify-function signature="operator=(QFont)" remove="all"/>
+  </value-type>
+
+  <value-type name="QTextTableCell" delete-in-main-thread="yes">
+    <extra-includes>
+        <include file-name="QTextCursor" location="global"/>
+    </extra-includes>
+    <modify-function signature="operator=(QTextTableCell)" remove="all"/>
+  </value-type>
+
+  <value-type name="QImage"> <!-- expense-limit="67108864" expense-cost="height()*bytesPerLine()"> -->
+    <modify-function signature="QImage(const char *, const char *)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="QImage(const char **)">
+        <access modifier="private"/>
+    </modify-function>
+    <modify-function signature="QImage(const unsigned char*,int,int,int,QImage::Format)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="bits()const">
+        <remove/>
+    </modify-function>
+    <modify-function signature="scanLine(int)const">
+        <remove/>
+    </modify-function>
+    <modify-function signature="QImage(const unsigned char *, int, int, QImage::Format)">
+        <remove/>
+    </modify-function>
+
+    <extra-includes>
+        <include file-name="QStringList" location="global"/>
+        <include file-name="QMatrix" location="global"/>
+    </extra-includes>
+    <modify-function signature="save(const QString &amp;, const char *, int) const">
+        <access modifier="private"/>
+        <rename to="private_save"/>
+        <modify-argument index="2">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="3">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="QImage(unsigned char*,int,int,QImage::Format)">
+        <access modifier="private"/>
+    </modify-function>
+
+    <modify-function signature="QImage(QString,const char*)">
+        <access modifier="private"/>
+        <modify-argument index="2">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="load(QString,const char*)">
+        <access modifier="private"/>
+        <modify-argument index="2">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="load(QIODevice*,const char*)">
+        <access modifier="private"/>
+    </modify-function>
+
+    <modify-function signature="loadFromData(const unsigned char*,int,const char*)">
+        <access modifier="private"/>
+        <modify-argument index="2">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="3">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="loadFromData(QByteArray,const char*)">
+        <access modifier="private"/>
+        <modify-argument index="2">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="operator=(QImage)" remove="all"/>
+
+    <modify-function signature="setText(const char*,const char*,QString)">
+        <remove/>
+    </modify-function>
+
+    <modify-function signature="text(const char*,const char*)const">
+        <remove/>
+    </modify-function>
+
+    <modify-function signature="fromData(QByteArray,const char*)">
+        <access modifier="private"/>
+        <modify-argument index="2">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="fromData(const unsigned char*,int,const char*)">
+        <remove/>
+    </modify-function>
+
+      <modify-function signature="serialNumber()const" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="textLanguages()const" remove="all"/> <!--### Obsolete in 4.3-->
+  
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QImage___" quote-before-line="}// class"/>
+        </inject-code>
+        <inject-code>
+            <insert-template name="gui.pixmap_save">
+                <replace from="%INPUT_TYPE" to="String"/>
+                <replace from="%INPUT_NAME" to="fileName"/>
+            </insert-template>
+        </inject-code>
+
+        <modify-function signature="save(QIODevice *, const char *, int) const">
+            <access modifier="private"/>
+            <rename to="private_save"/>
+            <modify-argument index="2">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="3">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+        <inject-code>
+            <insert-template name="gui.pixmap_save">
+                <replace from="%INPUT_TYPE" to="qt.core.QIODevice"/>
+                <replace from="%INPUT_NAME" to="dev"/>
+            </insert-template>
+        </inject-code>
+
+        <template name="gui.image_load">
+        public final boolean %FUNCTION_NAME(%ARGUMENT_TYPE %ARGUMENT_NAME, String format) {
+            return %FUNCTION_NAME(%OUT_ARGUMENT_NAME, format != null ? QNativePointer.createCharPointer(format) : null);
+        }
+
+        public final boolean %FUNCTION_NAME(%ARGUMENT_TYPE %ARGUMENT_NAME) {
+            return %FUNCTION_NAME(%ARGUMENT_NAME, (String) null);
+        }
+        </template>
+<!--
+        <inject-code>
+            <insert-template name="gui.image_load">
+                <replace from="%FUNCTION_NAME" to="load"/>
+                <replace from="%ARGUMENT_TYPE" to="String"/>
+                <replace from="%ARGUMENT_NAME" to="fileName"/>
+                <replace from="%OUT_ARGUMENT_NAME" to="fileName"/>
+            </insert-template>
+        </inject-code>
+
+        <inject-code>
+            <insert-template name="gui.image_load">
+                <replace from="%FUNCTION_NAME" to="load"/>
+                <replace from="%ARGUMENT_TYPE" to="qt.core.QIODevice"/>
+                <replace from="%ARGUMENT_NAME" to="device"/>
+                <replace from="%OUT_ARGUMENT_NAME" to="device"/>
+            </insert-template>
+        </inject-code>
+
+        <inject-code>
+            <insert-template name="gui.image_load">
+                <replace from="%FUNCTION_NAME" to="loadFromData"/>
+                <replace from="%ARGUMENT_TYPE" to="byte[]"/>
+                <replace from="%ARGUMENT_NAME" to="data"/>
+                <replace from="%OUT_ARGUMENT_NAME" to="qt.internal.QtJambiInternal.byteArrayToNativePointer(data), data.length"/>
+            </insert-template>
+        </inject-code>
+
+        <inject-code>
+            <insert-template name="gui.image_load">
+                <replace from="%FUNCTION_NAME" to="loadFromData"/>
+                <replace from="%ARGUMENT_TYPE" to="qt.core.QByteArray"/>
+                <replace from="%ARGUMENT_NAME" to="data"/>
+                <replace from="%OUT_ARGUMENT_NAME" to="data"/>
+            </insert-template>
+        </inject-code>
+
+        <inject-code>
+            <insert-template name="gui.image_load">
+                <replace from="%FUNCTION_NAME" to="fromData"/>
+                <replace from="%ARGUMENT_TYPE" to="qt.core.QByteArray"/>
+                <replace from="%ARGUMENT_NAME" to="data"/>
+                <replace from="%OUT_ARGUMENT_NAME" to="data"/>
+                <replace from="boolean" to="QImage"/>
+                <replace from="final" to="static"/>
+            </insert-template>
+        </inject-code>
+		-->
+    </value-type>
+
+  <value-type name="QColormap" delete-in-main-thread="yes">
+    <modify-function signature="operator=(QColormap)" remove="all"/>
+    <extra-includes>
+        <include file-name="QColor" location="global"/>
+    </extra-includes>
+    <custom-constructor>
+    return new QColormap(*copy);
+    </custom-constructor>
+    <custom-destructor>
+    delete copy;
+    </custom-destructor>
+  </value-type>
+
+  <value-type name="QCursor" delete-in-main-thread="yes">
+     <extra-includes>
+        <include file-name="QPixmap" location="global"/>
+    </extra-includes>
+    <modify-function signature="operator=(QCursor)" remove="all"/>
+<!--  
+        <template name="gui.cursor_bitmap_getter">
+            <insert-template name="gui.getter_returning_nativepointer">
+                <replace from="%RETURN_TYPE" to="QBitmap"/>
+            </insert-template>
+        </template>
+
+        <modify-function signature="bitmap()const">
+            <access modifier="private"/>
+            <rename to="bitmap_private"/>
+        </modify-function>
+        <inject-code>
+            <insert-template name="gui.cursor_bitmap_getter">
+                <replace from="%FUNCTION_NAME" to="bitmap"/>
+            </insert-template>
+        </inject-code>
+
+        <modify-function signature="mask()const">
+            <access modifier="private"/>
+            <rename to="mask_private"/>
+        </modify-function>
+        <inject-code>
+            <insert-template name="gui.cursor_bitmap_getter">
+                <replace from="%FUNCTION_NAME" to="mask"/>
+            </insert-template>
+        </inject-code>
+		-->
+    </value-type>
+
+  <value-type name="QFontDatabase" delete-in-main-thread="yes">
+      <extra-includes>
+        <include file-name="QStringList" location="global"/>
+    </extra-includes>
+  </value-type>
+
+  <value-type name="QPen">
+      <extra-includes>
+        <include file-name="QBrush" location="global"/>
+    </extra-includes>
+
+    <modify-function signature="operator=(QPen)" remove="all"/>
+  
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QPen___" quote-before-line="}// class"/>
+        </inject-code>
+    </value-type>
+
+  <value-type name="QBrush">
+    <modify-function signature="QBrush(Qt::GlobalColor, Qt::BrushStyle)" remove="all"/>
+    <modify-function signature="operator=(const QBrush &amp;)" remove="all"/>
+	<!-- restore later - abstract class not handled-->
+	<modify-function signature="gradient() const" remove="all"/>
+    
+	<extra-includes>
+        <include file-name="QPixmap" location="global"/>
+    </extra-includes>
+  
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QBrush___" quote-before-line="}// class"/>
+        </inject-code>
+
+
+        <modify-function signature="gradient()const">
+            <!-- Use custom constructors already defined for gradient -->
+            <modify-argument index="0">
+                <replace-type modified-type="qt.gui.QGradient"/>
+                <conversion-rule class="native">
+                    jobject %out = qtjambi_from_object(__jni_env, %in, "QGradient", "com/trolltech/qt/gui/", "Lcom_trolltech_qt_gui_QGradient_2", true);
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+    </value-type>
+
+  <value-type name="QColor">
+    <modify-function signature="QColor(QColor::Spec)" remove="all"/>
+    <modify-function signature="operator=(QColor)" remove="all"/>
+    <modify-function signature="operator=(Qt::GlobalColor)" remove="all"/>
+
+    <modify-function signature="QColor(const char*)">
+        <remove/>
+    </modify-function>
+
+    <modify-function signature="getCmyk(int*,int*,int*,int*,int*)">
+        <remove/>
+    </modify-function>
+
+    <modify-function signature="getCmykF(double*,double*,double*,double*,double*)">
+        <remove/>
+    </modify-function>
+
+    <modify-function signature="getHsv(int*,int*,int*,int*)const">
+        <remove/>
+    </modify-function>
+
+    <modify-function signature="getHsvF(double*,double*,double*,double*)const">
+        <remove/>
+    </modify-function>
+
+    <modify-function signature="getRgb(int*,int*,int*,int*)const">
+        <remove/>
+    </modify-function>
+
+    <modify-function signature="getRgbF(double*,double*,double*,double*)const">
+        <remove/>
+    </modify-function>
+
+      <modify-function signature="dark(int)const" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="light(int)const" remove="all"/> <!--### Obsolete in 4.3-->
+  
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QColor___" quote-before-line="}// class"/>
+        </inject-code>
+    </value-type>
+
+  <value-type name="QFontMetricsF" delete-in-main-thread="yes" expense-cost="1" expense-limit="1000">
+    <custom-constructor>
+        return new QFontMetricsF(*copy);
+    </custom-constructor>
+    <custom-destructor>
+        delete copy;
+    </custom-destructor>
+    <modify-function signature="operator!=(const QFontMetricsF &amp;)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="operator==(const QFontMetricsF &amp;)">
+        <remove/>
+    </modify-function>
+
+    <modify-function signature="boundingRect(QRectF,int,QString,int,int*)const">
+        <access modifier="private"/>
+        <modify-argument index="4">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="5">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="operator=(QFontMetrics)" remove="all"/>
+    <modify-function signature="operator=(QFontMetricsF)" remove="all"/>
+
+    <modify-function signature="size(int,QString,int,int*)const">
+        <access modifier="private"/>
+        <modify-argument index="3">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="4">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+   
+        <template name="gui.fontmetricsf_boundingrect">
+            <insert-template name="gui.fontmetrics_tabarray_function">
+                <replace from="%RETURN_TYPE" to="qt.core.QRectF"/>
+                <replace from="%FUNCTION_NAME" to="boundingRect"/>
+                <replace from="%RECT_ARGUMENTS" to="%RECT_ARGUMENTS, "/>
+                <replace from="%RECT_CALL_ARGUMENTS" to="%RECT_CALL_ARGUMENTS, "/>
+            </insert-template>
+        </template>
+
+        <inject-code>
+            <insert-template name="gui.fontmetricsf_boundingrect">
+                <replace from="%RECT_ARGUMENTS" to="qt.core.QRectF rect"/>
+                <replace from="%RECT_CALL_ARGUMENTS" to="rect"/>
+            </insert-template>
+        </inject-code>
+
+        <inject-code>
+            <insert-template name="gui.fontmetrics_tabarray_function">
+                <replace from="%RETURN_TYPE" to="qt.core.QSizeF"/>
+                <replace from="%FUNCTION_NAME" to="size"/>
+                <replace from="%RECT_ARGUMENTS" to=""/>
+                <replace from="%RECT_CALL_ARGUMENTS" to=""/>
+            </insert-template>
+        </inject-code>
+    </value-type>
+   <value-type name="QTextOption::Tab"/>
+
+  <value-type name="QFontMetrics" delete-in-main-thread="yes"> <!-- <expense-cost="1" expense-limit="1000">
+    <custom-constructor>
+        return new QFontMetrics(*copy);
+    </custom-constructor>
+    <custom-destructor>
+        delete copy;
+    </custom-destructor>-->
+    <modify-function signature="operator!=(const QFontMetrics &amp;)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="operator==(const QFontMetrics &amp;)">
+        <remove/>
+    </modify-function>
+
+    <modify-function signature="boundingRect(int,int,int,int,int,QString,int,int*)const">
+        <access modifier="private"/>
+        <modify-argument index="7">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="8">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="boundingRect(QRect,int,QString,int,int*)const">
+        <access modifier="private"/>
+        <modify-argument index="4">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="5">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="operator=(QFontMetrics)" remove="all"/>
+
+    <modify-function signature="size(int,QString,int,int*)const">
+        <access modifier="private"/>
+        <modify-argument index="3">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="4">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+
+ <!-- 
+        <template name="gui.fontmetrics_tabarray_function">
+        public final %RETURN_TYPE %FUNCTION_NAME(%RECT_ARGUMENTSint flags, String text, int tabStops, int tabArray[]) {
+            QNativePointer np = tabArray == null ? null : new QNativePointer(QNativePointer.Type.Int, tabArray.length + 1);
+            if (np != null) {
+                for (int i=0; i&lt;tabArray.length; ++i) np.setIntAt(i, tabArray[i]);
+                np.setIntAt(tabArray.length, 0);
+            }
+            return %FUNCTION_NAME(%RECT_CALL_ARGUMENTSflags, text, tabStops, np);
+        }
+
+        public final %RETURN_TYPE %FUNCTION_NAME(%RECT_ARGUMENTSint flags, String text, int tabStops) {
+            return %FUNCTION_NAME(%RECT_CALL_ARGUMENTSflags, text, tabStops, (int []) null);
+        }
+
+        public final %RETURN_TYPE %FUNCTION_NAME(%RECT_ARGUMENTSint flags, String text) {
+            return %FUNCTION_NAME(%RECT_CALL_ARGUMENTSflags, text, 0);
+        }
+        </template>
+
+        <template name="gui.fontmetrics_boundingrect">
+            <insert-template name="gui.fontmetrics_tabarray_function">
+                <replace from="%RETURN_TYPE" to="qt.core.QRect"/>
+                <replace from="%FUNCTION_NAME" to="boundingRect"/>
+                <replace from="%RECT_ARGUMENTS" to="%RECT_ARGUMENTS, "/>
+                <replace from="%RECT_CALL_ARGUMENTS" to="%RECT_CALL_ARGUMENTS, "/>
+            </insert-template>
+        </template>
+
+        <inject-code>
+            <insert-template name="gui.fontmetrics_boundingrect">
+                <replace from="%RECT_ARGUMENTS" to="int x, int y, int width, int height"/>
+                <replace from="%RECT_CALL_ARGUMENTS" to="x, y, width, height"/>
+            </insert-template>
+        </inject-code>
+
+        <inject-code>
+            <insert-template name="gui.fontmetrics_boundingrect">
+                <replace from="%RECT_ARGUMENTS" to="qt.core.QRect rect"/>
+                <replace from="%RECT_CALL_ARGUMENTS" to="rect"/>
+            </insert-template>
+        </inject-code>
+
+        <inject-code>
+            <insert-template name="gui.fontmetrics_tabarray_function">
+                <replace from="%RETURN_TYPE" to="qt.core.QSize"/>
+                <replace from="%FUNCTION_NAME" to="size"/>
+                <replace from="%RECT_ARGUMENTS" to=""/>
+                <replace from="%RECT_CALL_ARGUMENTS" to=""/>
+            </insert-template>
+        </inject-code>-->
+    </value-type>
+
+  <value-type name="QGradient" force-abstract="yes" polymorphic-base="yes" polymorphic-id-expression="%1-&gt;type() == QGradient::NoGradient">
+    <custom-constructor>
+    Q_UNUSED(copy)
+    qWarning("Copying empty QGradient object");
+    return new QGradient();
+    </custom-constructor>
+    <custom-destructor>
+    delete copy;
+    </custom-destructor>
+    <modify-function signature="operator==(const QGradient &amp;)">
+        <remove/>
+    </modify-function>
+  </value-type>
+
+  <value-type name="QLinearGradient" polymorphic-id-expression="%1-&gt;type() == QGradient::LinearGradient">
+    <custom-constructor>
+    QLinearGradient *lg = new QLinearGradient(copy-&gt;start(), copy-&gt;finalStop());
+    lg-&gt;setSpread(copy-&gt;spread());
+    lg-&gt;setStops(copy-&gt;stops());
+    return (void *) lg;
+    </custom-constructor>
+    <custom-destructor>
+    delete copy;
+    </custom-destructor>
+  </value-type>
+
+  <value-type name="QPrinterInfo">
+    <modify-function signature="operator=(const QPrinterInfo &amp;)" remove="all"/>
+  </value-type>
+
+  <interface-type name="QLayoutItem">
+    <modify-field name="align">
+      <rename to="align_"/>
+    </modify-field>
+  </interface-type>
+  <interface-type name="QPaintDevice">
+	
+	<modify-function signature="paintEngine () const">
+		<store-result/>
+	</modify-function>
+	
+  </interface-type>
+  
+  <interface-type name="QGraphicsItem" delete-in-main-thread="yes">
+	<modify-function signature="setExtension(QGraphicsItem::Extension,QVariant)" remove="all"/>
+	<modify-function signature="supportsExtension(QGraphicsItem::Extension)const" remove="all"/>
+	
+    <modify-function signature="matrix()const" remove="all"/>
+    <modify-function signature="resetMatrix()" remove="all"/>
+    <modify-function signature="sceneMatrix()const" remove="all"/>
+    <modify-function signature="setMatrix(QMatrix, bool)" remove="all"/>
+
+    <modify-function signature="children()const" remove="all"/>
+  <!--
+    <modify-function signature="setMatrix(QMatrix, bool)" remove="all"/>
+
+    <modify-function signature="paint(QPainter*,const QStyleOptionGraphicsItem*,QWidget*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="collidesWithItem(const QGraphicsItem*,Qt::ItemSelectionMode)const">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+
+    <modify-function signature="contextMenuEvent(QGraphicsSceneContextMenuEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="dragEnterEvent(QGraphicsSceneDragDropEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="dragLeaveEvent(QGraphicsSceneDragDropEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="dragMoveEvent(QGraphicsSceneDragDropEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="dropEvent(QGraphicsSceneDragDropEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="focusInEvent(QFocusEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="focusOutEvent(QFocusEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="hoverEnterEvent(QGraphicsSceneHoverEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="hoverLeaveEvent(QGraphicsSceneHoverEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="hoverMoveEvent(QGraphicsSceneHoverEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="inputMethodEvent(QInputMethodEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="isObscuredBy(const QGraphicsItem*)const">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="keyPressEvent(QKeyEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="keyReleaseEvent(QKeyEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="mouseDoubleClickEvent(QGraphicsSceneMouseEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="mouseMoveEvent(QGraphicsSceneMouseEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="mousePressEvent(QGraphicsSceneMouseEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="mouseReleaseEvent(QGraphicsSceneMouseEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="sceneEvent(QEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="sceneEventFilter(QGraphicsItem*,QEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+        <modify-argument index="2" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="wheelEvent(QGraphicsSceneWheelEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+
+    <modify-function signature="children()const" remove="all"/>
+    <modify-function signature="installSceneEventFilter(QGraphicsItem *)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="removeSceneEventFilter(QGraphicsItem *)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+  
+
+        <modify-function signature="QGraphicsItem(QGraphicsItem*,QGraphicsScene*)">
+            <inject-code position="end">
+                <argument-map index="1" meta-name="%1"/>
+            if (%1 != null)
+                disableGarbageCollection();
+            </inject-code>
+        </modify-function>
+
+        <modify-function signature="paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *)">
+            <modify-argument index="2">
+                <conversion-rule class="shell">
+                    jobject %out = qtjambi_from_object(__jni_env, %in, "QStyleOptionGraphicsItem", "com/trolltech/qt/gui/", "Lcom_trolltech_qt_gui_QStyleOption_2", true);
+                </conversion-rule>
+                <conversion-rule class="native">
+                    const QStyleOptionGraphicsItem *%out = (QStyleOptionGraphicsItem *) qtjambi_to_object(__jni_env, %in);
+                </conversion-rule>
+                <replace-type modified-type="qt.gui.QStyleOptionGraphicsItem"/>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="setGroup(QGraphicsItemGroup*)">
+            <modify-argument index="1">
+                <reference-count action="ignore"/>
+            </modify-argument>
+            <inject-code position="beginning">
+                qt.gui.QGraphicsItemGroup oldGroup = group();
+            </inject-code>
+            <inject-code position="end">
+                <argument-map index="1" meta-name="%1"/>
+            if (%1 == null &amp;&amp; oldGroup != null &amp;&amp; oldGroup.parentItem() == null)
+                reenableGarbageCollection();
+            else
+                disableGarbageCollection();
+            </inject-code>
+        </modify-function>
+
+        <modify-function signature="setParentItem(QGraphicsItem*)">
+            <modify-argument index="1">
+                <reference-count action="ignore"/>
+            </modify-argument>
+            <inject-code position="end">
+                <argument-map index="1" meta-name="%1"/>
+            if (%1 == null)
+                reenableGarbageCollection();
+            else
+                disableGarbageCollection();
+            </inject-code>
+        </modify-function> -->
+    </interface-type>
+
+  <object-type name="QAbstractGraphicsShapeItem" delete-in-main-thread="yes">
+  	<modify-function signature="setExtension(QGraphicsItem::Extension,QVariant)" remove="all"/>
+	<modify-function signature="supportsExtension(QGraphicsItem::Extension)const" remove="all"/>
+  <!--
+    <modify-function signature="QAbstractGraphicsShapeItem(QGraphicsItem*,QGraphicsScene*)">
+        <inject-code position="end">
+            <argument-map index="1" meta-name="%1"/>
+            if (%1 != null) disableGarbageCollection();
+        </inject-code>
+    </modify-function>
+   -->
+    <modify-function signature="matrix()const" remove="all"/>
+    <modify-function signature="resetMatrix()" remove="all"/>
+    <modify-function signature="sceneMatrix()const" remove="all"/>
+    <modify-function signature="setMatrix(QMatrix, bool)" remove="all"/>
+    <!--
+        <modify-function signature="QAbstractGraphicsShapeItem(QGraphicsItem*,QGraphicsScene*)">
+            <inject-code position="end">
+                <argument-map index="1" meta-name="%1"/>
+            if (%1 != null) disableGarbageCollection();
+            </inject-code>
+        </modify-function>
+    -->
+    </object-type>
+
+  <object-type name="QAbstractItemView">
+<!--     <extra-includes>
+        <include file-name="tango.util.container.HashMap" location="java"/>
+    </extra-includes>-->
+      <modify-function signature="update()" remove="all"/>
+      <modify-function signature="horizontalStepsPerItem()const" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="setHorizontalStepsPerItem(int)" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="setVerticalStepsPerItem(int)" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="verticalStepsPerItem()const" remove="all"/> <!--### Obsolete in 4.3-->
+
+      <modify-function signature="edit(QModelIndex,QAbstractItemView::EditTrigger,QEvent*)">
+        <modify-argument index="3" invalidate-after-use="yes"/>
+      </modify-function>
+      <modify-function signature="selectionCommand(QModelIndex,const QEvent*)const">
+        <modify-argument index="2" invalidate-after-use="yes"/>
+      </modify-function>
+
+<!--      <modify-function signature="QAbstractItemView(QWidget*)">
+        <inject-code class="java" position="end">
+    __rcDelegatesForColumns = new HashMap!(int, QAbstractItemDelegate);
+    __rcDelegatesForRows = new HashMap!(int, QAbstractItemDelegate);
+        </inject-code>
+      </modify-function>
+ --> 
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QAbstractItemView___" quote-before-line="}// class"/>
+        </inject-code>
+
+
+        <modify-function signature="setIndexWidget(const QModelIndex &amp;,QWidget *)">
+            <modify-argument index="2">
+                <!-- Safe to ignore because view reparents widget -->
+                <reference-count action="ignore"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="setItemDelegate(QAbstractItemDelegate *)">
+            <modify-argument index="1">
+                <reference-count action="set" variable-name="__rcItemDelegate"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="setModel(QAbstractItemModel *)">
+            <modify-argument index="1">
+                <reference-count action="set" variable-name="__rcItemModel"/>
+            </modify-argument>
+            <inject-code class="java" position="end">
+                // setModel() creates a new selection model for the object
+                __rcItemSelectionModel = null;
+            </inject-code>
+        </modify-function>
+        <modify-function signature="setSelectionModel(QItemSelectionModel *)">
+            <modify-argument index="1">
+                <no-null-pointer/>
+                <reference-count action="set" variable-name="__rcItemSelectionModel"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="setItemDelegateForColumn(int,QAbstractItemDelegate*)">
+            <modify-argument index="2">
+                <reference-count action="ignore"/>
+            </modify-argument>
+            <inject-code position="end">
+                <argument-map index="1" meta-name="%1"/>
+                <argument-map index="2" meta-name="%2"/>
+                if (%2 is null)
+                    __rcDelegatesForColumns.remove(%1);
+                else
+                    __rcDelegatesForColumns[%1] = %2;
+            </inject-code>
+        </modify-function>
+        <modify-function signature="setItemDelegateForRow(int,QAbstractItemDelegate*)">
+            <modify-argument index="2">
+                <reference-count action="ignore"/>
+            </modify-argument>
+            <inject-code position="end">
+                <argument-map index="1" meta-name="%1"/>
+                <argument-map index="2" meta-name="%2"/>
+                if (%2 is null)
+                    __rcDelegatesForRows.remove(%1);
+                else
+                    __rcDelegatesForRows[%1] = %2;
+            </inject-code>
+        </modify-function>
+    </object-type>
+
+  <object-type name="QAbstractPageSetupDialog"/>
+  <object-type name="QAbstractPrintDialog"/>
+  <object-type name="QAbstractSlider"/>
+  <object-type name="QAbstractTextDocumentLayout">
+    <modify-function signature="setPaintDevice(QPaintDevice*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcPaintDevice"/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="draw(QPainter*,QAbstractTextDocumentLayout::PaintContext)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="drawInlineObject(QPainter*,QRectF,QTextInlineObject,int,QTextFormat)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+
+  </object-type>
+  <object-type name="QAccessible">
+    <modify-function signature="initialize()" remove="all"/>
+    <modify-function signature="cleanup()" remove="all"/>
+    <modify-function signature="setRootObject(QObject *)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="queryAccessibleInterface(QObject *)">
+        <modify-argument index="return">
+            <define-ownership class="java" owner="java"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+  <object-type name="QAccessibleBridge">
+    <modify-function signature="setRootObject(QAccessibleInterface *)">
+        <modify-argument index="1">
+            <define-ownership class="shell" owner="java"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="notifyAccessibilityUpdate(int,QAccessibleInterface*,int)">
+        <modify-argument invalidate-after-use="yes" index="2"/>
+    </modify-function>
+  </object-type>
+  <object-type name="QAccessible2Interface"/>
+  <object-type name="QAccessibleTableInterface">
+    <modify-function signature="qAccessibleTableCastHelper()" remove="all"/>
+  
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QAccessibleTableInterface___" quote-before-line="}// class"/>
+        </inject-code>
+
+
+        <modify-function signature="cellAtIndex(int,int*,int*,int*,int*,bool*)">
+        <modify-argument index="2">
+            <remove-argument/>
+            <conversion-rule class="native">
+                int rowHolder;
+                int *%out = &amp;rowHolder;
+            </conversion-rule>
+            <conversion-rule class="shell">
+                // nothing
+            </conversion-rule>
+        </modify-argument>
+        <modify-argument index="3">
+            <remove-argument/>
+            <conversion-rule class="native">
+                int columnHolder;
+                int *%out = &amp;columnHolder;
+            </conversion-rule>
+            <conversion-rule class="shell">
+                // nothing
+            </conversion-rule>
+        </modify-argument>
+        <modify-argument index="4">
+            <remove-argument/>
+            <conversion-rule class="native">
+                int rowSpanHolder;
+                int *%out = &amp;rowSpanHolder;
+            </conversion-rule>
+            <conversion-rule class="shell">
+                // nothing
+            </conversion-rule>
+        </modify-argument>
+        <modify-argument index="5">
+            <remove-argument/>
+            <conversion-rule class="native">
+                int columnSpanHolder;
+                int *%out = &amp;columnSpanHolder;
+            </conversion-rule>
+            <conversion-rule class="shell">
+                // nothing
+            </conversion-rule>
+        </modify-argument>
+        <modify-argument index="6">
+            <remove-argument/>
+            <conversion-rule class="native">
+                bool isSelectedHolder = false;
+                bool *%out = &amp;isSelectedHolder;
+            </conversion-rule>
+            <conversion-rule class="shell">
+                // no conversion
+            </conversion-rule>
+        </modify-argument>
+        <modify-argument index="return">
+            <replace-type modified-type="qt.gui.QAccessibleTableInterface$CellAtIndex"/>
+            <conversion-rule class="native">
+                jobject %out = qtjambi_to_cellatindex(__jni_env, rowHolder, columnHolder, rowSpanHolder, columnSpanHolder, isSelectedHolder);
+            </conversion-rule>
+            <conversion-rule class="shell">
+                qtjambi_from_cellatindex(__jni_env, %in, %2, %3, %4, %5, %6);
+            </conversion-rule>
+        </modify-argument>
+        </modify-function>
+
+        <modify-function signature="selectedColumns(int,QList&lt;int&gt;*)">
+        <modify-argument index="2">
+            <replace-type modified-type="java.util.List&lt;Integer&gt;"/>
+            <conversion-rule class="shell">
+                StaticCache *sc = StaticCache::instance();
+                sc-&gt;resolveArrayList();
+                sc-&gt;resolveCollection();
+                sc-&gt;resolveInteger();
+
+                jobject columnsHolder = 0;
+                if (%in != 0) {
+                    columnsHolder = __jni_env-&gt;NewObject(sc-&gt;ArrayList.class_ref, sc-&gt;ArrayList.constructor, %in-&gt;size());
+                    qtjambi_exception_check(__jni_env);
+                    if (columnsHolder != 0) for (int i=0; i&lt;%in-&gt;size(); i++) {
+                        __jni_env-&gt;CallVoidMethod(columnsHolder, sc-&gt;Collection.add, qtjambi_from_int(__jni_env, %in-&gt;at(i)));
+                    }
+                    qtjambi_exception_check(__jni_env);
+                }
+                jobject %out = columnsHolder;
+            </conversion-rule>
+            <conversion-rule class="native">
+                StaticCache *sc = StaticCache::instance();
+                sc-&gt;resolveCollection();
+
+                QList&lt;int&gt; columnHolder;
+                if (%in != 0) {
+                    jobjectArray columnsAsArray = (jobjectArray) __jni_env-&gt;CallObjectMethod(%in, sc-&gt;Collection.toArray);
+                    if (columnsAsArray != 0) {
+                        int len = __jni_env-&gt;GetArrayLength(columnsAsArray);
+                        for (int i=0; i&lt;len; ++i) {
+                            columnHolder.append(qtjambi_to_int(__jni_env, __jni_env-&gt;GetObjectArrayElement(columnsAsArray, i)));
+                        }
+                    }
+                    qtjambi_exception_check(__jni_env);
+                }
+                QList&lt;int&gt; *%out = &amp;columnHolder;
+            </conversion-rule>
+        </modify-argument>
+        <modify-argument index="return">
+            <conversion-rule class="shell">
+                // Copy back
+                if (columnsHolder != 0) {
+                    jobjectArray columnsAsArray = (jobjectArray) __jni_env-&gt;CallObjectMethod(columnsHolder, sc-&gt;Collection.toArray);
+                    if (columnsAsArray != 0) {
+                        int len = __jni_env-&gt;GetArrayLength(columnsAsArray);
+                        %2-&gt;clear();
+                        for (int i=0; i&lt;len; ++i) {
+                            %2-&gt;append(qtjambi_to_int(__jni_env, __jni_env-&gt;GetObjectArrayElement(columnsAsArray, i)));
+                        }
+                    }
+                }
+
+                int %out = %in;
+            </conversion-rule>
+            <conversion-rule class="native">
+                // Copy back
+                if (%2 != 0) {
+                    __jni_env-&gt;CallVoidMethod(%2, sc-&gt;Collection.clear);
+                    for (int i=0; i&lt;columnHolder.size(); ++i) {
+                        __jni_env-&gt;CallVoidMethod(%2, sc-&gt;Collection.add, qtjambi_from_int(__jni_env, columnHolder.at(i)));
+                    }
+                    qtjambi_exception_check(__jni_env);
+                }
+
+                jint %out = %in;
+            </conversion-rule>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="selectedRows(int,QList&lt;int&gt;*)">
+        <modify-argument index="2">
+            <replace-type modified-type="java.util.List&lt;Integer&gt;"/>
+            <conversion-rule class="shell">
+                StaticCache *sc = StaticCache::instance();
+                sc-&gt;resolveArrayList();
+                sc-&gt;resolveCollection();
+                sc-&gt;resolveInteger();
+
+                jobject rowsHolder = 0;
+                if (%in != 0) {
+                    rowsHolder = __jni_env-&gt;NewObject(sc-&gt;ArrayList.class_ref, sc-&gt;ArrayList.constructor, %in-&gt;size());
+                    qtjambi_exception_check(__jni_env);
+                    if (rowsHolder != 0) for (int i=0; i&lt;%in-&gt;size(); i++) {
+                        __jni_env-&gt;CallVoidMethod(rowsHolder, sc-&gt;Collection.add, qtjambi_from_int(__jni_env, %in-&gt;at(i)));
+                    }
+                    qtjambi_exception_check(__jni_env);
+                }
+                jobject %out = rowsHolder;
+            </conversion-rule>
+            <conversion-rule class="native">
+                StaticCache *sc = StaticCache::instance();
+                sc-&gt;resolveCollection();
+
+                QList&lt;int&gt; rowsHolder;
+                if (%in != 0) {
+                    jobjectArray rowsAsArray = (jobjectArray) __jni_env-&gt;CallObjectMethod(%in, sc-&gt;Collection.toArray);
+                    if (rowsAsArray != 0) {
+                        int len = __jni_env-&gt;GetArrayLength(rowsAsArray);
+                        for (int i=0; i&lt;len; ++i) {
+                            rowsHolder.append(qtjambi_to_int(__jni_env, __jni_env-&gt;GetObjectArrayElement(rowsAsArray, i)));
+                        }
+                    }
+                    qtjambi_exception_check(__jni_env);
+                }
+                QList&lt;int&gt; *%out = &amp;rowsHolder;
+            </conversion-rule>
+        </modify-argument>
+        <modify-argument index="return">
+            <conversion-rule class="shell">
+                // Copy back
+                if (rowsHolder != 0) {
+                    jobjectArray rowsAsArray = (jobjectArray) __jni_env-&gt;CallObjectMethod(rowsHolder, sc-&gt;Collection.toArray);
+                    if (rowsAsArray != 0) {
+                        int len = __jni_env-&gt;GetArrayLength(rowsAsArray);
+                        %2-&gt;clear();
+                        for (int i=0; i&lt;len; ++i) {
+                            %2-&gt;append(qtjambi_to_int(__jni_env, __jni_env-&gt;GetObjectArrayElement(rowsAsArray, i)));
+                        }
+                    }
+                }
+
+                int %out = %in;
+            </conversion-rule>
+            <conversion-rule class="native">
+                // Copy back
+                if (%2 != 0) {
+                    __jni_env-&gt;CallVoidMethod(%2, sc-&gt;Collection.clear);
+                    for (int i=0; i&lt;rowsHolder.size(); ++i) {
+                        __jni_env-&gt;CallVoidMethod(%2, sc-&gt;Collection.add, qtjambi_from_int(__jni_env, rowsHolder.at(i)));
+                    }
+                    qtjambi_exception_check(__jni_env);
+                }
+
+                jint %out = %in;
+            </conversion-rule>
+        </modify-argument>
+        </modify-function>
+    </object-type>
+
+  <object-type name="QAccessibleInterface">
+    <modify-function signature="indexOfChild(const QAccessibleInterface*)const">
+        <modify-argument invalidate-after-use="yes" index="1"/>
+    </modify-function>
+    <modify-function signature="relationTo(int,const QAccessibleInterface*,int)const">
+        <modify-argument invalidate-after-use="yes" index="2"/>
+    </modify-function>
+  
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QAccessibleInterface___" quote-before-line="}// class"/>
+        </inject-code>
+
+
+        <template name="gui.accessible_interface_to_target">
+        jclass __target_class = resolveClass(__jni_env, "QAccessibleInterface$Target", "com/trolltech/qt/gui/");
+        QTJAMBI_EXCEPTION_CHECK(__jni_env);
+        Q_ASSERT(__target_class);
+
+        jmethodID __target_constructor = resolveMethod(__jni_env, "&lt;init&gt;", "(ILcom/trolltech/qt/gui/QAccessibleInterface;)V", "QAccessibleInterface$Target", "com/trolltech/qt/gui/");
+        QTJAMBI_EXCEPTION_CHECK(__jni_env);
+        Q_ASSERT(__target_constructor);
+
+        jobject __java_interface = %TARGET != 0 ? qtjambi_from_object(__jni_env, %TARGET, "QAccessibleInterface$ConcreteWrapper", "com/trolltech/qt/gui/", true) : 0;
+
+        jobject %OUTPUT = __jni_env-&gt;NewObject(__target_class, __target_constructor, %CHILD_INDEX, __java_interface);
+        </template>
+
+        <modify-function signature="navigate(QAccessible::RelationFlag,int,QAccessibleInterface**)const">
+            <modify-argument index="3">
+                <remove-argument/>
+                <conversion-rule class="shell">
+                    // nothing
+                </conversion-rule>
+                <conversion-rule class="native">
+                    QAccessibleInterface *__qt_interface = 0;
+                    QAccessibleInterface **%out = &amp;__qt_interface;
+                </conversion-rule>
+            </modify-argument>
+
+            <modify-argument index="0">
+                <replace-type modified-type="qt.gui.QAccessibleInterface$Target"/>
+                <conversion-rule class="native">
+                    <insert-template name="gui.accessible_interface_to_target">
+                        <replace from="%TARGET" to="__qt_interface"/>
+                        <replace from="%CHILD_INDEX" to="%in"/>
+                        <replace from="%OUTPUT" to="%out"/>
+                    </insert-template>
+                </conversion-rule>
+                <conversion-rule class="shell">
+                    jfieldID __childIndex_id = resolveField(__jni_env, "childIndex", "I", "QAccessibleInterface$Target", "com/trolltech/qt/gui/");
+                    Q_ASSERT(__childIndex_id);
+
+                    jfieldID __target_id = resolveField(__jni_env, "target", "Lcom/trolltech/qt/gui/QAccessibleInterface;", "QAccessibleInterface$Target", "com/trolltech/qt/gui/");
+                    Q_ASSERT(__target_id);
+
+                    jint %out = __jni_env-&gt;GetIntField(%in, __childIndex_id);
+
+                    jobject __java_interface = __jni_env-&gt;GetObjectField(%in, __target_id);
+                    QtJambiLink *__qt_link = __java_interface != 0 ? QtJambiLink::findLink(__jni_env, __java_interface) : 0;
+                    if (__qt_link != 0) __qt_link-&gt;disableGarbageCollection(__jni_env, __java_interface);
+                    QAccessibleInterface *__qt_interface = __qt_link != 0 ? (QAccessibleInterface *) __qt_link-&gt;pointer() : 0;
+
+                    if (%3 != 0) *%3 = __qt_interface;
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+    </object-type>
+  <object-type name="QAccessibleInterfaceEx"/>
+  <object-type name="QAccessibleObject"/>
+  <object-type name="QAccessibleObjectEx"/>
+  <object-type name="QAccessibleWidget"/>
+  <object-type name="QAccessibleWidgetEx"/>
+  <object-type name="QActionGroup">
+        <modify-function signature="addAction(QAction*)">
+            <modify-argument index="1">
+                <reference-count action="add" variable-name="__rcActions"/>
+            </modify-argument>
+<!--            <inject-code position="end">
+                <argument-map index="1" meta-name="%1"/>
+                qt.GeneratorUtilities.setField(%1, QAction.class, "__rcActionGroup", this);
+            </inject-code> -->
+        </modify-function>
+        <modify-function signature="removeAction(QAction*)">
+            <modify-argument index="1">
+                <reference-count action="remove" variable-name="__rcActions"/>
+            </modify-argument>
+<!--            <inject-code position="end">
+                <argument-map index="1" meta-name="%1"/>
+                qt.GeneratorUtilities.setField(%1, QAction.class, "__rcActionGroup", null);
+            </inject-code> -->
+        </modify-function>
+    </object-type>
+  <object-type name="QCDEStyle">
+      <modify-function signature="standardIconImplementation(QStyle::StandardPixmap, const QStyleOption *, const QWidget *)const" virtual-slot="yes"/>
+  </object-type>
+  <object-type name="QCheckBox">
+<!--    <modify-function signature="initStyleOption(QStyleOptionButton*)const">
+        <access modifier="private"/>
+    </modify-function>
+  
+        <inject-code>
+            <insert-template name="gui.init_style_option">
+                <replace from="%TYPE" to="QStyleOptionButton"/>
+            </insert-template>
+        </inject-code> -->
+    </object-type>
+  <object-type name="QCleanlooksStyle">
+    <modify-function signature="standardPixmap(QStyle::StandardPixmap,const QStyleOption*,const QWidget*)const" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="standardIconImplementation(QStyle::StandardPixmap, const QStyleOption *, const QWidget *)const" virtual-slot="yes"/>
+  </object-type>
+  <object-type name="QCommonStyle">
+      <modify-function signature="standardPixmap(QStyle::StandardPixmap, const QStyleOption*,const QWidget*)const" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="standardIconImplementation(QStyle::StandardPixmap, const QStyleOption *, const QWidget *)const" virtual-slot="yes"/>
+  </object-type>
+  <object-type name="QDataWidgetMapper">
+    <modify-function signature="addMapping(QWidget*,int)">
+        <modify-argument index="1">
+            <reference-count action="add" variable-name="__rcMappings"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="addMapping(QWidget*,int,QByteArray)">
+        <modify-argument index="1">
+            <reference-count action="add" variable-name="__rcMappings"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="removeMapping(QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="remove" variable-name="__rcMappings"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setItemDelegate(QAbstractItemDelegate*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcItemDelegate"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setModel(QAbstractItemModel*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcModel"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+  <object-type name="QDateEdit"/>
+  <object-type name="QDesktopServices">
+    <modify-function signature="setUrlHandler(const QString &amp;, QObject *, const char *)" access="private">
+        <modify-argument index="2">
+            <reference-count action="ignore"/> <!-- Handled in injected code -->
+        </modify-argument>
+    </modify-function>
+  
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QDesktopServices___" quote-before-line="}// class"/>
+        </inject-code>
+
+    </object-type>
+  <object-type name="QDialog">
+<!--     <modify-function signature="setVisible(bool)" remove="all"/> // properties_d -->
+
+    <modify-function signature="setExtension(QWidget*)" remove="all"/>
+    <modify-function signature="exec()" access="non-final"/>
+    <modify-function signature="extension()const" remove="all"/> <!--### Obsolete in 4.3-->
+    <modify-function signature="orientation()const" remove="all"/> <!--### Obsolete in 4.3-->
+    <modify-function signature="setOrientation(Qt::Orientation)" remove="all"/> <!--### Obsolete in 4.3-->
+    <modify-function signature="showExtension(bool)" remove="all"/> <!--### Obsolete in 4.3-->
+  </object-type>
+  <object-type name="QDialogButtonBox">
+    <modify-function signature="addButton(QAbstractButton*,QDialogButtonBox::ButtonRole)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="removeButton(QAbstractButton*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+  <object-type name="QDirModel">
+    <modify-function signature="parent()const" remove="java"/>
+    <modify-function signature="setIconProvider(QFileIconProvider*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcIconProvider"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+  <object-type name="QDoubleValidator"/>
+  <object-type name="QFileIconProvider"/>
+  <object-type name="QWizard">
+    <!-- ### Requires correct class name in meta object -->
+    <modify-function signature="setDefaultProperty(const char *, const char *, const char *)" remove="all"/>
+    <modify-function signature="addPage(QWizardPage*)">
+        <modify-argument index="1">
+            <no-null-pointer/>
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setButton(QWizard::WizardButton,QAbstractButton*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setPage(int,QWizardPage*)">
+        <modify-argument index="2">
+            <no-null-pointer/>
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+
+  </object-type>
+  <object-type name="QWizardPage">
+    <!-- ### Reduced functionality due to meta object having missing information -->
+    <modify-function signature="registerField(const QString &amp;, QWidget *, const char *, const char *)">
+        <access modifier="private"/>
+        <modify-argument index="3">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="4">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+
+  
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QWizardPage___" quote-before-line="}// class"/>
+        </inject-code>
+
+    </object-type>
+  <object-type name="QFocusFrame">
+    <modify-function signature="initStyleOption(QStyleOption*)const">
+        <access modifier="private"/>
+    </modify-function>
+    <modify-function signature="setWidget(QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcWidget"/>
+        </modify-argument>
+    </modify-function>
+    <inject-code>
+        <insert-template name="gui.init_style_option">
+            <replace from="%TYPE" to="QStyleOption"/>
+        </insert-template>
+    </inject-code>
+  </object-type>
+  <object-type name="QFontComboBox"/>
+  <object-type name="QFontDialog">
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QFontDialog___" quote-before-line="}// class"/>
+        </inject-code>
+
+        <template name="gui.fontdialog_get_font_general">
+            public static Result getFont(%FONT_ARGUMENT %COMMA QWidget parent %STRING_ARGUMENT) {
+                QNativePointer np = new QNativePointer(QNativePointer.Type.Boolean);
+                QFont returned = getFont(np, %FONT_CALL_ARGUMENT %COMMA parent %STRING_CALL_ARGUMENT);
+                return new Result(returned, np.booleanValue());
+            }
+        </template>
+
+        <template name="gui.fontdialog_get_font_nocaption">
+            <insert-template name="gui.fontdialog_get_font_general">
+                <replace from="%STRING_ARGUMENT" to=""/>
+                <replace from="%STRING_CALL_ARGUMENT" to=""/>
+            </insert-template>
+
+            public static Result getFont(%FONT_ARGUMENT) {
+                return getFont(%FONT_CALL_ARGUMENT %COMMA (QWidget) null);
+            }
+        </template>
+
+        <modify-function signature="getFont(bool*,QFont,QWidget*,QString)">
+            <access modifier="private"/>
+        </modify-function>
+        <inject-code>
+            <insert-template name="gui.fontdialog_get_font_general">
+                <replace from="%FONT_ARGUMENT %COMMA" to="QFont initial,"/>
+                <replace from="%STRING_ARGUMENT" to=", String caption"/>
+                <replace from="%FONT_CALL_ARGUMENT %COMMA" to="initial,"/>
+                <replace from="%STRING_CALL_ARGUMENT" to=", caption"/>
+            </insert-template>
+        </inject-code>
+
+        <modify-function signature="getFont(bool*,QWidget*)">
+            <access modifier="private"/>
+            <modify-argument index="2">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+        <inject-code>
+            <insert-template name="gui.fontdialog_get_font_nocaption">
+                <replace from="%FONT_ARGUMENT" to=""/>
+                <replace from="%COMMA" to=""/>
+                <replace from="%FONT_CALL_ARGUMENT" to=""/>
+            </insert-template>
+        </inject-code>
+
+        <modify-function signature="getFont(bool*,QFont,QWidget*)">
+            <access modifier="private"/>
+            <modify-argument index="3">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+        <inject-code>
+            <insert-template name="gui.fontdialog_get_font_nocaption">
+                <replace from="%FONT_ARGUMENT" to="QFont initial"/>
+                <replace from="%COMMA" to=", "/>
+                <replace from="%FONT_CALL_ARGUMENT" to="initial"/>
+            </insert-template>
+        </inject-code>
+    </object-type>
+  <object-type name="QGraphicsEllipseItem" delete-in-main-thread="yes">
+  	<modify-function signature="setExtension(QGraphicsItem::Extension,QVariant)" remove="all"/>
+	<modify-function signature="supportsExtension(QGraphicsItem::Extension)const" remove="all"/>
+  <!--
+        <modify-function signature="QGraphicsEllipseItem(QGraphicsItem*,QGraphicsScene*)">
+            <inject-code position="end">
+                <argument-map index="1" meta-name="%1"/>
+                if (%1 != null) disableGarbageCollection();
+            </inject-code>
+        </modify-function>
+        <modify-function signature="QGraphicsEllipseItem(const QRectF &amp;,QGraphicsItem*,QGraphicsScene*)">
+            <inject-code position="end">
+                <argument-map index="2" meta-name="%2"/>
+                if (%2 != null) disableGarbageCollection();
+            </inject-code>
+        </modify-function>
+        <modify-function signature="QGraphicsEllipseItem(double,double,double,double,QGraphicsItem*,QGraphicsScene*)">
+            <inject-code position="end">
+                <argument-map index="5" meta-name="%5"/>
+                if (%5 != null) disableGarbageCollection();
+            </inject-code>
+        </modify-function>-->
+    </object-type>
+  <object-type name="QGraphicsItemAnimation">
+    <modify-function signature="setItem(QGraphicsItem*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcItem"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setTimeLine(QTimeLine*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcTimeLine"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+  <object-type name="QGraphicsItemGroup" delete-in-main-thread="yes">
+      <modify-function signature="matrix()const" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="resetMatrix()" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="sceneMatrix()const" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="setMatrix(QMatrix, bool)" remove="all"/> <!--### Obsolete in 4.3-->
+  <!--
+        <modify-function signature="QGraphicsItemGroup(QGraphicsItem*,QGraphicsScene*)">
+            <inject-code position="end">
+                <argument-map index="1" meta-name="%1"/>
+                if (%1 != null) disableGarbageCollection();
+            </inject-code>
+        </modify-function>
+        <modify-function signature="addToGroup(QGraphicsItem*)">
+            <modify-argument index="1">
+                <define-ownership class="java" owner="c++"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="removeFromGroup(QGraphicsItem*)">
+            <modify-argument index="1">
+                <reference-count action="ignore"/>
+            </modify-argument>
+            <inject-code position="end">
+                <argument-map index="1" meta-name="%1"/>
+                if (parentItem() == null)
+                %1.reenableGarbageCollection();
+            </inject-code>
+        </modify-function>
+    -->
+    </object-type>
+  <object-type name="QGraphicsLineItem" delete-in-main-thread="yes">
+      <modify-function signature="matrix()const" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="resetMatrix()" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="sceneMatrix()const" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="setMatrix(QMatrix, bool)" remove="all"/> <!--### Obsolete in 4.3-->
+      	<modify-function signature="setExtension(QGraphicsItem::Extension,QVariant)" remove="all"/>
+	<modify-function signature="supportsExtension(QGraphicsItem::Extension)const" remove="all"/>
+    <!--
+        <modify-function signature="QGraphicsLineItem(QGraphicsItem*,QGraphicsScene*)">
+            <inject-code position="end">
+                <argument-map index="1" meta-name="%1"/>
+                if (%1 != null) disableGarbageCollection();
+            </inject-code>
+        </modify-function>
+        <modify-function signature="QGraphicsLineItem(const QLineF &amp;,QGraphicsItem*,QGraphicsScene*)">
+            <inject-code position="end">
+                <argument-map index="2" meta-name="%2"/>
+                if (%2 != null) disableGarbageCollection();
+            </inject-code>
+        </modify-function>
+        <modify-function signature="QGraphicsLineItem(double,double,double,double,QGraphicsItem*,QGraphicsScene*)">
+            <inject-code position="end">
+                <argument-map index="5" meta-name="%5"/>
+                if (%5 != null) disableGarbageCollection();
+            </inject-code>
+        </modify-function>
+    -->
+    </object-type>
+  <object-type name="QGraphicsPathItem" delete-in-main-thread="yes">
+  	<modify-function signature="setExtension(QGraphicsItem::Extension,QVariant)" remove="all"/>
+	<modify-function signature="supportsExtension(QGraphicsItem::Extension)const" remove="all"/>
+  <!--
+        <modify-function signature="QGraphicsPathItem(QGraphicsItem*,QGraphicsScene*)">
+            <inject-code position="end">
+                <argument-map index="1" meta-name="%1"/>
+                if (%1 != null) disableGarbageCollection();
+            </inject-code>
+        </modify-function>
+        <modify-function signature="QGraphicsPathItem(const QPainterPath &amp;,QGraphicsItem*,QGraphicsScene*)">
+            <inject-code position="end">
+                <argument-map index="2" meta-name="%2"/>
+                if (%2 != null) disableGarbageCollection();
+            </inject-code>
+        </modify-function>
+    -->
+    </object-type>
+
+  <object-type name="QGraphicsPixmapItem" delete-in-main-thread="yes">
+      <modify-function signature="matrix()const" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="resetMatrix()" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="sceneMatrix()const" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="setMatrix(QMatrix, bool)" remove="all"/> <!--### Obsolete in 4.3-->
+      	<modify-function signature="setExtension(QGraphicsItem::Extension,QVariant)" remove="all"/>
+	<modify-function signature="supportsExtension(QGraphicsItem::Extension)const" remove="all"/>
+    <!--
+        <modify-function signature="QGraphicsPixmapItem(QGraphicsItem*,QGraphicsScene*)">
+            <inject-code position="end">
+                <argument-map index="1" meta-name="%1"/>
+                if (%1 != null) disableGarbageCollection();
+            </inject-code>
+        </modify-function>
+        <modify-function signature="QGraphicsPixmapItem(const QPixmap &amp;,QGraphicsItem*,QGraphicsScene*)">
+            <inject-code position="end">
+                <argument-map index="2" meta-name="%2"/>
+                if (%2 != null) disableGarbageCollection();
+            </inject-code>
+        </modify-function>
+    -->
+    </object-type>
+  <object-type name="QGraphicsPolygonItem" delete-in-main-thread="yes">
+  	<modify-function signature="setExtension(QGraphicsItem::Extension,QVariant)" remove="all"/>
+	<modify-function signature="supportsExtension(QGraphicsItem::Extension)const" remove="all"/>
+    <!--
+        <modify-function signature="QGraphicsPolygonItem(QGraphicsItem*,QGraphicsScene*)">
+            <inject-code position="end">
+                <argument-map index="1" meta-name="%1"/>
+                if (%1 != null) disableGarbageCollection();
+            </inject-code>
+        </modify-function>
+        <modify-function signature="QGraphicsPolygonItem(const QPolygonF &amp;,QGraphicsItem*,QGraphicsScene*)">
+            <inject-code position="end">
+                <argument-map index="2" meta-name="%2"/>
+                if (%2 != null) disableGarbageCollection();
+            </inject-code>
+        </modify-function>
+    -->
+    </object-type>
+  <object-type name="QGraphicsRectItem" delete-in-main-thread="yes">
+  	<modify-function signature="setExtension(QGraphicsItem::Extension,QVariant)" remove="all"/>
+	<modify-function signature="supportsExtension(QGraphicsItem::Extension)const" remove="all"/>
+  <!--
+        <modify-function signature="QGraphicsRectItem(QGraphicsItem*,QGraphicsScene*)">
+            <inject-code position="end">
+                <argument-map index="1" meta-name="%1"/>
+                if (%1 != null) disableGarbageCollection();
+            </inject-code>
+        </modify-function>
+        <modify-function signature="QGraphicsRectItem(double,double,double,double,QGraphicsItem*,QGraphicsScene*)">
+            <inject-code position="end">
+                <argument-map index="5" meta-name="%5"/>
+                if (%5 != null) disableGarbageCollection();
+            </inject-code>
+        </modify-function>
+        <modify-function signature="QGraphicsRectItem(const QRectF &amp;,QGraphicsItem*,QGraphicsScene*)">
+            <inject-code position="end">
+                <argument-map index="2" meta-name="%2"/>
+                if (%2 != null) disableGarbageCollection();
+            </inject-code>
+        </modify-function> -->
+    </object-type>
+  <object-type name="QGraphicsSimpleTextItem" delete-in-main-thread="yes">
+  	<modify-function signature="setExtension(QGraphicsItem::Extension,QVariant)" remove="all"/>
+	<modify-function signature="supportsExtension(QGraphicsItem::Extension)const" remove="all"/>
+    <!--
+        <modify-function signature="QGraphicsSimpleTextItem(QGraphicsItem*,QGraphicsScene*)">
+            <inject-code position="end">
+                <argument-map index="1" meta-name="%1"/>
+                if (%1 != null) disableGarbageCollection();
+            </inject-code>
+        </modify-function>
+        <modify-function signature="QGraphicsSimpleTextItem(const QString &amp;,QGraphicsItem*,QGraphicsScene*)">
+            <inject-code position="end">
+                <argument-map index="2" meta-name="%2"/>
+                if (%2 != null) disableGarbageCollection();
+            </inject-code>
+        </modify-function>
+    -->
+    </object-type>
+  <object-type name="QHBoxLayout"/>
+  <object-type name="QHeaderView">
+<!--    <modify-function signature="initStyleOption(QStyleOptionHeader*)const">
+        <access modifier="private"/>
+    </modify-function>
+-->
+    <modify-function signature="paintSection(QPainter*,QRect,int)const">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+<!--
+    <inject-code>
+        <insert-template name="gui.init_style_option">
+            <replace from="%TYPE" to="QStyleOptionHeader"/>
+        </insert-template>
+    </inject-code>-->
+    <modify-function signature="setModel(QAbstractItemModel*)">
+        <modify-argument index="1">
+            <reference-count declare-variable="QAbstractItemView" action="set" variable-name="__rcItemModel"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+  <object-type name="QIconEngine">
+    <modify-function signature="paint(QPainter*,QRect,QIcon::Mode,QIcon::State)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+  </object-type>
+  <object-type name="QIconEngineV2">
+        <extra-includes>
+            <include file-name="qt.core.QSize" location="java"/>
+        </extra-includes>
+    <modify-function signature="read(QDataStream&amp;)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="write(QDataStream&amp;)const">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+
+    <modify-function signature="virtual_hook(int,void*)" remove="all"/>
+
+    <modify-function signature="clone()const">
+        <remove class="java"/>
+<!--        <modify-argument index="return">
+            <define-ownership class="shell" owner="c++"/>
+        </modify-argument>-->
+    </modify-function>
+	
+    <inject-code>
+        <import-file name="typesystem_gui-java.java" quote-after-line="class QIconEngineV2___" quote-before-line="}// class"/>
+    </inject-code>
+  </object-type>
+  <object-type name="QImageWriter">
+  <modify-function signature="setDevice(QIODevice*)">
+    <modify-argument index="1">
+        <reference-count action="set" variable-name="__rcDevice"/>
+    </modify-argument>
+  </modify-function>
+      <modify-function signature="description()const" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="setDescription(QString)" remove="all"/> <!--### Obsolete in 4.3-->
+  </object-type>
+  <object-type name="QInputContextFactory"/>
+  <object-type name="QIntValidator"/>
+  <object-type name="QItemDelegate">
+    <modify-function signature="doLayout(QStyleOptionViewItem,QRect*,QRect*,QRect*,bool)const">
+        <remove/>
+    </modify-function>
+
+    <modify-function signature="drawCheck(QPainter*,QStyleOptionViewItem,QRect,Qt::CheckState)const">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="drawDecoration(QPainter*,QStyleOptionViewItem,QRect,QPixmap)const">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="drawDisplay(QPainter*,QStyleOptionViewItem,QRect,QString)const">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="drawFocus(QPainter*,QStyleOptionViewItem,QRect)const">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+
+
+    <modify-function signature="selected(QPixmap,QPalette,bool)const">
+        <remove/>
+    </modify-function>
+    <modify-function signature="setItemEditorFactory(QItemEditorFactory*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcItemEditorFactory"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setEditorData(QWidget*,QModelIndex)const">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setModelData(QWidget*,QAbstractItemModel*,QModelIndex)const">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+
+  </object-type>
+  <object-type name="QItemEditorCreatorBase"/>
+  <object-type name="QItemEditorFactory">
+    <modify-function signature="registerEditor(QVariant::Type, QItemEditorCreatorBase *)">
+        <modify-argument index="2">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setDefaultFactory(QItemEditorFactory *)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcDefaultItemEditorFactory"/>
+        </modify-argument>
+    </modify-function>
+  
+        <modify-function signature="setDefaultFactory(QItemEditorFactory*)">
+            <modify-argument index="1">
+                <define-ownership class="java" owner="c++"/>
+            </modify-argument>
+        </modify-function>
+    </object-type>
+  <object-type name="QItemSelectionModel"/>
+  <object-type name="QTreeModel"/>
+  <object-type name="QListView"/>
+  <object-type name="QColumnView">
+    <modify-function signature="setPreviewWidget(QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setModel(QAbstractItemModel*)">
+        <modify-argument index="1">
+            <reference-count declare-variable="QAbstractItemView" action="set" variable-name="__rcItemModel"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setSelectionModel(QItemSelectionModel*)">
+        <modify-argument index="1">
+            <no-null-pointer/>
+            <reference-count declare-variable="QAbstractItemView" action="set" variable-name="__rcItemSelectionModel"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+  <object-type name="QMainWindow">
+    <modify-function signature="addDockWidget(Qt::DockWidgetArea,QDockWidget*,Qt::Orientation)">
+        <modify-argument index="2">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="addDockWidget(Qt::DockWidgetArea,QDockWidget*)">
+        <modify-argument index="2">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="addToolBar(QToolBar*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="addToolBar(Qt::ToolBarArea,QToolBar*)">
+        <modify-argument index="2">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertToolBar(QToolBar*,QToolBar*)">
+        <modify-argument index="2">
+            <reference-count action="ignore"/>
+        </modify-argument>
+        <modify-argument index="2">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertToolBarBreak(QToolBar*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="removeDockWidget(QDockWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="removeToolBar(QToolBar*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="removeToolBarBreak(QToolBar*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setCentralWidget(QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setMenuBar(QMenuBar*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setMenuWidget(QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setStatusBar(QStatusBar*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+
+  </object-type>
+  <object-type name="QMdiArea">
+    <modify-function signature="addSubWindow(QWidget*,QFlags&lt;Qt::WindowType&gt;)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="removeSubWindow(QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="setActiveSubWindow(QMdiSubWindow*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="setupViewport(QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+
+  </object-type>
+  <object-type name="QMdiSubWindow">
+    <modify-function signature="setSystemMenu(QMenu*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setWidget(QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+  <object-type name="QMenu">
+    <modify-function signature="addAction(QAction *)" remove="all"/>
+    <modify-function signature="addMenu(QMenu*)">
+        <modify-argument index="1">
+            <reference-count action="add" variable-name="__rcMenus"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertMenu(QAction*,QMenu*)">
+        <modify-argument index="2">
+            <reference-count action="add" variable-name="__rcMenus"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertSeparator(QAction*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setActiveAction(QAction*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setDefaultAction(QAction*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setNoReplayFor(QWidget*)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="initStyleOption(QStyleOptionMenuItem*,const QAction*)const">
+        <access modifier="private"/>
+    </modify-function>
+
+    <modify-function signature="addAction(QString,const QObject*,const char*,QKeySequence)">
+        <remove/>
+    </modify-function>
+
+    <modify-function signature="addAction(QIcon,QString,const QObject*,const char*,QKeySequence)">
+        <remove/>
+    </modify-function>
+  
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QMenu___" quote-before-line="}// class"/>
+        </inject-code>
+
+<!--
+        <template name="gui.addAction">
+        public final QAction addAction(%EXTRA String text, Object receiver, String method %END_EXTRA) {
+            QAction returned = addAction(%CALL_EXTRA text %END_CALL_EXTRA);
+            %POST_CALL
+            returned.triggered.connect(receiver, method);
+
+            return returned;
+        }
+
+        public final QAction addAction(%EXTRA String text, qt.QSignalEmitter.AbstractSignal signal %END_EXTRA) {
+            QAction returned = addAction(%CALL_EXTRA text %END_CALL_EXTRA);
+            %POST_CALL
+            returned.triggered.connect(signal);
+            return returned;
+        }
+        </template>
+
+        <template name="gui.addAction_with_shortcut">
+            <insert-template name="gui.addAction">
+                <replace from="%POST_CALL" to="returned.setShortcut(shortcut);"/>
+                <replace from=" %END_EXTRA" to=", QKeySequence shortcut"/>
+                <replace from=" %END_CALL_EXTRA" to=""/>
+            </insert-template>
+
+        public final QAction addAction(%EXTRA String text, Object receiver, String method) {
+            return addAction(%CALL_EXTRA text, receiver, method, new QKeySequence(0));
+        }
+
+        public final QAction addAction(%EXTRA String text, qt.QSignalEmitter.AbstractSignal signal) {
+            return addAction(%CALL_EXTRA text, signal, new QKeySequence(0));
+        }
+        </template>
+
+        <inject-code>
+            <insert-template name="gui.addAction_with_shortcut">
+                <replace from="%EXTRA " to=""/>
+                <replace from="%CALL_EXTRA " to=""/>
+            </insert-template>
+        </inject-code>
+
+        <inject-code>
+            <insert-template name="gui.addAction_with_shortcut">
+                <replace from="%EXTRA" to="QIcon icon,"/>
+                <replace from="%CALL_EXTRA" to="icon,"/>
+            </insert-template>
+        </inject-code>-->
+    </object-type>
+
+  <object-type name="QMenuBar">
+    <modify-function signature="addAction(QAction *)" remove="all"/>
+    <modify-function signature="addAction(QString,const QObject*,const char*)">
+        <remove/>
+    </modify-function>
+
+    <modify-function signature="addMenu(QMenu*)">
+        <modify-argument index="1">
+            <reference-count action="add" variable-name="__rcMenus"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertMenu(QAction*,QMenu*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+        <modify-argument index="2">
+            <reference-count action="add" variable-name="__rcMenus"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertSeparator(QAction*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setActiveAction(QAction*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setCornerWidget(QWidget*,Qt::Corner)    ">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+  
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QMenuBar___" quote-before-line="}// class"/>
+        </inject-code>
+        <inject-code>
+            <insert-template name="gui.addAction">
+                <replace from="%POST_CALL" to=""/>
+                <replace from=" %END_EXTRA" to=""/>
+                <replace from=" %END_CALL_EXTRA" to=""/>
+                <replace from="%EXTRA " to=""/>
+                <replace from="%CALL_EXTRA " to=""/>
+            </insert-template>
+        </inject-code>
+
+
+    </object-type>
+  <object-type name="QMotifStyle">
+    <modify-function signature="standardPixmap(QStyle::StandardPixmap, const QStyleOption*, const QWidget*)const" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="standardIconImplementation(QStyle::StandardPixmap, const QStyleOption *, const QWidget *)const" virtual-slot="yes"/>
+  </object-type>
+  <object-type name="QPainterPathStroker"/>
+
+  <object-type name="QPictureIO">
+      <modify-function signature="QPictureIO(QIODevice*,const char*)">
+        <access modifier="private"/>
+         <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcDevice"/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="setIODevice(QIODevice*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcDevice"/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="QPictureIO(QString,const char*)">
+        <access modifier="private"/>
+    </modify-function>
+
+    <modify-function signature="format()const">
+        <access modifier="private"/>
+        <rename to="format_private"/>
+    </modify-function>
+
+    <modify-function signature="parameters()const">
+        <access modifier="private"/>
+        <rename to="parameters_private"/>
+    </modify-function>
+
+    <modify-function signature="setFormat(const char*)">
+        <access modifier="private"/>
+    </modify-function>
+
+    <modify-function signature="setParameters(const char*)">
+        <access modifier="private"/>
+    </modify-function>
+
+  
+        <extra-includes>
+            <include file-name="qt.QNativePointer" location="java"/>
+        </extra-includes>
+        <inject-code>
+        public QPictureIO(qt.core.QIODevice ioDevice, String format) {
+            this(ioDevice, QNativePointer.createCharPointer(format));
+        }
+
+        public QPictureIO(String fileName, String format) {
+            this(fileName, QNativePointer.createCharPointer(format));
+        }
+
+            <insert-template name="core.return_string_instead_of_char*">
+                <replace from="%FUNCTION_NAME" to="format"/>
+            </insert-template>
+            <insert-template name="core.return_string_instead_of_char*">
+                <replace from="%FUNCTION_NAME" to="parameters"/>
+            </insert-template>
+            <insert-template name="core.call_with_string_instead_of_char*">
+                <replace from="%FUNCTION_NAME" to="setFormat"/>
+                <replace from="%ARG_NAME" to="format"/>
+            </insert-template>
+            <insert-template name="core.call_with_string_instead_of_char*">
+                <replace from="%FUNCTION_NAME" to="setParameters"/>
+                <replace from="%ARG_NAME" to="parameters"/>
+            </insert-template>
+        </inject-code>
+    </object-type>
+
+  <object-type name="QPixmapCache">
+    <modify-function signature="find(QString)">
+        <remove/>
+    </modify-function>
+
+    <modify-function signature="find(QString,QPixmap&amp;)">
+        <access modifier="private"/>
+    </modify-function>
+  
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QPixmapCache___" quote-before-line="}// class"/>
+        </inject-code>
+
+    </object-type>
+  <object-type name="QPlastiqueStyle">
+    <modify-function signature="standardPixmap(QStyle::StandardPixmap, const QStyleOption*, const QWidget*)const" remove="all"/> <!--### Obsolete in 4.3-->
+    <modify-function signature="standardIconImplementation(QStyle::StandardPixmap, const QStyleOption *, const QWidget *)const" virtual-slot="yes"/>
+    <modify-function signature="layoutSpacingImplementation(QSizePolicy::ControlType, QSizePolicy::ControlType, Qt::Orientation, const QStyleOption *, const QWidget *) const" virtual-slot="yes"/>
+  </object-type>
+  <object-type name="QPrintDialog"/>
+  <object-type name="QPrintEngine"/>
+  <object-type name="QProgressBar">
+    <modify-function signature="initStyleOption(QStyleOptionProgressBar*)const">
+        <access modifier="private"/>
+    </modify-function>
+  
+        <inject-code>
+            <insert-template name="gui.init_style_option">
+                <replace from="%TYPE" to="QStyleOptionProgressBar"/>
+            </insert-template>
+        </inject-code>
+    </object-type>
+  <object-type name="QPushButton">
+<!--    <modify-function signature="initStyleOption(QStyleOptionButton*)const">
+        <access modifier="private"/>
+    </modify-function>
+-->
+<!--     <modify-function signature="setDefault(bool)" rename="default_"/> // properties_d -->
+
+
+    <modify-function signature="setMenu(QMenu*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcMenu"/>
+        </modify-argument>
+    </modify-function>
+  <!--
+        <inject-code>
+            <insert-template name="gui.init_style_option">
+                <replace from="%TYPE" to="QStyleOptionButton"/>
+            </insert-template>
+        </inject-code> -->
+    </object-type>
+  <object-type name="QRegExpValidator"/>
+  <object-type name="QScrollArea">
+    <modify-function signature="setWidget(QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+  <object-type name="QSessionManager"/>
+  <object-type name="QShortcut">
+    <modify-function signature="QShortcut(QKeySequence,QWidget*,const char*,const char*,Qt::ShortcutContext)">
+        <access modifier="private"/>
+        <modify-argument index="3">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="4">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="5">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+  
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QShortcut___" quote-before-line="}// class"/>
+        </inject-code>
+
+    </object-type>
+  <object-type name="QSizeGrip"/>
+  <object-type name="QSound"/>
+  <object-type name="QSpacerItem">
+  </object-type>
+  <object-type name="QStandardItem">
+    <modify-function signature="operator=(QStandardItem)" remove="all"/>
+    <modify-function signature="operator&lt;(QStandardItem)const">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="read(QDataStream&amp;)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="write(QDataStream&amp;)const">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+
+  
+        <modify-function signature="appendColumn(const QList&lt;QStandardItem *&gt; &amp;)">
+            <modify-argument index="1">
+                <define-ownership class="java" owner="c++"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="appendRow(const QList&lt;QStandardItem *&gt; &amp;)">
+            <modify-argument index="1">
+                <define-ownership class="java" owner="c++"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="appendRow(QStandardItem *)">
+            <modify-argument index="1">
+                <define-ownership class="java" owner="c++"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="insertColumn(int, const QList&lt;QStandardItem *&gt; &amp;)">
+            <modify-argument index="2">
+                <define-ownership class="java" owner="c++"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="insertRow(int, const QList&lt;QStandardItem *&gt; &amp;)">
+            <modify-argument index="2">
+                <define-ownership class="java" owner="c++"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="insertRow(int, QStandardItem *)">
+            <modify-argument index="2">
+                <define-ownership class="java" owner="c++"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="setChild(int,int,QStandardItem *)">
+            <modify-argument index="3">
+                <define-ownership class="java" owner="c++"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="setChild(int,QStandardItem *)">
+            <modify-argument index="2">
+                <define-ownership class="java" owner="c++"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="takeChild(int,int)">
+            <modify-argument index="return">
+                <define-ownership class="java" owner="default"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="takeColumn(int)">
+            <modify-argument index="return">
+                <define-ownership class="java" owner="default"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="takeRow(int)">
+            <modify-argument index="return">
+                <define-ownership class="java" owner="default"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="clone()const">
+            <modify-argument index="return">
+                <define-ownership class="shell" owner="c++"/>
+            </modify-argument>
+        </modify-function>
+    </object-type>
+  <object-type name="QStatusBar">
+    <modify-function signature="addPermanentWidget(QWidget *, int)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="addWidget(QWidget *, int)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="removeWidget(QWidget *)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertPermanentWidget(int, QWidget *, int)">
+        <modify-argument index="2">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertWidget(int, QWidget *, int)">
+        <modify-argument index="2">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+  <object-type name="QStringListModel"/>
+  <object-type name="QStyleFactory"/>
+  <object-type name="QStyleHintReturn">
+        <modify-field name="version">
+          <rename to="version_"/>
+      </modify-field>
+  </object-type>
+  <object-type name="QStyleHintReturnVariant"/>
+  <object-type name="QStyleHintReturnMask"/>
+  <object-type name="QStylePainter" delete-in-main-thread="yes"/>
+  <object-type name="QSyntaxHighlighter">
+    <modify-function signature="setCurrentBlockUserData(QTextBlockUserData*)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setDocument(QTextDocument*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcDocument"/>
+        </modify-argument>
+    </modify-function>
+
+  </object-type>
+  <object-type name="QSystemTrayIcon">
+    <modify-function signature="setContextMenu(QMenu*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcContextMenu"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+  <object-type name="QTableView">
+    <modify-function signature="setHorizontalHeader(QHeaderView*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setVerticalHeader(QHeaderView*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setModel(QAbstractItemModel*)">
+        <modify-argument index="1">
+            <reference-count declare-variable="QAbstractItemView" action="set" variable-name="__rcItemModel"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setSelectionModel(QItemSelectionModel*)">
+        <modify-argument index="1">
+            <no-null-pointer/>
+            <reference-count declare-variable="QAbstractItemView" action="set" variable-name="__rcItemSelectionModel"/>
+        </modify-argument>
+    </modify-function>
+
+      <modify-function signature="sortByColumn(int)" remove="all"/> <!--### Obsolete in 4.3-->
+  </object-type>
+  <object-type name="QTextBlockGroup" delete-in-main-thread="yes"/>
+  <object-type name="QTextBlockUserData" delete-in-main-thread="yes"/>
+  <object-type name="QTextItem" delete-in-main-thread="yes"/>
+  <object-type name="QTextList" delete-in-main-thread="yes">
+    <modify-function signature="format()const" rename="textListFormat"/>
+
+      <modify-function signature="isEmpty()const" remove="all"/> <!--### Obsolete in 4.3-->
+  </object-type>
+  <object-type name="QTextObject" delete-in-main-thread="yes"/>
+  <object-type name="QTextObjectInterface" delete-in-main-thread="yes">
+    <modify-function signature="drawObject(QPainter*,QRectF,QTextDocument*,int,QTextFormat)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+  </object-type>
+  <object-type name="QTimeEdit"/>
+  <object-type name="QToolBox">
+    <modify-function signature="addItem(QWidget*,QString)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="addItem(QWidget*,QIcon,QString)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertItem(int,QWidget*,QIcon,QString)">
+        <modify-argument index="2">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertItem(int,QWidget*,QString)">
+        <modify-argument index="2">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setCurrentWidget(QWidget*)  ">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+  <object-type name="QToolButton">
+<!--    <modify-function signature="initStyleOption(QStyleOptionToolButton*)const">
+        <access modifier="private"/>
+    </modify-function>
+-->
+    <modify-function signature="setDefaultAction(QAction *)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcDefaultAction"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setMenu(QMenu *)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcMenu"/>
+        </modify-argument>
+    </modify-function>
+  <!--
+        <inject-code>
+            <insert-template name="gui.init_style_option">
+                <replace from="%TYPE" to="QStyleOptionToolButton"/>
+            </insert-template>
+        </inject-code> -->
+    </object-type>
+  <object-type name="QToolTip"/>
+  <object-type name="QTreeView">
+
+    <modify-function signature="drawBranches(QPainter*,QRect,QModelIndex)const">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="drawRow(QPainter*,QStyleOptionViewItem,QModelIndex)const">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+
+    <modify-function signature="setHeader(QHeaderView*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+   </modify-function>
+   <modify-function signature="setModel(QAbstractItemModel*)">
+        <modify-argument index="1">
+            <reference-count declare-variable="QAbstractItemView" action="set" variable-name="__rcItemModel"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setSelectionModel(QItemSelectionModel*)">
+        <modify-argument index="1">
+            <no-null-pointer/>
+            <reference-count declare-variable="QAbstractItemView" action="set" variable-name="__rcItemSelectionModel"/>
+        </modify-argument>
+    </modify-function>
+
+      <modify-function signature="sortByColumn(int)" remove="all"/> <!--### Obsolete in 4.3-->
+  </object-type>
+  <object-type name="QUndoCommand">
+    <modify-function signature="mergeWith(const QUndoCommand*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+  </object-type>
+  <object-type name="QUndoGroup">
+    <modify-function signature="addStack(QUndoStack*)">
+        <modify-argument index="1">
+            <reference-count action="add" variable-name="__rcStacks"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="removeStack(QUndoStack*)">
+        <modify-argument index="1">
+            <reference-count action="remove" variable-name="__rcStacks"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setActiveStack(QUndoStack*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+
+  <object-type name="QUndoStack">
+        <modify-function signature="push(QUndoCommand *)">
+            <modify-argument index="1">
+                <define-ownership class="java" owner="c++"/>
+            </modify-argument>
+        </modify-function>
+    </object-type>
+
+  <object-type name="QUndoView">
+    <modify-function signature="setGroup(QUndoGroup *)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcGroupOrStack"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setStack(QUndoStack *)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcGroupOrStack"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="QUndoView(QUndoGroup *,QWidget *)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcGroupOrStack"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="QUndoView(QUndoStack *,QWidget *)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcGroupOrStack"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+  <object-type name="QVBoxLayout"/>
+  <object-type name="QValidator">
+<!--        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QValidator___" quote-before-line="}// class"/>
+        </inject-code>
+
+
+        <modify-function signature="fixup(QString&amp;)const">
+            <modify-argument index="1">
+                <replace-type modified-type="java.lang.String"/>
+                <conversion-rule class="shell">
+                    jobject %out = (jobject) qtjambi_from_qstring(__jni_env, %in);
+                </conversion-rule>
+                <conversion-rule class="native">
+                    QString %out = qtjambi_to_qstring(__jni_env, (jstring) %in);
+                    QString *__qt_converted = &amp;%out;
+                </conversion-rule>
+            </modify-argument>
+
+            <modify-argument index="0">
+                <replace-type modified-type="java.lang.String"/>
+                <conversion-rule class="native">
+                    jobject %out = (jobject) qtjambi_from_qstring(__jni_env, *__qt_converted);
+                </conversion-rule>
+                <conversion-rule class="shell">
+                    %1 = qtjambi_to_qstring(__jni_env, (jstring) %in);
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="validate(QString&amp;,int&amp;)const">
+            <modify-argument index="1">
+                <replace-type modified-type="qt.gui.QValidator$QValidationData"/>
+                <conversion-rule class="shell">
+                    <insert-template name="gui.convert_validationdata_to_java">
+                        <replace from="%STRING" to="%1"/>
+                        <replace from="%POS" to="%2"/>
+                    </insert-template>
+                </conversion-rule>
+                <conversion-rule class="native">
+                    <insert-template name="gui.convert_validationdata_to_string"/>
+                </conversion-rule>
+            </modify-argument>
+
+            <modify-argument index="2">
+                <remove-argument/>
+                <conversion-rule class="shell">
+                    // nothing needed
+                </conversion-rule>
+                <conversion-rule class="native">
+                    <insert-template name="gui.convert_validationdata_to_pos">
+                        <replace from="%VALIDATIONDATA" to="%1"/>
+                    </insert-template>
+                </conversion-rule>
+            </modify-argument>
+
+            <modify-argument index="return">
+                <conversion-rule class="native">
+                    <insert-template name="gui.cleanup_validationdata_from_java"/>
+                    jint %out = %in;
+                </conversion-rule>
+                <conversion-rule class="shell">
+                    <insert-template name="gui.cleanup_validationdata_to_java">
+                        <replace from="%STRING" to="%1"/>
+                        <replace from="%POS" to="%2"/>
+                    </insert-template>
+                    QValidator::State %out = (QValidator::State) qtjambi_to_enumerator(__jni_env, %in);
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+-->
+  </object-type>
+  <object-type name="QWhatsThis"/>
+  <object-type name="QWidgetAction">
+    <modify-function signature="createWidget(QWidget*)">
+        <modify-argument index="return">
+            <define-ownership class="shell" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+  
+        <modify-function signature="setDefaultWidget(QWidget*)">
+            <modify-argument index="1">
+                <define-ownership class="java" owner="c++"/>
+            </modify-argument>
+        </modify-function>
+    </object-type>
+  <object-type name="QWidgetItem"/>
+  <object-type name="QWindowsStyle">
+      <modify-function signature="standardPixmap(QStyle::StandardPixmap, const QStyleOption*, const QWidget*)const" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="standardIconImplementation(QStyle::StandardPixmap, const QStyleOption *, const QWidget *)const" virtual-slot="yes"/>
+  </object-type>
+  <object-type name="QWorkspace">
+    <modify-function signature="addWindow(QWidget*,QFlags&lt;Qt::WindowType&gt;)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setActiveWindow(QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+
+  <object-type name="QActionEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::ActionAdded || %1-&gt;type() == QEvent::ActionRemoved || %1-&gt;type() == QEvent::ActionChanged">
+        <extra-includes>
+            <include file-name="qt.core.QObject" location="java"/>
+        </extra-includes>
+  </object-type>
+  <object-type name="QClipboardEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Clipboard"/>
+  <object-type name="QCloseEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Close"/>
+  <object-type name="QContextMenuEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::ContextMenu"/>
+  <object-type name="QDragEnterEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::DragEnter"/>
+  <object-type name="QDragLeaveEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::DragLeave"/>
+  <object-type name="QDragMoveEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::DragMove">
+    <modify-function signature="accept()" remove="all"/>
+    <modify-function signature="ignore()" remove="all"/>
+  </object-type>
+  <object-type name="QDropEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Drop">
+    <modify-function signature="encodedData(const char*)const">
+        <remove/>
+    </modify-function>
+
+    <modify-function signature="format(int)const">
+        <remove/>
+    </modify-function>
+
+    <modify-function signature="provides(const char*)const">
+        <remove/>
+    </modify-function>
+    <modify-field name="fmts" read="false" write="false"/> <!-- obsolete in Qt4 -->
+
+  </object-type>
+  <object-type name="QFileOpenEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::FileOpen"/>
+  <object-type name="QFocusEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::FocusIn || %1-&gt;type() == QEvent::FocusOut">
+        <modify-function signature="reason()const">
+            <remove/>
+        </modify-function>
+  </object-type>
+
+  <object-type name="QGraphicsSceneContextMenuEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneContextMenu"/>
+  <object-type name="QGraphicsSceneDragDropEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneDragEnter || %1-&gt;type() == QEvent::GraphicsSceneDragLeave || %1-&gt;type() == QEvent::GraphicsSceneDragMove || %1-&gt;type() == QEvent::GraphicsSceneDrop">
+    <modify-function signature="setMimeData(const QMimeData *)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="setSource(QWidget *)">
+        <remove/>
+    </modify-function>
+  </object-type>
+  <object-type name="QGraphicsSceneEvent">
+    <modify-function signature="setWidget(QWidget *)">
+        <remove/>
+    </modify-function>
+  </object-type>
+  <object-type name="QGraphicsSceneMoveEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneMove"/>
+  <object-type name="QGraphicsSceneResizeEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneResize"/>
+  <object-type name="QGraphicsSceneHelpEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneHelp"/>
+  <object-type name="QGraphicsSceneHoverEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneHoverEnter || %1-&gt;type() == QEvent::GraphicsSceneHoverLeave || %1-&gt;type() == QEvent::GraphicsSceneHoverMove"/>
+  <object-type name="QGraphicsSceneMouseEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneMouseDoubleClick || %1-&gt;type() == QEvent::GraphicsSceneMouseMove || %1-&gt;type() == QEvent::GraphicsSceneMousePress || %1-&gt;type() == QEvent::GraphicsSceneMouseRelease"/>
+  <object-type name="QGraphicsSceneWheelEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneWheel"/>
+  <object-type name="QHelpEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::ToolTip || %1-&gt;type() == QEvent::WhatsThis"/>
+  <object-type name="QHideEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Hide"/>
+  <object-type name="QHoverEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::HoverEnter || %1-&gt;type() == QEvent::HoverLeave || %1-&gt;type() == QEvent::HoverMove"/>
+  <object-type name="QIconDragEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::IconDrag"/>
+  <object-type name="QInputMethodEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::InputMethod"/>
+  <object-type name="QMoveEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Move"/>
+  <object-type name="QResizeEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Resize"/>
+  <object-type name="QShortcutEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Shortcut">
+        <!-- All these have const overloads that are used instead -->
+        <modify-function signature="isAmbiguous()">
+            <remove/>
+        </modify-function>
+        <modify-function signature="shortcutId()">
+            <remove/>
+        </modify-function>
+        <modify-function signature="key()">
+            <remove/>
+        </modify-function>
+  </object-type>
+  <object-type name="QShowEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Show"/>
+  <object-type name="QStatusTipEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::StatusTip"/>
+  <object-type name="QTabletEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::TabletMove || %1-&gt;type() == QEvent::TabletPress || %1-&gt;type() == QEvent::TabletRelease"/>
+  <object-type name="QToolBarChangeEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::ToolBarChange"/>
+  <object-type name="QWhatsThisClickedEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::WhatsThisClicked"/>
+  <object-type name="QWheelEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Wheel"/>
+  <object-type name="QWindowStateChangeEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::WindowStateChange"/>
+  <object-type name="QDragResponseEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::DragResponse"/>
+  <object-type name="QInputEvent">
+    <modify-function signature="modifiers()const" access="non-final"/>
+  </object-type>
+  <object-type name="QKeyEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::KeyPress || %1-&gt;type() == QEvent::KeyRelease">
+	<modify-function signature="createExtendedKeyEvent(QEvent::Type,int,QFlags&lt;Qt::KeyboardModifier&gt;,uint,uint,uint,const QString &amp;,bool,unsigned short)" remove="all"/>
+  </object-type>
+  <object-type name="QMouseEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::MouseButtonDblClick || %1-&gt;type() == QEvent::MouseButtonPress || %1-&gt;type() == QEvent::MouseButtonRelease || %1-&gt;type() == QEvent::MouseMove">
+  	<modify-function signature="createExtendedMouseEvent(QEvent::Type, const QPointF &amp;, const QPoint &amp;, Qt::MouseButton, QFlags&lt;Qt::MouseButton&gt;, QFlags&lt;Qt::KeyboardModifier&gt;)" remove="all"/>
+  </object-type>
+  <object-type name="QPaintEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Paint"/>
+  <object-type name="QAccessibleEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::AccessibilityDescription || %1-&gt;type() == QEvent::AccessibilityHelp"/>
+
+  <object-type name="QAbstractButton">
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QAbstractButton___" quote-before-line="}// class"/>
+        </inject-code>
+
+    </object-type>
+
+  <object-type name="QStyle">
+      <modify-function signature="standardIconImplementation(QStyle::StandardPixmap, const QStyleOption *, const QWidget *)const" virtual-slot="yes"/>
+      <modify-function signature="layoutSpacingImplementation(QSizePolicy::ControlType, QSizePolicy::ControlType, Qt::Orientation, const QStyleOption *, const QWidget *) const" virtual-slot="yes"/>
+
+      <modify-function signature="drawComplexControl(QStyle::ComplexControl,const QStyleOptionComplex*,QPainter*,const QWidget*)const">
+        <modify-argument index="3" invalidate-after-use="yes"/>
+      </modify-function>
+      <modify-function signature="drawControl(QStyle::ControlElement,const QStyleOption*,QPainter*,const QWidget*)const">
+        <modify-argument index="3" invalidate-after-use="yes"/>
+      </modify-function>
+      <modify-function signature="drawPrimitive(QStyle::PrimitiveElement,const QStyleOption*,QPainter*,const QWidget*)const">
+        <modify-argument index="3" invalidate-after-use="yes"/>
+      </modify-function>
+      <modify-function signature="styleHint(QStyle::StyleHint,const QStyleOption*,const QWidget*,QStyleHintReturn*)const">
+        <modify-argument index="4" invalidate-after-use="yes"/>
+      </modify-function>
+      <modify-function signature="drawItemPixmap(QPainter*,QRect,int,QPixmap)const">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+      </modify-function>
+      <modify-function signature="drawItemText(QPainter*,QRect,int,QPalette,bool,QString,QPalette::ColorRole)const">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+      </modify-function>
+
+  
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QStyle___" quote-before-line="}// class"/>
+        </inject-code>
+		<!--
+        <modify-function signature="drawControl(QStyle::ControlElement, const QStyleOption *, QPainter *, const QWidget *) const">
+            <modify-argument index="2">
+                <replace-type modified-type="qt.gui.QStyleOption"/>
+                <conversion-rule class="shell">
+                    <insert-template name="gui::qstyleoption_from_object"/>
+                </conversion-rule>
+                <conversion-rule class="native">
+                    <insert-template name="gui::qstyleoption_to_object"/>
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="drawComplexControl(QStyle::ComplexControl, const QStyleOptionComplex *, QPainter *, const QWidget *) const">
+            <modify-argument index="2">
+                <replace-type modified-type="qt.gui.QStyleOptionComplex"/>
+                <conversion-rule class="shell">
+                    <insert-template name="gui::qstyleoptioncomplex_from_object"/>
+                </conversion-rule>
+                <conversion-rule class="native">
+                    <insert-template name="gui::qstyleoption_to_object"/>
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="drawPrimitive(QStyle::PrimitiveElement, const QStyleOption *, QPainter *, const QWidget *) const">
+            <modify-argument index="2">
+                <replace-type modified-type="qt.gui.QStyleOption"/>
+                <conversion-rule class="shell">
+                    <insert-template name="gui::qstyleoption_from_object"/>
+                </conversion-rule>
+                <conversion-rule class="native">
+                    <insert-template name="gui::qstyleoption_to_object"/>
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="hitTestComplexControl(QStyle::ComplexControl, const QStyleOptionComplex *, const QPoint &amp;, const QWidget *) const">
+            <modify-argument index="2">
+                <replace-type modified-type="qt.gui.QStyleOptionComplex"/>
+                <conversion-rule class="shell">
+                    <insert-template name="gui::qstyleoptioncomplex_from_object"/>
+                </conversion-rule>
+                <conversion-rule class="native">
+                    <insert-template name="gui::qstyleoption_to_object"/>
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="pixelMetric(QStyle::PixelMetric, const QStyleOption *, const QWidget *) const">
+            <modify-argument index="2">
+                <replace-type modified-type="qt.gui.QStyleOption"/>
+                <conversion-rule class="shell">
+                    <insert-template name="gui::qstyleoption_from_object"/>
+                </conversion-rule>
+                <conversion-rule class="native">
+                    <insert-template name="gui::qstyleoption_to_object"/>
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="sizeFromContents(QStyle::ContentsType, const QStyleOption *, const QSize &amp;, const QWidget *) const">
+            <modify-argument index="2">
+                <replace-type modified-type="qt.gui.QStyleOption"/>
+                <conversion-rule class="shell">
+                    <insert-template name="gui::qstyleoption_from_object"/>
+                </conversion-rule>
+                <conversion-rule class="native">
+                    <insert-template name="gui::qstyleoption_to_object"/>
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="standardIcon(QStyle::StandardPixmap, const QStyleOption *, const QWidget *) const">
+            <modify-argument index="2">
+                <replace-type modified-type="qt.gui.QStyleOption"/>
+                <conversion-rule class="shell">
+                    <insert-template name="gui::qstyleoption_from_object"/>
+                </conversion-rule>
+                <conversion-rule class="native">
+                    <insert-template name="gui::qstyleoption_to_object"/>
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="standardPixmap(QStyle::StandardPixmap, const QStyleOption *, const QWidget *) const">
+            <modify-argument index="2">
+                <replace-type modified-type="qt.gui.QStyleOption"/>
+                <conversion-rule class="shell">
+                    <insert-template name="gui::qstyleoption_from_object"/>
+                </conversion-rule>
+                <conversion-rule class="native">
+                    <insert-template name="gui::qstyleoption_to_object"/>
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="styleHint(QStyle::StyleHint, const QStyleOption *, const QWidget *, QStyleHintReturn *) const">
+            <modify-argument index="2">
+                <replace-type modified-type="qt.gui.QStyleOption"/>
+                <conversion-rule class="shell">
+                    <insert-template name="gui::qstyleoption_from_object"/>
+                </conversion-rule>
+                <conversion-rule class="native">
+                    <insert-template name="gui::qstyleoption_to_object"/>
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="subControlRect(QStyle::ComplexControl, const QStyleOptionComplex *, QStyle::SubControl, const QWidget *) const">
+            <modify-argument index="2">
+                <replace-type modified-type="qt.gui.QStyleOptionComplex"/>
+                <conversion-rule class="shell">
+                    <insert-template name="gui::qstyleoptioncomplex_from_object"/>
+                </conversion-rule>
+                <conversion-rule class="native">
+                    QStyleOptionComplex *%out = (QStyleOptionComplex *) qtjambi_to_object(__jni_env, %in);
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="subElementRect(QStyle::SubElement, const QStyleOption *, const QWidget *) const">
+            <modify-argument index="2">
+                <replace-type modified-type="qt.gui.QStyleOption"/>
+                <conversion-rule class="shell">
+                    <insert-template name="gui::qstyleoption_from_object"/>
+                </conversion-rule>
+                <conversion-rule class="native">
+                    <insert-template name="gui::qstyleoption_to_object"/>
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="generatedIconPixmap(QIcon::Mode,QPixmap,const QStyleOption*)const">
+            <modify-argument index="3">
+                <replace-type modified-type="qt.gui.QStyleOption"/>
+                <conversion-rule class="shell">
+                    <insert-template name="gui::qstyleoption_from_object"/>
+                </conversion-rule>
+                <conversion-rule class="native">
+                    <insert-template name="gui::qstyleoption_to_object"/>
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="polish(QPalette&amp;)">
+            <modify-argument index="1">
+                <replace-type modified-type="qt.gui.QPalette"/>
+                <conversion-rule class="shell">
+                    jobject %out = qtjambi_from_object(__jni_env, &amp;%in, "QPalette", "com/trolltech/qt/gui/", false);
+                    jobject __invalidate_me = %out;
+                </conversion-rule>
+                <conversion-rule class="native">
+                    QtJambiLink *link = QtJambiLink::findLink(__jni_env, %in);
+                    Q_ASSERT(link != 0);
+
+                    QPalette dummy;
+                    QPalette &amp;%out = link != 0 ? * (QPalette *) link-&gt;pointer() : dummy;
+                </conversion-rule>
+            </modify-argument>
+            <modify-argument index="0">
+                <conversion-rule class="shell">
+                    if (__invalidate_me != 0)
+                    qtjambi_invalidate_object(__jni_env, __invalidate_me);
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="standardIconImplementation(QStyle::StandardPixmap,const QStyleOption*,const QWidget*)const">
+            <modify-argument index="2">
+                <replace-type modified-type="qt.gui.QStyleOption"/>
+                <conversion-rule class="shell">
+                    <insert-template name="gui::qstyleoption_from_object"/>
+                </conversion-rule>
+                <conversion-rule class="native">
+                    <insert-template name="gui::qstyleoption_to_object"/>
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+-->
+        <modify-function signature="combinedLayoutSpacing(QFlags&lt;QSizePolicy::ControlType&gt;,QFlags&lt;QSizePolicy::ControlType&gt;,Qt::Orientation,QStyleOption*,QWidget*)const">
+            <access modifier="private"/>
+            <modify-argument index="4">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="5">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+
+
+        <modify-function signature="layoutSpacing(QSizePolicy::ControlType,QSizePolicy::ControlType,Qt::Orientation,const QStyleOption*,const QWidget*)const">
+            <access modifier="private"/>
+            <modify-argument index="4">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="5">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+
+<!--
+        <modify-function signature="layoutSpacingImplementation(QSizePolicy::ControlType,QSizePolicy::ControlType,Qt::Orientation,const QStyleOption*,const QWidget*)const">
+            <modify-argument index="4">
+                <replace-type modified-type="qt.gui.QStyleOption"/>
+                <conversion-rule class="shell">
+                    <insert-template name="gui::qstyleoption_from_object"/>
+                </conversion-rule>
+                <conversion-rule class="native">
+                    <insert-template name="gui::qstyleoption_to_object"/>
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+-->
+
+
+        <inject-code class="shell-declaration"> <!-- Remove in Qt 5 -->
+            QPixmap standardPixmap(QStyle::StandardPixmap, const QStyleOption*, const QWidget*) const { return QPixmap(); }
+        </inject-code>
+
+        <modify-function signature="standardPixmap(QStyle::StandardPixmap, const QStyleOption*, const QWidget*)const" remove="all"/> <!--### Obsolete in 4.3-->
+    </object-type>
+
+  <object-type name="QColorDialog">
+    <modify-function signature="getColor(const QColor &amp;, QWidget *)">
+      <modify-argument index="1">
+        <replace-default-expression with="QColor.white"/>
+      </modify-argument>
+    </modify-function>
+    <modify-function signature="getRgba(uint,bool*,QWidget*)">
+        <remove/>
+    </modify-function>
+  </object-type>
+
+  <object-type name="QLayout">
+  
+    <modify-function signature="addItem(QLayoutItem*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+
+    <modify-function signature="setSpacing(int)" rename="setWidgetSpacing"/>
+    <modify-function signature="spacing()const" rename="widgetSpacing"/>
+    <modify-function signature="addWidget(QWidget *)">
+        <modify-argument index="1">
+            <no-null-pointer/>
+            <reference-count variable-name="__rcWidgets" action="add"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="addChildWidget(QWidget *)">
+        <modify-argument index="1">
+            <no-null-pointer/>
+            <reference-count variable-name="__rcWidgets" action="add"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="removeWidget(QWidget *)">
+        <modify-argument index="1">
+            <no-null-pointer/>
+            <reference-count variable-name="__rcWidgets" action="remove"/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="setAlignment(QWidget*,QFlags&lt;Qt::AlignmentFlag&gt;)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setAlignment(QLayout*,QFlags&lt;Qt::AlignmentFlag&gt;)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setMenuBar(QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcMenuBar"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="getContentsMargins(int*,int*,int*,int*)const">
+        <access modifier="private"/>
+    </modify-function>
+
+    <modify-function signature="margin()const" remove="all"/> <!--### Obsolete in 4.3-->
+    <!-- <modify-function signature="setMargin(int)" remove="all"/> --> <!--### Obsolete in 4.3-->
+  
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QLayout___" quote-before-line="}// class"/>
+        </inject-code>
+        <modify-function signature="addItem(QLayoutItem *)">
+            <modify-argument index="1">
+                <define-ownership class="java" owner="c++"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="removeItem(QLayoutItem *)">
+            <modify-argument index="1">
+                <define-ownership class="java" owner="default"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="addChildLayout(QLayout *)">
+            <modify-argument index="1">
+                <define-ownership class="java" owner="c++"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="addChildLayout(QLayout *)">
+            <modify-argument index="1">
+                <define-ownership class="java" owner="c++"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="itemAt(int) const">
+<!--            <modify-argument index="return">
+                <define-ownership class="java" owner="c++"/>
+            </modify-argument>-->
+        </modify-function>
+
+
+    </object-type>
+
+  <object-type name="QStackedLayout">
+    <modify-function signature="addItem(QLayoutItem *)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="itemAt(int) const">
+        <modify-argument index="return">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="addWidget(QWidget *)">
+        <rename to="addStackedWidget"/>
+        <modify-argument index="1">
+            <no-null-pointer/>
+            <reference-count action="add" declare-variable="QLayout" variable-name="__rcWidgets"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertWidget(int,QWidget*)">
+        <modify-argument index="2">
+            <no-null-pointer/>
+            <reference-count action="add" declare-variable="QLayout" variable-name="__rcWidgets"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setCurrentWidget(QWidget*)">
+        <modify-argument index="1">
+            <!-- Safe to ignore because current widget must have been added to layout already -->
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+
+  <object-type name="QBoxLayout">
+    <modify-function signature="addWidget(QWidget *, int, QFlags&lt;Qt::AlignmentFlag&gt;)">
+        <modify-argument index="1">
+            <no-null-pointer/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="addItem(QLayoutItem *)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertLayout(int, QLayout *, int)">
+        <modify-argument index="2">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertItem(int, QLayoutItem *)">
+        <modify-argument index="2">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="addSpacerItem(QSpacerItem*)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertSpacerItem(int,QSpacerItem*)">
+        <modify-argument index="2">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="addLayout(QLayout *, int)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="addWidget(QWidget*,int,QFlags&lt;Qt::AlignmentFlag&gt;)">
+        <modify-argument index="1">
+            <reference-count declare-variable="QLayout" action="add" variable-name="__rcWidgets"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertWidget(int,QWidget*,int,QFlags&lt;Qt::AlignmentFlag&gt;)">
+        <modify-argument index="2">
+            <reference-count declare-variable="QLayout" action="add" variable-name="__rcWidgets"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setStretchFactor(QWidget*,int)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setStretchFactor(QLayout*,int)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+
+  <object-type name="QGridLayout">
+    <modify-function signature="addWidget(QWidget *)" remove="all"/>
+    <modify-function signature="addItem(QLayoutItem *)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="addItem(QLayoutItem *, int, int, int, int, QFlags&lt;Qt::AlignmentFlag&gt;)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="addLayout(QLayout *, int, int, QFlags&lt;Qt::AlignmentFlag&gt;)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="addLayout(QLayout *, int, int, int, int, QFlags&lt;Qt::AlignmentFlag&gt;)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+        <modify-function signature="addWidget(QWidget*,int,int,QFlags&lt;Qt::AlignmentFlag&gt;)">
+            <modify-argument index="1">
+                <reference-count declare-variable="QLayout" action="add" variable-name="__rcWidgets"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="addWidget(QWidget*,int,int,int,int,QFlags&lt;Qt::AlignmentFlag&gt;)">
+            <modify-argument index="1">
+                <reference-count declare-variable="QLayout" action="add" variable-name="__rcWidgets"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="addWidget(QWidget*)">
+            <modify-argument index="1">
+                <reference-count declare-variable="QLayout" action="add" variable-name="__rcWidgets"/>
+            </modify-argument>
+        </modify-function>
+    <modify-function signature="getItemPosition(int,int*,int*,int*,int*)">
+        <access modifier="private"/>
+    </modify-function>
+  
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QGridLayout___" quote-before-line="}// class"/>
+        </inject-code>
+
+
+    </object-type>
+
+  <object-type name="QGraphicsView">
+    <extra-includes>
+      <include file-name="QPainterPath" location="global"/>
+      <include file-name="QVarLengthArray" location="global"/>
+    </extra-includes>
+    <modify-function signature="fitInView(const QGraphicsItem *, Qt::AspectRatioMode)">
+        <modify-argument index="1">
+            <no-null-pointer/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setupViewport(QWidget *)" access="non-final"/>
+    <modify-function signature="setScene(QGraphicsScene*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcScene"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setupViewport(QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="drawBackground(QPainter*,QRectF)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="drawForeground(QPainter*,QRectF)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="drawItems(QPainter*,int,QGraphicsItem**,const QStyleOptionGraphicsItem*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+
+    <modify-function signature="drawItems(QPainter*,int,QGraphicsItem**,const QStyleOptionGraphicsItem*)" remove="all" />
+
+<!--
+    <modify-function signature="drawItems(QPainter*,int,QGraphicsItem**,const QStyleOptionGraphicsItem*)">
+        <modify-argument index="2">
+            <remove-argument/>
+            <conversion-rule class="shell">
+                // nothing
+            </conversion-rule>
+            <conversion-rule class="native">
+                <insert-template name="core.get_array_length">
+                    <replace from="%ARRAY" to="%3"/>
+                </insert-template>
+                int __length = %out;
+            </conversion-rule>
+        </modify-argument>
+
+        <modify-argument index="3">
+            <replace-type modified-type="qt.gui.QGraphicsItemInterface[]"/>
+            <conversion-rule class="shell">
+                <insert-template name="gui.convert_graphicsitem_array_to_java">
+                    <replace from="%LENGTH" to="%2"/>
+                </insert-template>
+                jobjectArray graphicsItemArrayHolder = %out;
+            </conversion-rule>
+            <conversion-rule class="native">
+                <insert-template name="gui.convert_graphicsitem_array_from_java"/>
+            </conversion-rule>
+        </modify-argument>
+
+        <modify-argument index="4">
+            <replace-type modified-type="qt.gui.QStyleOptionGraphicsItem[]"/>
+            <conversion-rule class="shell">
+                <insert-template name="gui.convert_styleoptiongraphicsitem_array_to_java">
+                    <replace from="%LENGTH" to="%2"/>
+                </insert-template>
+                jobjectArray styleOptionArrayHolder = %out;
+            </conversion-rule>
+            <conversion-rule class="native">
+                <insert-template name="gui.convert_styleoptiongraphicsitem_array_from_java"/>
+            </conversion-rule>
+        </modify-argument>
+
+        <modify-argument index="return">
+            <conversion-rule class="shell">
+                qtjambi_invalidate_array(__jni_env, styleOptionArrayHolder);
+                qtjambi_invalidate_array(__jni_env, graphicsItemArrayHolder);
+            </conversion-rule>
+        </modify-argument>
+
+    </modify-function>
+    -->
+  </object-type>
+
+  <object-type name="QInputDialog">
+    <modify-function signature="getDouble(QWidget *, const QString &amp;, const QString &amp;, double, double, double, int, bool *, QFlags&lt;Qt::WindowType&gt;)">
+        <rename to="getDouble_internal"/>
+        <access modifier="private"/>
+        <modify-argument index="4">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="5">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="6">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="7">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="8">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="9">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="getInteger(QWidget *, const QString &amp;, const QString &amp;, int, int, int, int, bool *, QFlags&lt;Qt::WindowType&gt;)">
+        <rename to="getInteger_internal"/>
+        <access modifier="private"/>
+        <modify-argument index="4">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="5">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="6">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="7">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="8">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="9">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="getItem(QWidget *, const QString &amp;, const QString &amp;, const QStringList&lt;QString&gt; &amp;, int, bool, bool *, QFlags&lt;Qt::WindowType&gt;)">
+        <rename to="getItem_internal"/>
+        <access modifier="private"/>
+        <modify-argument index="4">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="5">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="6">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="7">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="8">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="getText(QWidget *, const QString &amp;, const QString &amp;, QLineEdit::EchoMode, const QString &amp;, bool *, QFlags&lt;Qt::WindowType&gt;)">
+        <rename to="getText_internal"/>
+        <access modifier="private"/>
+        <modify-argument index="4">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="5">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="6">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="7">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+  
+        <inject-code>
+        <insert-template name="gui.inputDialog_get_input">
+            <replace from="%RETURN_TYPE" to="Double"/>
+            <replace from="%EXTRA" to="double value, double minValue, double maxValue, int decimals"/>
+            <replace from="%FUNCTION_NAME" to="getDouble"/>
+            <replace from="%CALL" to="value, minValue, maxValue, decimals"/>
+        </insert-template>
+
+        public static Double getDouble(qt.gui.QWidget parent, java.lang.String title, java.lang.String label, double value, double minValue, double maxValue) {
+            return getDouble(parent, title, label, value, minValue, maxValue, 1);
+        }
+
+        public static Double getDouble(qt.gui.QWidget parent, java.lang.String title, java.lang.String label, double value, double minValue) {
+            return getDouble(parent, title, label, value, minValue, (double)2147483647);
+        }
+
+
+        public static Double getDouble(qt.gui.QWidget parent, java.lang.String title, java.lang.String label, double value) {
+            return getDouble(parent, title, label, value, (double)-2147483647);
+        }
+
+        public static Double getDouble(qt.gui.QWidget parent, java.lang.String title, java.lang.String label) {
+            return getDouble(parent, title, label, 0.0);
+        }
+        </inject-code>
+
+        <inject-code>
+            <insert-template name="gui.inputDialog_get_input">
+                <replace from="%RETURN_TYPE" to="Integer"/>
+                <replace from="%EXTRA" to="int value, int minValue, int maxValue, int step"/>
+                <replace from="%FUNCTION_NAME" to="getInteger"/>
+                <replace from="%CALL" to="value, minValue, maxValue, step"/>
+            </insert-template>
+
+        public static Integer getInteger(qt.gui.QWidget parent, java.lang.String title, java.lang.String label, int value, int minValue, int maxValue) {
+            return getInteger(parent, title, label, value, minValue, maxValue, 1);
+        }
+
+        public static Integer getInteger(qt.gui.QWidget parent, java.lang.String title, java.lang.String label, int value, int minValue) {
+            return getInteger(parent, title, label, value, minValue, (int)2147483647);
+        }
+
+        public static Integer getInteger(qt.gui.QWidget parent, java.lang.String title, java.lang.String label, int value) {
+            return getInteger(parent, title, label, value, (int)-2147483647);
+        }
+
+        public static Integer getInteger(qt.gui.QWidget parent, java.lang.String title, java.lang.String label) {
+            return getInteger(parent, title, label, 0);
+        }
+        </inject-code>
+
+        <inject-code>
+            <insert-template name="gui.inputDialog_get_input">
+                <replace from="%RETURN_TYPE" to="String"/>
+                <replace from="%EXTRA" to="java.util.List&lt;java.lang.String&gt; list, int current, boolean editable"/>
+                <replace from="%FUNCTION_NAME" to="getItem"/>
+                <replace from="%CALL" to="list, current, editable"/>
+            </insert-template>
+
+        public static java.lang.String getItem(qt.gui.QWidget parent, java.lang.String title, java.lang.String label, java.util.List&lt;java.lang.String&gt; list, int current) {
+            return getItem(parent, title, label, list, current, true);
+        }
+
+        public static java.lang.String getItem(qt.gui.QWidget parent, java.lang.String title, java.lang.String label, java.util.List&lt;java.lang.String&gt; list) {
+            return getItem(parent, title, label, list, 0);
+        }
+        </inject-code>
+        <inject-code>
+            <insert-template name="gui.inputDialog_get_input">
+                <replace from="%RETURN_TYPE" to="String"/>
+                <replace from="%EXTRA" to="qt.gui.QLineEdit.EchoMode echo, java.lang.String text"/>
+                <replace from="%FUNCTION_NAME" to="getText"/>
+                <replace from="%CALL" to="echo, text"/>
+            </insert-template>
+
+        public static java.lang.String getText(qt.gui.QWidget parent, java.lang.String title, java.lang.String label, qt.gui.QLineEdit.EchoMode echo) {
+            return getText(parent, title, label, echo, "");
+        }
+
+        public static java.lang.String getText(qt.gui.QWidget parent, java.lang.String title, java.lang.String label) {
+            return getText(parent, title, label, qt.gui.QLineEdit.EchoMode.Normal);
+        }
+        </inject-code>
+    </object-type>
+
+
+  <object-type name="QGraphicsScene">
+    <extra-includes>
+        <include file-name="QVarLengthArray" location="global"/>
+    </extra-includes>
+    <modify-function signature="drawItems(QPainter*,int,QGraphicsItem**,const QStyleOptionGraphicsItem*,QWidget*)" remove="all"/> <!-- TODO: What is '_ConcreteWrapper'? -->
+    <!--
+    <modify-function signature="contextMenuEvent(QGraphicsSceneContextMenuEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="dragEnterEvent(QGraphicsSceneDragDropEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="dragLeaveEvent(QGraphicsSceneDragDropEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="dragMoveEvent(QGraphicsSceneDragDropEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="drawBackground(QPainter*,QRectF)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="drawForeground(QPainter*,QRectF)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="drawItems(QPainter*,int,QGraphicsItem**,const QStyleOptionGraphicsItem*,QWidget*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="dropEvent(QGraphicsSceneDragDropEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="focusInEvent(QFocusEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="focusOutEvent(QFocusEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="helpEvent(QGraphicsSceneHelpEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="inputMethodEvent(QInputMethodEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="keyPressEvent(QKeyEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="keyReleaseEvent(QKeyEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="mouseDoubleClickEvent(QGraphicsSceneMouseEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="mouseMoveEvent(QGraphicsSceneMouseEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="mousePressEvent(QGraphicsSceneMouseEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="mouseReleaseEvent(QGraphicsSceneMouseEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="wheelEvent(QGraphicsSceneWheelEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+
+    <modify-function signature="setActiveWindow(QGraphicsWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setStyle(QStyle*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="addItem(QGraphicsItem *)">
+      <modify-argument index="1">
+        <define-ownership class="java" owner="c++"/>
+      </modify-argument>
+    </modify-function>
+    <modify-function signature="addEllipse(const QRectF &amp;, const QPen &amp;, const QBrush &amp;)">
+      <modify-argument index="return">
+        <define-ownership class="java" owner="c++"/>
+      </modify-argument>
+    </modify-function>
+    <modify-function signature="addLine(const QLineF &amp;, const QPen &amp;)">
+      <modify-argument index="return">
+        <define-ownership class="java" owner="c++"/>
+      </modify-argument>
+    </modify-function>
+    <modify-function signature="addPath(const QPainterPath &amp;, const QPen &amp;, const QBrush &amp;)">
+      <modify-argument index="return">
+        <define-ownership class="java" owner="c++"/>
+      </modify-argument>
+    </modify-function>
+    <modify-function signature="addPixmap(const QPixmap &amp;)">
+        <modify-argument index="return">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="addPolygon(const QPolygonF &amp;, const QPen &amp;, const QBrush &amp;)">
+        <modify-argument index="return">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="addRect(const QRectF &amp;, const QPen &amp;, const QBrush &amp;)">
+        <modify-argument index="return">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="addText(const QString &amp;, const QFont &amp;)">
+        <modify-argument index="return">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="addWidget(QWidget*,QFlags&lt;Qt::WindowType&gt;)">
+        <modify-argument index="return">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="removeItem(QGraphicsItem*)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="default"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setFocusItem(QGraphicsItem*,Qt::FocusReason)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcFocusItem"/>
+        </modify-argument>
+    </modify-function>
+  
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QGraphicsScene___" quote-before-line="}// class"/>
+        </inject-code>
+
+        <modify-function signature="addEllipse(const QRectF &amp;, const QPen &amp;, const QBrush &amp;)" remove="all"/>
+        <modify-function signature="addEllipse(double, double, double, double, const QPen &amp;, const QBrush &amp;)" remove="all"/>
+        <modify-function signature="addLine(const QLineF &amp;, const QPen &amp;)" remove="all"/>
+        <modify-function signature="addLine(double, double, double, double, const QPen &amp;)" remove="all"/>
+        <modify-function signature="addPath(const QPainterPath &amp;, const QPen &amp;, const QBrush &amp;)" remove="all"/>
+        <modify-function signature="addPixmap(const QPixmap &amp;)" remove="all"/>
+        <modify-function signature="addPolygon(const QPolygonF &amp;, const QPen &amp;, const QBrush &amp;)" remove="all"/>
+        <modify-function signature="addRect(const QRectF &amp;, const QPen &amp;, const QBrush &amp;)" remove="all"/>
+        <modify-function signature="addRect(double, double, double, double, const QPen &amp;, const QBrush &amp;)" remove="all"/>
+        <modify-function signature="addSimpleText(const QString &amp;, const QFont &amp;)" remove="all"/>
+        <modify-function signature="addText(const QString &amp;, const QFont &amp;)" remove="all"/>
+
+        <modify-function signature="drawItems(QPainter*,int,QGraphicsItem**,const QStyleOptionGraphicsItem*,QWidget*)">
+            <modify-argument index="2">
+                <remove-argument/>
+                <conversion-rule class="shell">
+                    // nothing
+                </conversion-rule>
+                <conversion-rule class="native">
+                    <insert-template name="core.get_array_length">
+                        <replace from="%ARRAY" to="%3"/>
+                    </insert-template>
+                    int __length = %out;
+                </conversion-rule>
+
+            </modify-argument>
+
+            <modify-argument index="3">
+                <replace-type modified-type="qt.gui.QGraphicsItemInterface[]"/>
+                <conversion-rule class="shell">
+                    <insert-template name="gui.convert_graphicsitem_array_to_java">
+                        <replace from="%LENGTH" to="%2"/>
+                    </insert-template>
+                    jobjectArray graphicsItemArrayHolder = %out;
+                </conversion-rule>
+                <conversion-rule class="native">
+                    <insert-template name="gui.convert_graphicsitem_array_from_java"/>
+                </conversion-rule>
+            </modify-argument>
+
+            <modify-argument index="return">
+                <conversion-rule class="shell">
+                    qtjambi_invalidate_array(__jni_env, styleOptionArrayHolder);
+                    qtjambi_invalidate_array(__jni_env, graphicsItemArrayHolder);
+                </conversion-rule>
+            </modify-argument>
+
+            <modify-argument index="4">
+                <replace-type modified-type="qt.gui.QStyleOptionGraphicsItem[]"/>
+                <conversion-rule class="shell">
+                    <insert-template name="gui.convert_styleoptiongraphicsitem_array_to_java">
+                        <replace from="%LENGTH" to="%2"/>
+                    </insert-template>
+                    jobjectArray styleOptionArrayHolder = %out;
+                </conversion-rule>
+                <conversion-rule class="native">
+                    <insert-template name="gui.convert_styleoptiongraphicsitem_array_from_java"/>
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+	-->
+    </object-type>
+
+
+  <object-type name="QCalendarWidget">
+    <extra-includes>
+      <include file-name="QTextCharFormat" location="global"/>
+    </extra-includes>
+
+      <modify-function signature="isHeaderVisible()const" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="setHeaderVisible(bool)" remove="all"/> <!--### Obsolete in 4.3-->
+
+      <modify-function signature="paintCell(QPainter*,QRect,QDate)const">
+        <modify-argument invalidate-after-use="yes" index="1"/>
+      </modify-function>
+  </object-type>
+
+  <object-type name="QTreeWidget">
+    <modify-function signature="mimeData(const QList&lt;QTreeWidgetItem*&gt;)const">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="dropMimeData(QTreeWidgetItem*,int,const QMimeData*,Qt::DropAction)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="isSortingEnabled()const" remove="all"/>
+    <modify-function signature="setSortingEnabled(bool)" remove="all"/>
+    <modify-function signature="indexOfTopLevelItem(QTreeWidgetItem *)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="addTopLevelItem(QTreeWidgetItem *)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="takeTopLevelItem(int)">
+        <modify-argument index="return">
+            <define-ownership class="java" owner="default"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="addTopLevelItems(const QList&lt;QTreeWidgetItem*&gt; &amp;)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertTopLevelItem(int, QTreeWidgetItem *)">
+        <modify-argument index="2">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertTopLevelItems(int, const QList&lt;QTreeWidgetItem*&gt; &amp;)">
+        <modify-argument index="2">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setHeaderItem(QTreeWidgetItem *)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="takeTopLevelItem(int)">
+        <modify-argument index="return">
+            <define-ownership class="java" owner="default"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="removeItemWidget(QTreeWidgetItem*,int)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="default"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setCurrentItem(QTreeWidgetItem*,int,QFlags&lt;QItemSelectionModel::SelectionFlag&gt;)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setFirstItemColumnSpanned(const QTreeWidgetItem*,bool)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setCurrentItem(QTreeWidgetItem*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setCurrentItem(QTreeWidgetItem*,int)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setItemExpanded(const QTreeWidgetItem*,bool)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="isItemExpanded(const QTreeWidgetItem*)const">
+        <remove/>
+    </modify-function>
+    <modify-function signature="setItemHidden(const QTreeWidgetItem*,bool)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="isItemHidden(const QTreeWidgetItem*)const">
+        <remove/>
+    </modify-function>
+    <modify-function signature="isItemSelected(const QTreeWidgetItem*)const">
+        <remove/>
+    </modify-function>
+    <modify-function signature="setItemSelected(const QTreeWidgetItem*,bool)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="setItemWidget(QTreeWidgetItem*,int,QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+        <modify-argument index="3">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setModel(QAbstractItemModel*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+
+      <modify-function signature="items(const QMimeData*)const" remove="all"/> <!--### Obsolete in 4.3-->
+  </object-type>
+
+  <object-type name="QAbstractItemDelegate">
+    <modify-function signature="setEditorData(QWidget*,QModelIndex)const">
+        <modify-argument index="1">
+            <!-- Safe to ignore because this implementation is documented to do nothing -->
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setModelData(QWidget*,QAbstractItemModel*,QModelIndex)const">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+        <modify-argument index="2">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="paint(QPainter*,QStyleOptionViewItem,QModelIndex)const">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="editorEvent(QEvent*,QAbstractItemModel*,QStyleOptionViewItem,QModelIndex)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+
+      <modify-function signature="elidedText(QFontMetrics, int, Qt::TextElideMode, QString)" remove="all"/> <!--### Obsolete in 4.3-->
+  </object-type>
+
+  <object-type name="QTableWidgetItem" delete-in-main-thread="yes">
+    <modify-function signature="operator=(const QTableWidgetItem&amp;)" remove="all"/>
+    <modify-function signature="clone() const">
+        <modify-argument index="return">
+            <define-ownership class="shell" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+
+      <modify-function signature="backgroundColor()const" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="setBackgroundColor(QColor)" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="setTextColor(QColor)" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="textColor()const" remove="all"/> <!--### Obsolete in 4.3-->
+
+    <modify-function signature="operator&lt;(QTableWidgetItem)const">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="read(QDataStream&amp;)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="write(QDataStream&amp;)const">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+
+  </object-type>
+
+  <object-type name="QListWidgetItem" delete-in-main-thread="yes">
+
+    <modify-function signature="operator&lt;(QListWidgetItem)const">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="read(QDataStream&amp;)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="write(QDataStream&amp;)const">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+
+
+    <modify-function signature="operator=(const QListWidgetItem&amp;)" remove="all"/>
+<!--    <modify-function signature="QListWidgetItem(QListWidget *, int)">
+        <modify-argument index="this">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="QListWidgetItem(const QString &amp;, QListWidget *, int)">
+        <modify-argument index="this">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="QListWidgetItem(const QIcon &amp;, const QString &amp;, QListWidget *, int)">
+        <modify-argument index="this">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="clone() const">
+        <modify-argument index="return">
+            <define-ownership class="shell" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+-->
+      <modify-function signature="backgroundColor()const" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="setBackgroundColor(QColor)" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="setTextColor(QColor)" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="textColor()const" remove="all"/> <!--### Obsolete in 4.3-->
+  </object-type>
+
+  <object-type name="QGraphicsTextItem"> <!-- a QObject so main-thread delete redundant -->
+    <extra-includes>
+      <include file-name="QTextCursor" location="global"/>
+    </extra-includes>
+    	<modify-function signature="setExtension(QGraphicsItem::Extension,QVariant)" remove="all"/>
+	<modify-function signature="supportsExtension(QGraphicsItem::Extension)const" remove="all"/>
+    <!--
+    <modify-function signature="QGraphicsTextItem(QGraphicsItem*,QGraphicsScene*)">
+        <inject-code position="end">
+            <argument-map index="1" meta-name="%1"/>
+            if (%1 != null) disableGarbageCollection();
+        </inject-code>
+    </modify-function>
+    <modify-function signature="QGraphicsTextItem(const QString &amp;,QGraphicsItem*,QGraphicsScene*)">
+        <inject-code position="end">
+            <argument-map index="2" meta-name="%2"/>
+            if (%2 != null) disableGarbageCollection();
+        </inject-code>
+    </modify-function>
+    <modify-function signature="setDocument(QTextDocument*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcDocument"/>
+        </modify-argument>
+    </modify-function>
+    -->
+      <modify-function signature="matrix()const" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="resetMatrix()" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="sceneMatrix()const" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="setMatrix(QMatrix, bool)" remove="all"/> <!--### Obsolete in 4.3-->
+  </object-type>
+
+  <object-type name="QCompleter">
+    <modify-function signature="activated(const QModelIndex &amp;)">
+        <rename to="activatedIndex"/>
+    </modify-function>
+    <modify-function signature="highlighted(const QModelIndex &amp;)">
+        <rename to="highlightedIndex"/>
+    </modify-function>
+    <modify-function signature="setModel(QAbstractItemModel *)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcModel"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setPopup(QAbstractItemView *)">
+        <modify-argument index="1">
+            <no-null-pointer/>
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setWidget(QWidget *)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcWidget"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+
+
+  <object-type name="QTreeWidgetItem" delete-in-main-thread="yes">
+
+    <modify-function signature="operator&lt;(QTreeWidgetItem)const">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="read(QDataStream&amp;)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="write(QDataStream&amp;)const">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+
+    <modify-function signature="QTreeWidgetItem(const QTreeWidgetItem &amp;)" remove="all"/>
+    <modify-function signature="operator=(const QTreeWidgetItem&amp;)" remove="all"/>
+
+    <modify-function signature="QTreeWidgetItem(QTreeWidget *,int)">
+        <modify-argument index="this">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="QTreeWidgetItem(QTreeWidget *,const QStringList&lt;QString&gt; &amp;,int)">
+        <modify-argument index="this">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="QTreeWidgetItem(QTreeWidget *,QTreeWidgetItem *,int)">
+        <modify-argument index="this">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="QTreeWidgetItem(QTreeWidgetItem *,int)">
+        <modify-argument index="this">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="QTreeWidgetItem(QTreeWidgetItem *,const QStringList&lt;QString&gt; &amp;,int)">
+        <modify-argument index="this">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="QTreeWidgetItem(QTreeWidgetItem *,QTreeWidgetItem *,int)">
+        <modify-argument index="this">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="clone() const">
+        <modify-argument index="return">
+            <define-ownership class="shell" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="addChild(QTreeWidgetItem *)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="addChildren(const QList&lt;QTreeWidgetItem*&gt; &amp;)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertChild(int, QTreeWidgetItem *)">
+        <modify-argument index="2">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertChildren(int, const QList&lt;QTreeWidgetItem*&gt; &amp;)">
+        <modify-argument index="2">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="removeChild(QTreeWidgetItem*)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="default"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="takeChild(int)">
+        <modify-argument index="return">
+            <define-ownership class="java" owner="default"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="takeChildren()">
+        <modify-argument index="return">
+            <define-ownership class="java" owner="default"/>
+        </modify-argument>
+    </modify-function>
+
+      <modify-function signature="backgroundColor(int)const" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="setBackgroundColor(int, QColor)" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="setTextColor(int, QColor)" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="textColor(int)const" remove="all"/> <!--### Obsolete in 4.3-->
+  </object-type>
+
+  <object-type name="QListWidget">
+    <modify-function signature="mimeData(const QList&lt;QListWidgetItem *&gt;)const">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="addItem(QListWidgetItem *)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertItem(int, QListWidgetItem *)">
+        <modify-argument index="2">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="removeItemWidget(QListWidgetItem*)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="default"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setCurrentItem(QListWidgetItem*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setCurrentItem(QListWidgetItem*,QFlags&lt;QItemSelectionModel::SelectionFlag&gt;)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setItemHidden(const QListWidgetItem*,bool)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="isItemHidden(const QListWidgetItem*)const">
+        <remove/>
+    </modify-function>
+    <modify-function signature="setItemSelected(const QListWidgetItem*,bool)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="isItemSelected(const QListWidgetItem*)const">
+        <remove/>
+    </modify-function>
+    <modify-function signature="takeItem(int)">
+        <modify-argument index="return">
+            <define-ownership class="java" owner="default"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setItemWidget(QListWidgetItem*,QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+        <modify-argument index="2">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setModel(QAbstractItemModel*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+
+  
+<!--        <modify-function signature="addItem(const QString &amp;)" remove="all"/>-->
+        <modify-function signature="addItems(const QStringList&lt;QString&gt; &amp;)" remove="all"/>
+        <modify-function signature="insertItem(int, const QString &amp;)" remove="all"/>
+        <modify-function signature="insertItems(int, const QStringList&lt;QString&gt; &amp;)" remove="all"/>
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QListWidget___" quote-before-line="}// class"/>
+        </inject-code>
+    </object-type>
+
+  <object-type name="QWidget">
+    <extra-includes>
+        <include file-name="QIcon" location="global"/>
+        <include file-name="QMessageBox" location="global"/>
+    </extra-includes>
+
+<!-- These should be restored later after fixing abstract classes issue -->
+<!--<modify-function signature="inputContext()" remove="all"/>
+<modify-function signature="layout() const" remove="all"/>
+<modify-function signature="setLayout(QLayout*)" remove="all"/>-->
+<modify-function signature="style () const" remove="all"/>
+<!--                                                                    -->
+
+    <modify-function signature="actionEvent(QActionEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="changeEvent(QEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="closeEvent(QCloseEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="contextMenuEvent(QContextMenuEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="dragEnterEvent(QDragEnterEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="dragLeaveEvent(QDragLeaveEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="dragMoveEvent(QDragMoveEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="dropEvent(QDropEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="enterEvent(QEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="focusInEvent(QFocusEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="focusOutEvent(QFocusEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="hideEvent(QHideEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="inputMethodEvent(QInputMethodEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="keyPressEvent(QKeyEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="keyReleaseEvent(QKeyEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="leaveEvent(QEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="mouseDoubleClickEvent(QMouseEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="mouseMoveEvent(QMouseEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="mousePressEvent(QMouseEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="mouseReleaseEvent(QMouseEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="moveEvent(QMoveEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="paintEvent(QPaintEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="resizeEvent(QResizeEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="showEvent(QShowEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="tabletEvent(QTabletEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="wheelEvent(QWheelEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+<!-- qtd
+    <modify-function signature="render(QPainter*,QPoint,QRegion,QFlags&lt;QWidget::RenderFlag&gt;)">
+        <modify-argument index="2">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+
+    <inject-code class="native">
+        extern "C" JNIEXPORT void JNICALL QTJAMBI_FUNCTION_PREFIX(Java_com_trolltech_qt_gui_QWidget__1_1qt_1QMessageBox_1setWindowTitle)
+        (JNIEnv *__jni_env,
+            jclass,
+            jlong __this_nativeId,
+            jobject title0)
+        {
+            QTJAMBI_DEBUG_TRACE("(native) entering: QMessageBox::setWindowTitle(const QString &amp; title)");
+            QString __qt_title0 =  qtjambi_to_qstring(__jni_env, (jstring) title0);
+            QTJAMBI_EXCEPTION_CHECK(__jni_env);
+            QMessageBox *__qt_this = (QMessageBox *) qtjambi_from_jlong(__this_nativeId);
+            QTJAMBI_EXCEPTION_CHECK(__jni_env);
+            Q_ASSERT(__qt_this);
+            __qt_this-&gt;setWindowTitle((const QString&amp; )__qt_title0);
+            QTJAMBI_DEBUG_TRACE("(native) -&gt; leaving: QMessageBox::setWindowTitle(const QString &amp; title)");
+        }
+    </inject-code>
+
+    <inject-code class="native">
+        extern "C" JNIEXPORT void JNICALL QTJAMBI_FUNCTION_PREFIX(Java_com_trolltech_qt_gui_QWidget__1_1qt_1QMessageBox_1setWindowModality)
+        (JNIEnv *__jni_env,
+            jclass,
+            jlong __this_nativeId,
+            jint windowModality0)
+        {
+            Q_UNUSED(__jni_env);
+            QTJAMBI_DEBUG_TRACE("(native) entering: QMessageBox::setWindowModality(Qt::WindowModality modality)");
+            Qt::WindowModality __qt_windowModality0 = (Qt::WindowModality) windowModality0;
+            QTJAMBI_EXCEPTION_CHECK(__jni_env);
+            QMessageBox *__qt_this = (QMessageBox *) qtjambi_from_jlong(__this_nativeId);
+            QTJAMBI_EXCEPTION_CHECK(__jni_env);
+            Q_ASSERT(__qt_this);
+            __qt_this-&gt;setWindowModality((Qt::WindowModality )__qt_windowModality0);
+            QTJAMBI_DEBUG_TRACE("(native) -&gt; leaving: QMessageBox::setWindowModality(Qt::WindowModality modality)");
+        }
+    </inject-code>
+
+    <modify-function signature="render(QPaintDevice *, const QPoint &amp;, const QRegion &amp;, QFlags&lt;QWidget::RenderFlag&gt;)">
+        <modify-argument index="4">
+            <replace-default-expression with="RenderFlag.DrawWindowBackground, RenderFlag.DrawChildren"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="render(QPainter *, const QPoint &amp;, const QRegion &amp;, QFlags&lt;QWidget::RenderFlag&gt;)">
+        <modify-argument index="4">
+            <replace-default-expression with="RenderFlag.DrawWindowBackground, RenderFlag.DrawChildren"/>
+        </modify-argument>
+    </modify-function>
+-->	
+<!--    <modify-function signature="setFocusProxy(QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcFocusProxy"/>
+        </modify-argument>
+    </modify-function> -->
+    <modify-function signature="setInputContext(QInputContext*)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+	<!--
+    <modify-function signature="setLayout(QLayout*)">
+        <modify-argument index="1">
+            <no-null-pointer/>
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+	-->
+    <modify-function signature="setParent(QWidget*,QFlags&lt;Qt::WindowType&gt;)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setParent(QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+	<!--
+    <modify-function signature="setStyle(QStyle*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcStyle"/>
+        </modify-argument>
+    </modify-function>
+	-->
+    <modify-function signature="setTabOrder(QWidget*,QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+        <modify-argument index="2">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="getContentsMargins(int*,int*,int*,int*)const">
+        <access modifier="private"/>
+    </modify-function>
+
+    <modify-function signature="addAction(QAction *)">
+        <modify-argument index="1">
+            <reference-count action="add" variable-name="__rcActions"/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="insertAction(QAction *, QAction *)">
+        <modify-argument index="2">
+            <reference-count action="add" variable-name="__rcActions"/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="addActions(const QList&lt;QAction *&gt; &amp;)">
+        <modify-argument index="1">
+            <reference-count action="add-all" variable-name="__rcActions"/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="insertActions(QAction *, const QList&lt;QAction *&gt; &amp;)">
+        <modify-argument index="2">
+            <reference-count action="add-all" variable-name="__rcActions"/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="removeAction(QAction *)">
+        <modify-argument index="1">
+            <reference-count action="remove" variable-name="__rcActions"/>
+        </modify-argument>
+    </modify-function>
+      <modify-function signature="enabledChange(bool)" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="fontChange(QFont)" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="isEnabledToTLW()const" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="isTopLevel()const" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="paletteChange(QPalette)" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="setShown(bool)" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="topLevelWidget()const" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="windowActivationChange(bool)" remove="all"/> <!--### Obsolete in 4.3-->
+  
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QWidget___" quote-before-line="}// class"/>
+        </inject-code>
+<!--
+        <modify-function signature="setWindowTitle(const QString &amp;)">
+            <inject-code class="java">
+                <argument-map index="1" meta-name="%1"/>
+            if (this instanceof QMessageBox) {
+                qt.GeneratorUtilities.threadCheck(this);
+                if (nativeId() == 0)
+                    throw new QNoNativeResourcesException("Function call on incomplete object of type: " +getClass().getName());
+                __qt_QMessageBox_setWindowTitle(nativeId(), %1);
+                return ;
+            }
+            </inject-code>
+        </modify-function>
+
+
+        <modify-function signature="setWindowModality(Qt::WindowModality)">
+            <inject-code class="java">
+                <argument-map index="1" meta-name="%1"/>
+            if (this instanceof QMessageBox) {
+                qt.GeneratorUtilities.threadCheck(this);
+                if (nativeId() == 0)
+                    throw new QNoNativeResourcesException("Function call on incomplete object of type: " +getClass().getName());
+                __qt_QMessageBox_setWindowModality(nativeId(), %1.value());
+                return ;
+            }
+            </inject-code>
+        </modify-function>
+-->
+
+
+
+    </object-type>
+
+  <object-type name="QMessageBox">
+    <modify-function signature="open()" remove="all"/>
+    <modify-function signature="setWindowTitle(const QString &amp;)" remove="all"/>
+    <modify-function signature="setWindowModality(Qt::WindowModality)" remove="all"/>
+    <extra-includes>
+        <include file-name="QPixmap" location="global"/>
+    </extra-includes>
+    <modify-function signature="addButton(QAbstractButton*,QMessageBox::ButtonRole)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="removeButton(QAbstractButton*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setDefaultButton(QPushButton*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setEscapeButton(QAbstractButton*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+
+      <modify-function signature="QMessageBox(QString,QString,QMessageBox::Icon,int,int,int,QWidget*,QFlags&lt;Qt::WindowType&gt;)" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="buttonText(int)const" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="setButtonText(int, QString)" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="standardIcon(QMessageBox::Icon)" remove="all"/> <!--### Obsolete in 4.3-->
+
+      <modify-function signature="critical(QWidget*,QString,QString,int,int,int)" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="critical(QWidget*,QString,QString,QString,QString,QString,int,int)" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="information(QWidget*,QString,QString,int,int,int)" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="information(QWidget*,QString,QString,QString,QString,QString,int,int)" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="question(QWidget*, QString, QString, int, int, int)" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="question(QWidget*, QString, QString, QString, QString, QString, int, int)" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="warning(QWidget*, QString, QString, int, int, int)" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="warning(QWidget*, QString, QString, QString, QString, QString, int, int)" remove="all"/> <!--### Obsolete in 4.3-->
+  </object-type>
+
+  <object-type name="QAbstractSpinBox">
+    <modify-function signature="initStyleOption(QStyleOptionSpinBox*)const">
+        <access modifier="private"/>
+    </modify-function>
+    <modify-function signature="setLineEdit(QLineEdit*)">
+        <modify-argument index="1">
+            <!-- Safe to ignore because the spinbox reparents the line edit -->
+            <reference-count action="ignore"/>
+            <no-null-pointer/>
+        </modify-argument>
+    </modify-function>
+  
+        <inject-code>
+            <insert-template name="gui.init_style_option">
+                <replace from="%TYPE" to="QStyleOptionSpinBox"/>
+                <replace from="final" to=""/>
+            </insert-template>
+        </inject-code>
+
+        <modify-function signature="fixup(QString&amp;)const">
+            <modify-argument index="1">
+                <replace-type modified-type="java.lang.String"/>
+                <conversion-rule class="shell">
+                    jobject %out = (jobject) qtjambi_from_qstring(__jni_env, %in);
+                </conversion-rule>
+                <conversion-rule class="native">
+                    QString %out = qtjambi_to_qstring(__jni_env, (jstring) %in);
+                    QString *__qt_converted = &amp;%out;
+                </conversion-rule>
+            </modify-argument>
+
+            <modify-argument index="0">
+                <replace-type modified-type="java.lang.String"/>
+                <conversion-rule class="native">
+                    jobject %out = (jobject) qtjambi_from_qstring(__jni_env, *__qt_converted);
+                </conversion-rule>
+                <conversion-rule class="shell">
+                    %1 = qtjambi_to_qstring(__jni_env, (jstring) %in);
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="validate(QString&amp;,int&amp;)const">
+            <modify-argument index="1">
+                <replace-type modified-type="qt.gui.QValidator$QValidationData"/>
+                <conversion-rule class="shell">
+                    <insert-template name="gui.convert_validationdata_to_java">
+                        <replace from="%STRING" to="%1"/>
+                        <replace from="%POS" to="%2"/>
+                    </insert-template>
+                </conversion-rule>
+                <conversion-rule class="native">
+                    <insert-template name="gui.convert_validationdata_to_string"/>
+                </conversion-rule>
+            </modify-argument>
+
+            <modify-argument index="2">
+                <remove-argument/>
+                <conversion-rule class="shell">
+                    // nothing needed
+                </conversion-rule>
+                <conversion-rule class="native">
+                    <insert-template name="gui.convert_validationdata_to_pos">
+                        <replace from="%VALIDATIONDATA" to="%1"/>
+                    </insert-template>
+                </conversion-rule>
+            </modify-argument>
+
+            <modify-argument index="0">
+                <conversion-rule class="native">
+                    <insert-template name="gui.cleanup_validationdata_from_java"/>
+                    jint %out = %in;
+                </conversion-rule>
+                <conversion-rule class="shell">
+                    <insert-template name="gui.cleanup_validationdata_to_java">
+                        <replace from="%STRING" to="%1"/>
+                        <replace from="%POS" to="%2"/>
+                    </insert-template>
+                    QValidator::State %out = (QValidator::State) qtjambi_to_enumerator(__jni_env, %in);
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+    </object-type>
+
+  <object-type name="QTextFrame" delete-in-main-thread="yes">
+    <extra-includes>
+        <include file-name="QTextCursor" location="global"/>
+    </extra-includes>
+  </object-type>
+
+  <object-type name="QImageIOHandler">
+    <extra-includes>
+        <include file-name="QRect" location="global"/>
+    </extra-includes>
+    <modify-function signature="setFormat(const QByteArray &amp;)const">
+        <remove/>
+    </modify-function>
+    <modify-function signature="setDevice(QIODevice*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcDevice"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="read(QImage*)">
+        <modify-argument index="1">
+            <replace-type modified-type="QImage"/>
+<!--            <conversion-rule class="shell">
+                jobject %out = qtjambi_from_object(__jni_env, %in, "QImage", "com/trolltech/qt/gui/", false);
+
+                QtJambiLink *__link = %out != 0 ? QtJambiLink::findLink(__jni_env, %out) : 0;
+            </conversion-rule>
+            <conversion-rule class="native">
+                QImage *%out = (QImage *) qtjambi_to_object(__jni_env, %in);
+            </conversion-rule> -->
+        </modify-argument>
+<!--        <modify-argument index="0">
+            <conversion-rule class="shell">
+                // Invalidate object
+                if (__link != 0) __link-&gt;resetObject(__jni_env);
+                bool %out = (bool) %in;
+            </conversion-rule>
+        </modify-argument>-->
+    </modify-function>
+
+      <modify-function signature="name()const" remove="all"/> <!--### Obsolete in 4.3-->
+  </object-type>
+
+  <object-type name="QProxyModel">
+    <modify-function signature="parent()const" remove="all"/>
+    <extra-includes>
+        <include file-name="QPixmap" location="global"/>
+        <include file-name="QStringList" location="global"/>
+        <include file-name="QSize" location="global"/>
+    </extra-includes>
+    <modify-function signature="setModel(QAbstractItemModel*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcModel"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+
+  <object-type name="QImageReader">
+    <extra-includes>
+        <include file-name="QColor" location="global"/>
+        <include file-name="QRect" location="global"/>
+        <include file-name="QSize" location="global"/>
+        <include file-name="QStringList" location="global"/>
+        <include file-name="QImage" location="global"/>
+    </extra-includes>
+    <modify-function signature="read(QImage*) ">
+        <remove/>
+    </modify-function>
+    <modify-function signature="setDevice(QIODevice*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcDevice"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+
+  <object-type name="QMovie">
+    <extra-includes>
+        <include file-name="QColor" location="global"/>
+        <include file-name="QImage" location="global"/>
+        <include file-name="QPixmap" location="global"/>
+        <include file-name="QRect" location="global"/>
+        <include file-name="QSize" location="global"/>
+    </extra-includes>
+    <modify-function signature="cacheMode()">
+        <remove/>
+    </modify-function>
+    <modify-function signature="setDevice(QIODevice*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcDevice"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+
+  <object-type name="QPageSetupDialog">
+  </object-type>
+
+  <object-type name="QTabWidget">
+<!--    <modify-function signature="initStyleOption(QStyleOptionTabWidgetFrame*)const">
+        <access modifier="private"/>
+    </modify-function>
+    <inject-code>
+        <insert-template name="gui.init_style_option">
+            <replace from="%TYPE" to="QStyleOptionTabWidgetFrame"/>
+        </insert-template>
+    </inject-code>-->
+    <modify-function signature="addTab(QWidget*,QIcon,QString)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="addTab(QWidget*,QString)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertTab(int,QWidget*,QString)">
+        <modify-argument index="2">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertTab(int,QWidget*,QIcon,QString)">
+        <modify-argument index="2">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setCornerWidget(QWidget*,Qt::Corner)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setCurrentWidget(QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setTabBar(QTabBar*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+  <object-type name="QDrag">
+    <extra-includes>
+        <include file-name="QPoint" location="global"/>
+        <include file-name="QPixmap" location="global"/>
+    </extra-includes>
+    <modify-function signature="setMimeData(QMimeData*)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="start(QFlags&lt;Qt::DropAction&gt;)" remove="all"/> <!--### Obsolete in 4.3-->
+  </object-type>
+
+  <object-type name="QDateTimeEdit">
+    <modify-function signature="initStyleOption(QStyleOptionSpinBox*)const" access="private" rename="initDateTimeEditStyleOption"/>
+    <modify-function signature="setCalendarWidget(QCalendarWidget*)">
+        <modify-argument index="1">
+            <!-- Safe to ignore because widget is reparented -->
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+
+  
+        <inject-code>
+            <insert-template name="gui.init_style_option">
+                <replace from="%TYPE" to="QStyleOptionSpinBox"/>
+                <replace from="initStyleOption" to="initDateTimeEditStyleOption"/>
+            </insert-template>
+        </inject-code>
+    </object-type>
+
+  <object-type name="QSortFilterProxyModel">
+     <modify-function signature="parent()const" remove="all"/>
+    <extra-includes>
+        <include file-name="QItemSelection" location="global"/>
+        <include file-name="QStringList" location="global"/>
+        <include file-name="QSize" location="global"/>
+    </extra-includes>
+
+    <modify-function signature="setSourceModel(QAbstractItemModel *)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcSourceModel"/>
+        </modify-argument>
+    </modify-function>
+
+      <modify-function signature="clear()" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="filterChanged()" remove="all"/> <!--### Obsolete in 4.3-->
+  
+        <modify-function signature="match(QModelIndex, int, QVariant, int, QFlags&lt;Qt::MatchFlag&gt;) const">
+            <modify-argument index="5">
+                <replace-default-expression with="Qt.MatchFlag.MatchStartsWith, Qt.MatchFlag.MatchWrap"/>
+            </modify-argument>
+        </modify-function>
+    </object-type>
+
+  <object-type name="QSlider">
+<!--    <modify-function signature="initStyleOption(QStyleOptionSlider*)const">
+        <access modifier="private"/>
+    </modify-function>
+  
+        <inject-code>
+            <insert-template name="gui.init_style_option">
+                <replace from="%TYPE" to="QStyleOptionSlider"/>
+            </insert-template>
+        </inject-code>-->
+    </object-type>
+
+  <object-type name="QInputContext">
+    <extra-includes>
+        <include file-name="QTextFormat" location="global"/>
+    </extra-includes>
+    <modify-function signature="setFocusWidget(QWidget*)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="filterEvent(const QEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="mouseHandler(int,QMouseEvent*)">
+        <modify-argument index="2" invalidate-after-use="yes"/>
+    </modify-function>
+
+  </object-type>
+
+  <object-type name="QProgressDialog">
+    <modify-function signature="setBar(QProgressBar*)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setCancelButton(QPushButton*)">
+        <modify-argument index="1">
+            <!-- Safe to ignore because button is reparented -->
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setLabel(QLabel*)">
+        <modify-argument index="1">
+            <!-- Safe to ignore because label is reparented -->
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+
+  </object-type>
+
+  <object-type name="QLabel">
+<!--    <modify-function signature="picture()const">
+        <access modifier="private"/>
+        <rename to="picture_private"/>
+    </modify-function>
+-->
+    <modify-function signature="setBuddy(QWidget *)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcBuddy"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setMovie(QMovie *)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcMovie"/>
+        </modify-argument>
+    </modify-function>
+<!--    <modify-function signature="pixmap()const">
+        <access modifier="private"/>
+        <rename to="pixmap_private"/>
+    </modify-function>
+
+        <inject-code>
+            <insert-template name="gui.getter_returning_nativepointer">
+                <replace from="%RETURN_TYPE" to="QPicture"/>
+                <replace from="%FUNCTION_NAME" to="picture"/>
+            </insert-template>
+        </inject-code>
+        <inject-code>
+            <insert-template name="gui.getter_returning_nativepointer">
+                <replace from="%RETURN_TYPE" to="QPixmap"/>
+                <replace from="%FUNCTION_NAME" to="pixmap"/>
+            </insert-template>
+        </inject-code> -->
+    </object-type>
+
+  <object-type name="QFileDialog">
+    <extra-includes>
+        <include file-name="QUrl" location="global"/>
+    </extra-includes>
+    <modify-function signature="open()" remove="all"/>
+<!--     <modify-function signature="setVisible(bool)" remove="all"/> // properties_d -->
+    <modify-function signature="getOpenFileName(QWidget*,QString,QString,QString,QString*,QFlags&lt;QFileDialog::Option&gt;)">
+        <modify-argument index="1">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="2">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="3">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="4">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="5">
+            <remove-default-expression/>
+        </modify-argument>
+<!--        <modify-argument index="6">
+            <remove-default-expression/>
+        </modify-argument>-->
+    </modify-function>
+<!--
+    <modify-function signature="getOpenFileNames(QWidget*,QString,QString,QString,QString*,QFlags&lt;QFileDialog::Option&gt;)">
+        <access modifier="private"/>
+        <modify-argument index="1">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="2">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="3">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="4">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="5">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="6">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+-->
+    <modify-function signature="getSaveFileName(QWidget*,QString,QString,QString,QString*,QFlags&lt;QFileDialog::Option&gt;)">
+        <modify-argument index="1">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="2">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="3">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="4">
+            <remove-default-expression/>
+        </modify-argument>
+        <modify-argument index="5">
+            <remove-default-expression/>
+        </modify-argument>
+<!--        <modify-argument index="6">
+            <remove-default-expression/>
+        </modify-argument>-->
+    </modify-function>
+
+    <modify-function signature="setIconProvider(QFileIconProvider*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcIconProvider"/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="setItemDelegate(QAbstractItemDelegate*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcItemDelegate"/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="setProxyModel(QAbstractProxyModel*)">
+        <modify-argument index="1">
+            <!-- Reparented -->
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+
+  
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QFileDialog___" quote-before-line="}// class"/>
+        </inject-code>
+<!--
+        <template name="gui.filedialog_get_xxx_filename">
+        public static %TYPE %FUNCTION_NAME(QWidget parent, string caption, String dir, Filter filter, Options options) {
+            QNativePointer np = filter != null ? new QNativePointer(QNativePointer.Type.String) : null;
+            %TYPE returned = %FUNCTION_NAME(parent, caption, dir, filter != null ? filter.filter : "", np, options);
+            if (filter != null)
+                filter.selectedFilter = np.stringValue();
+            return returned;
+        }
+
+        public static %TYPE %FUNCTION_NAME(QWidget parent, String caption, String dir, Filter filter, Option ... options) {
+            QNativePointer np = filter != null ? new QNativePointer(QNativePointer.Type.String) : null;
+            %TYPE returned = %FUNCTION_NAME(parent, caption, dir, filter != null ? filter.filter : "", np, options);
+            if (filter != null)
+                filter.selectedFilter = np.stringValue();
+            return returned;
+        }
+
+        public static %TYPE %FUNCTION_NAME(QWidget parent, String caption, String dir, Filter filter) {
+            return %FUNCTION_NAME(parent, caption, dir, filter, new Options(0));
+        }
+
+        public static %TYPE %FUNCTION_NAME(QWidget parent, String caption, String dir) {
+            return %FUNCTION_NAME(parent, caption, dir, null);
+        }
+
+        public static %TYPE %FUNCTION_NAME(QWidget parent, String caption) {
+            return %FUNCTION_NAME(parent, caption, "");
+        }
+
+        public static %TYPE %FUNCTION_NAME(QWidget parent) {
+            return %FUNCTION_NAME(parent, "");
+        }
+
+        public static %TYPE %FUNCTION_NAME() {
+            return %FUNCTION_NAME(null);
+        }
+
+        </template>
+
+        <inject-code>
+            <insert-template name="gui.filedialog_get_xxx_filename">
+                <replace from="%FUNCTION_NAME" to="getOpenFileName"/>
+                <replace from="%TYPE" to="String"/>
+            </insert-template>
+        </inject-code>
+        <inject-code>
+            <insert-template name="gui.filedialog_get_xxx_filename">
+                <replace from="%FUNCTION_NAME" to="getOpenFileNames"/>
+                <replace from="%TYPE" to="java.util.List&lt;String&gt;"/>
+            </insert-template>
+        </inject-code>
+        <inject-code>
+            <insert-template name="gui.filedialog_get_xxx_filename">
+                <replace from="%FUNCTION_NAME" to="getSaveFileName"/>
+                <replace from="%TYPE" to="String"/>
+            </insert-template>
+        </inject-code>-->
+    </object-type>
+
+  <object-type name="QErrorMessage"/>
+
+  <object-type name="QTabBar">
+    <extra-includes>
+        <include file-name="QIcon" location="global"/>
+    </extra-includes>
+<!--    <modify-function signature="initStyleOption(QStyleOptionTab*,int)const">
+        <access modifier="private"/>
+    </modify-function>
+  
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QTabBar___" quote-before-line="}// class"/>
+        </inject-code>
+-->
+    </object-type>
+
+  <object-type name="QStandardItemModel">
+    <modify-function signature="insertColumn(int,const QModelIndex &amp;)" remove="all"/>
+    <modify-function signature="insertRow(int,const QModelIndex &amp;)" remove="all"/>
+    <modify-function signature="parent()const" remove="all"/>
+    <extra-includes>
+        <include file-name="QStringList" location="global"/>
+        <include file-name="QSize" location="global"/>
+    </extra-includes>
+
+    <modify-function signature="appendColumn(const QList&lt;QStandardItem *&gt;&amp;)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="takeColumn(int)">
+        <modify-argument index="return">
+            <define-ownership class="java" owner="default"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="takeRow(int)">
+        <modify-argument index="return">
+            <define-ownership class="java" owner="default"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="takeHorizontalHeaderItem(int)">
+        <modify-argument index="return">
+            <define-ownership class="java" owner="default"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="takeVerticalHeaderItem(int)">
+        <modify-argument index="return">
+            <define-ownership class="java" owner="default"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="takeItem(int,int)">
+        <modify-argument index="return">
+            <define-ownership class="java" owner="default"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="appendRow(const QList&lt;QStandardItem *&gt;&amp;)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="appendRow(QStandardItem *)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertColumn(int, const QList&lt;QStandardItem *&gt;&amp;)">
+        <modify-argument index="2">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertRow(int, const QList&lt;QStandardItem *&gt;&amp;)">
+        <modify-argument index="2">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertRow(int, QStandardItem *)">
+        <modify-argument index="2">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setHorizontalHeaderItem(int, QStandardItem *)">
+        <modify-argument index="2">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setItem(int, int, QStandardItem *)">
+        <modify-argument index="3">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setItem(int, QStandardItem *)">
+        <modify-argument index="2">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setItemPrototype(const QStandardItem *)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setVerticalHeaderItem(int, QStandardItem *)">
+        <modify-argument index="2">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+
+  <object-type name="QRadioButton">
+<!--    <modify-function signature="initStyleOption(QStyleOptionButton*)const">
+        <access modifier="private"/>
+    </modify-function>
+  
+        <inject-code>
+            <insert-template name="gui.init_style_option">
+                <replace from="%TYPE" to="QStyleOptionButton"/>
+            </insert-template>
+        </inject-code>-->
+    </object-type>
+
+  <object-type name="QScrollBar">
+<!--    <modify-function signature="initStyleOption(QStyleOptionSlider*)const">
+        <access modifier="private"/>
+    </modify-function>
+  
+        <inject-code>
+            <insert-template name="gui.init_style_option">
+                <replace from="%TYPE" to="QStyleOptionSlider"/>
+            </insert-template>
+        </inject-code>-->
+    </object-type>
+
+  <object-type name="QClipboard">
+    <extra-includes>
+        <include file-name="QImage" location="global"/>
+        <include file-name="QPixmap" location="global"/>
+    </extra-includes>
+    <modify-function signature="setMimeData(QMimeData *, QClipboard::Mode)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+
+
+  
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QClipboard___" quote-before-line="}// class"/>
+        </inject-code>
+
+    </object-type>
+
+  <object-type name="QAbstractScrollArea">
+    <modify-function signature="setupViewport(QWidget *)" access="non-final"/>
+    <modify-function signature="addScrollBarWidget(QWidget*,QFlags&lt;Qt::AlignmentFlag&gt;)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setCornerWidget(QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setHorizontalScrollBar(QScrollBar*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="setVerticalScrollBar(QScrollBar*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="setViewport(QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="setupViewport(QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="viewportEvent(QEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+
+  
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QAbstractScrollArea___" quote-before-line="}// class"/>
+        </inject-code>
+
+    </object-type>
+
+  <object-type name="QPaintEngineState">
+    <extra-includes>
+        <include file-name="QPainterPath" location="global"/>
+    </extra-includes>
+	<modify-function signature="painter() const">
+		<store-result/>
+	</modify-function>
+  </object-type>
+
+  <object-type name="QRubberBand">
+    <modify-function signature="initStyleOption(QStyleOptionRubberBand*)const">
+        <access modifier="private"/>
+    </modify-function>
+    <modify-function signature="move(int,int)" rename="moveRubberBand"/>
+    <modify-function signature="move(const QPoint &amp;)" rename="moveRubberBand"/>
+    <modify-function signature="resize(int,int)" rename="resizeRubberBand"/>
+    <modify-function signature="resize(const QSize &amp;)" rename="resizeRubberBand"/>
+    <modify-function signature="setGeometry(int,int,int,int)" rename="setRubberBandGeometry"/>
+    <modify-function signature="setGeometry(const QRect &amp;)" rename="setRubberBandGeometry"/>
+  
+        <inject-code>
+            <insert-template name="gui.init_style_option">
+                <replace from="%TYPE" to="QStyleOptionRubberBand"/>
+            </insert-template>
+        </inject-code>
+    </object-type>
+
+  <object-type name="QTextLayout">
+    <extra-includes>
+        <include file-name="QTextOption" location="global"/>
+    </extra-includes>
+  </object-type>
+
+  <object-type name="QTableWidget">
+    <modify-function signature="mimeData(const QList&lt;QTableWidgetItem*&gt;)const">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="isSortingEnabled()const" remove="all"/>
+    <modify-function signature="setSortingEnabled(bool)" remove="all"/>
+    <modify-function signature="setHorizontalHeaderItem(int, QTableWidgetItem *)">
+        <modify-argument index="2">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setItem(int, int, QTableWidgetItem *)">
+        <modify-argument index="3">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="takeHorizontalHeaderItem(int)">
+        <modify-argument index="return">
+            <define-ownership class="java" owner="default"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="takeVerticalHeaderItem(int)">
+        <modify-argument index="return">
+            <define-ownership class="java" owner="default"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="takeItem(int,int)">
+        <modify-argument index="return">
+            <define-ownership class="java" owner="default"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setItemPrototype(const QTableWidgetItem *)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setVerticalHeaderItem(int, QTableWidgetItem *)">
+        <modify-argument index="2">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setCellWidget(int,int,QWidget*)">
+        <modify-argument index="3">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setCurrentItem(QTableWidgetItem*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setCurrentItem(QTableWidgetItem*,QFlags&lt;QItemSelectionModel::SelectionFlag&gt;)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setItemSelected(const QTableWidgetItem*,bool)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="isItemSelected(const QTableWidgetItem*)const">
+        <remove/>
+    </modify-function>
+    <modify-function signature="setModel(QAbstractItemModel*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+  <object-type name="QTextDocument">
+    <extra-includes>
+        <include file-name="QTextBlock" location="global"/>
+        <include file-name="QTextFormat" location="global"/>
+        <include file-name="QTextCursor" location="global"/>
+    </extra-includes>
+    <modify-function signature="setDocumentLayout(QAbstractTextDocumentLayout*)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+<!--  
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QTextDocument___" quote-before-line="}// class"/>
+        </inject-code>
+-->
+    </object-type>
+
+  <object-type name="QSplitter">
+
+    <modify-function signature="getRange(int,int*,int*)const">
+        <access modifier="private"/>
+    </modify-function>
+    <modify-function signature="addWidget(QWidget *)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertWidget(int, QWidget *)">
+        <modify-argument index="2">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+  
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QSplitter___" quote-before-line="}// class"/>
+        </inject-code>
+
+    </object-type>
+
+  <object-type name="QGroupBox">
+    <modify-function signature="initStyleOption(QStyleOptionGroupBox*)const">
+        <access modifier="private"/>
+    </modify-function>
+  
+        <inject-code>
+            <insert-template name="gui.init_style_option">
+                <replace from="%TYPE" to="QStyleOptionGroupBox"/>
+            </insert-template>
+        </inject-code>
+    </object-type>
+
+  <object-type name="QStackedWidget">
+    <modify-function signature="addWidget(QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertWidget(int,QWidget*)">
+        <modify-argument index="2">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="removeWidget(QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setCurrentWidget(QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+
+  <object-type name="QSplitterHandle">
+  </object-type>
+
+  <object-type name="QDial">
+<!--    <modify-function signature="initStyleOption(QStyleOptionSlider*)const">
+        <access modifier="private"/>
+    </modify-function>
+  
+        <inject-code>
+            <insert-template name="gui.init_style_option">
+                <replace from="%TYPE" to="QStyleOptionSlider"/>
+            </insert-template>
+        </inject-code>-->
+    </object-type>
+
+  <object-type name="QLineEdit">
+<!--    <modify-function signature="initStyleOption(QStyleOptionFrame*)const">
+        <access modifier="private"/>
+    </modify-function>-->
+    <modify-function signature="setCompleter(QCompleter *)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcCompleter"/>
+        </modify-argument>
+    </modify-function>
+     <modify-function signature="setValidator(const QValidator *)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcValidator"/>
+        </modify-argument>
+    </modify-function>
+<!--  
+        <inject-code>
+            <insert-template name="gui.init_style_option">
+                <replace from="%TYPE" to="QStyleOptionFrame"/>
+            </insert-template>
+        </inject-code>-->
+    </object-type>
+
+  <object-type name="QLCDNumber"/>
+
+  <object-type name="QSplashScreen">
+    <modify-function signature="showMessage(const QString &amp;, int, const QColor &amp;)">
+      <modify-argument index="3">
+        <replace-default-expression with="QColor.black"/>
+      </modify-argument>
+    </modify-function>
+    <modify-function signature="repaint()" remove="all"/>
+    <modify-function signature="drawContents(QPainter*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+  </object-type>
+
+  <object-type name="QDockWidget">
+<!--    <modify-function signature="initStyleOption(QStyleOptionDockWidget*)const">
+        <access modifier="private"/>
+    </modify-function>
+	
+    <inject-code>
+        <insert-template name="gui.init_style_option">
+            <replace from="%TYPE" to="QStyleOptionDockWidget"/>
+        </insert-template>
+    </inject-code>-->
+    <modify-function signature="setTitleBarWidget(QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setWidget(QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+
+  <object-type name="QAbstractProxyModel">
+    <extra-includes>
+        <include file-name="QItemSelection" location="global"/>
+        <include file-name="QStringList" location="global"/>
+        <include file-name="QSize" location="global"/>
+    </extra-includes>
+
+    <modify-function signature="setSourceModel(QAbstractItemModel *)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcSourceModel"/>
+        </modify-argument>
+    </modify-function>
+
+  </object-type>
+
+  <object-type name="QDesktopWidget">
+  </object-type>
+
+  <object-type name="QFrame">
+  </object-type>
+
+  <object-type name="QTextTable">
+    <modify-function signature="format() const">
+        <rename to="tableFormat"/>
+    </modify-function>
+    <extra-includes>
+        <include file-name="QTextCursor" location="global"/>
+    </extra-includes>
+  </object-type>
+
+  <object-type name="QSpinBox">
+    <modify-function signature="valueChanged(const QString &amp;)">
+        <rename to="valueStringChanged"/>
+    </modify-function>
+  </object-type>
+
+  <object-type name="QTextBrowser">
+    <modify-function signature="highlighted(const QString &amp;)">
+        <rename to="highlightedString"/>
+    </modify-function>
+  </object-type>
+
+  <object-type name="QDoubleSpinBox">
+    <modify-function signature="valueChanged(const QString &amp;)">
+        <rename to="valueStringChanged"/>
+    </modify-function>
+  </object-type>
+
+  <object-type name="QButtonGroup">
+    <modify-function signature="buttonClicked(int)">
+        <rename to="buttonIdClicked"/>
+    </modify-function>
+    <modify-function signature="buttonPressed(int)">
+        <rename to="buttonIdPressed"/>
+    </modify-function>
+    <modify-function signature="buttonReleased(int)">
+        <rename to="buttonIdReleased"/>
+    </modify-function>
+    <modify-function signature="addButton(QAbstractButton *)">
+        <modify-argument index="1">
+            <reference-count action="add" variable-name="__rcButtons"/>
+            <no-null-pointer/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="addButton(QAbstractButton *, int)">
+        <modify-argument index="1">
+            <reference-count action="add" variable-name="__rcButtons"/>
+            <no-null-pointer/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="removeButton(QAbstractButton *)">
+        <modify-argument index="1">
+            <reference-count action="remove" variable-name="__rcButtons"/>
+            <no-null-pointer/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setId(QAbstractButton *,int)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+
+  <object-type name="QToolBar">
+    <modify-function signature="addAction(QAction *)" remove="all"/>
+<!--    <modify-function signature="initStyleOption(QStyleOptionToolBar*)const">
+        <access modifier="private"/>
+    </modify-function>-->
+    <modify-function signature="addAction(QIcon,QString,const QObject*,const char*)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="addAction(QString,const QObject*,const char*)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="addWidget(QWidget*)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertWidget(QAction*,QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+        <modify-argument index="2">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertSeparator(QAction*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QToolBar___" quote-before-line="}// class"/>
+        </inject-code>
+<!--  
+        <inject-code>
+            <insert-template name="gui.init_style_option">
+                <replace from="%TYPE" to="QStyleOptionToolBar"/>
+            </insert-template>
+        </inject-code>
+        <inject-code>
+            <insert-template name="gui.addAction">
+                <replace from="%POST_CALL" to=""/>
+                <replace from=" %END_EXTRA" to=""/>
+                <replace from=" %END_CALL_EXTRA" to=""/>
+                <replace from="%EXTRA" to="QIcon icon,"/>
+                <replace from="%CALL_EXTRA" to="icon,"/>
+            </insert-template>
+        </inject-code>
+        <inject-code>
+            <insert-template name="gui.addAction">
+                <replace from="%POST_CALL" to=""/>
+                <replace from=" %END_EXTRA" to=""/>
+                <replace from=" %END_CALL_EXTRA" to=""/>
+                <replace from="%EXTRA " to=""/>
+                <replace from="%CALL_EXTRA " to=""/>
+            </insert-template>
+        </inject-code> -->
+    </object-type>
+
+  <object-type name="QPaintEngine">
+
+	<modify-function signature="painter() const">
+		<store-result/>
+	</modify-function>
+
+    <modify-function signature="begin(QPaintDevice*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="updateState(QPaintEngineState)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="drawTextItem(QPointF,QTextItem)">
+        <modify-argument index="2" invalidate-after-use="yes"/>
+    </modify-function>
+
+    <extra-includes>
+        <include file-name="QVarLengthArray" location="global"/>
+    </extra-includes>
+    <modify-function signature="setPaintDevice(QPaintDevice*)">
+        <remove/>
+    </modify-function>
+    <modify-field name="state" read="false" write="false"/>
+<!--  
+        <modify-function signature="drawLines(const QLine *, int)">
+            <modify-argument index="1">
+                <replace-type modified-type="qt.gui.QLine[]"/>
+                <conversion-rule class="shell">
+                jobjectArray %out = qtjambi_from_array(__jni_env, %in, %2,
+                                                       "QLine", "com/trolltech/qt/gui/");
+                </conversion-rule>
+                <conversion-rule class="native">
+                QVarLengthArray&lt;QLine, 32&gt; __lines;
+                int __size = %1 == 0 ? 0 : __jni_env-&gt;GetArrayLength((jarray) %1);
+                for (int i=0; i&lt;__size; ++i)
+                    __lines.append(*(QLine *)qtjambi_to_object(__jni_env, __jni_env-&gt;GetObjectArrayElement((jobjectArray) %in, i)));
+                const QLine *%out = %1 == 0 ? 0 : __lines.constData();
+                </conversion-rule>
+
+            </modify-argument>
+            <modify-argument index="2">
+                <remove-argument/>
+                <conversion-rule class="shell">
+                /* nothing */
+                </conversion-rule>
+                <conversion-rule class="native">
+                int %out = %1 == 0 ? 0 : __jni_env-&gt;GetArrayLength((jarray) %1);
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="drawLines(const QLineF *, int)">
+            <modify-argument index="1">
+                <replace-type modified-type="qt.gui.QLineF[]"/>
+                <conversion-rule class="shell">
+                jobjectArray %out = qtjambi_from_array(__jni_env, %in, %2,
+                                                       "QLineF", "com/trolltech/qt/gui/");
+                </conversion-rule>
+                <conversion-rule class="native">
+                QVarLengthArray&lt;QLineF, 32&gt; __data;
+                int __size = %1 == 0 ? 0 : __jni_env-&gt;GetArrayLength((jarray) %1);
+                for (int i=0; i&lt;__size; ++i)
+                    __data.append(*(QLineF *)qtjambi_to_object(__jni_env, __jni_env-&gt;GetObjectArrayElement((jobjectArray) %in, i)));
+                const QLineF *%out = %1 == 0 ? 0 : __data.constData();
+                </conversion-rule>
+            </modify-argument>
+            <modify-argument index="2">
+                <remove-argument/>
+                <conversion-rule class="shell">
+                /* nothing */
+                </conversion-rule>
+                <conversion-rule class="native">
+                int %out = %1 == 0 ? 0 : __jni_env-&gt;GetArrayLength((jarray) %1);
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="drawRects(const QRectF *, int)">
+            <modify-argument index="1">
+                <replace-type modified-type="qt.core.QRectF[]"/>
+                <conversion-rule class="shell">
+                jobjectArray %out = qtjambi_from_array(__jni_env, %in, %2,
+                                                       "QRectF", "com/trolltech/qt/core/");
+                </conversion-rule>
+                <conversion-rule class="native">
+                QVarLengthArray&lt;QRectF, 32&gt; __data;
+                int __size = %1 == 0 ? 0 : __jni_env-&gt;GetArrayLength((jarray) %1);
+                for (int i=0; i&lt;__size; ++i)
+                    __data.append(*(QRectF *)qtjambi_to_object(__jni_env, __jni_env-&gt;GetObjectArrayElement((jobjectArray) %in, i)));
+                const QRectF *%out = %1 == 0 ? 0 : __data.constData();
+                </conversion-rule>
+            </modify-argument>
+            <modify-argument index="2">
+                <remove-argument/>
+                <conversion-rule class="shell">
+                /* nothing */
+                </conversion-rule>
+                <conversion-rule class="native">
+                int %out = %1 == 0 ? 0 : __jni_env-&gt;GetArrayLength((jarray) %1);
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="drawRects(const QRect *, int)">
+            <modify-argument index="1">
+                <replace-type modified-type="qt.core.QRect[]"/>
+                <conversion-rule class="shell">
+                jobjectArray %out = qtjambi_from_array(__jni_env, %in, %2,
+                                                       "QRect", "com/trolltech/qt/core/");
+                </conversion-rule>
+                <conversion-rule class="native">
+                QVarLengthArray&lt;QRect, 32&gt; __data;
+                int __size = %1 == 0 ? 0 : __jni_env-&gt;GetArrayLength((jarray) %1);
+                for (int i=0; i&lt;__size; ++i)
+                    __data.append(*(QRect *)qtjambi_to_object(__jni_env, __jni_env-&gt;GetObjectArrayElement((jobjectArray) %in, i)));
+                const QRect *%out = %1 == 0 ? 0 : __data.constData();
+                </conversion-rule>
+            </modify-argument>
+            <modify-argument index="2">
+                <remove-argument/>
+                <conversion-rule class="shell">
+                /* nothing */
+                </conversion-rule>
+                <conversion-rule class="native">
+                int %out = %1 == 0 ? 0 : __jni_env-&gt;GetArrayLength((jarray) %1);
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="drawPoints(const QPoint *, int)">
+            <modify-argument index="1">
+                <replace-type modified-type="qt.core.QPoint[]"/>
+                <conversion-rule class="shell">
+                jobjectArray %out = qtjambi_from_array(__jni_env, %in, %2,
+                                                       "QPoint", "com/trolltech/qt/core/");
+                </conversion-rule>
+                <conversion-rule class="native">
+                QVarLengthArray&lt;QPoint, 32&gt; __data;
+                int __size = %1 == 0 ? 0 : __jni_env-&gt;GetArrayLength((jarray) %1);
+                for (int i=0; i&lt;__size; ++i)
+                    __data.append(*(QPoint *)qtjambi_to_object(__jni_env, __jni_env-&gt;GetObjectArrayElement((jobjectArray) %in, i)));
+                const QPoint *%out = %1 == 0 ? 0 : __data.constData();
+                </conversion-rule>
+            </modify-argument>
+
+            <modify-argument index="2">
+                <remove-argument/>
+                <conversion-rule class="shell">
+                /* nothing */
+                </conversion-rule>
+                <conversion-rule class="native">
+                int %out = %1 == 0 ? 0 : __jni_env-&gt;GetArrayLength((jarray) %1);
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="drawPoints(const QPointF *, int)">
+            <modify-argument index="1">
+                <replace-type modified-type="qt.core.QPointF[]"/>
+                <conversion-rule class="shell">
+                jobjectArray %out = qtjambi_from_array(__jni_env, %in, %2,
+                                                       "QPointF", "com/trolltech/qt/core/");
+                </conversion-rule>
+                <conversion-rule class="native">
+                QVarLengthArray&lt;QPointF, 32&gt; __data;
+                int __size = %1 == 0 ? 0 : __jni_env-&gt;GetArrayLength((jarray) %1);
+                for (int i=0; i&lt;__size; ++i)
+                    __data.append(*(QPointF *)qtjambi_to_object(__jni_env, __jni_env-&gt;GetObjectArrayElement((jobjectArray) %in, i)));
+                const QPointF *%out = %1 == 0 ? 0 : __data.constData();
+                </conversion-rule>
+            </modify-argument>
+            <modify-argument index="2">
+                <remove-argument/>
+                <conversion-rule class="shell">
+                /* nothing */
+                </conversion-rule>
+                <conversion-rule class="native">
+                int %out = %1 == 0 ? 0 : __jni_env-&gt;GetArrayLength((jarray) %1);
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="drawPolygon(const QPoint *, int, QPaintEngine::PolygonDrawMode)">
+            <modify-argument index="1">
+                <replace-type modified-type="qt.core.QPoint[]"/>
+                <conversion-rule class="shell">
+                jobjectArray %out = qtjambi_from_array(__jni_env, %in, %2,
+                                                       "QPoint", "com/trolltech/qt/core/");
+                </conversion-rule>
+                <conversion-rule class="native">
+                QVarLengthArray&lt;QPoint, 32&gt; __data;
+                int __size = %1 == 0 ? 0 : __jni_env-&gt;GetArrayLength((jarray) %1);
+                for (int i=0; i&lt;__size; ++i)
+                    __data.append(*(QPoint *)qtjambi_to_object(__jni_env, __jni_env-&gt;GetObjectArrayElement((jobjectArray) %in, i)));
+                const QPoint *%out = %1 == 0 ? 0 : __data.constData();
+                </conversion-rule>
+            </modify-argument>
+            <modify-argument index="2">
+                <remove-argument/>
+                <conversion-rule class="shell">
+                /* nothing */
+                </conversion-rule>
+                <conversion-rule class="native">
+                int %out = %1 == 0 ? 0 : __jni_env-&gt;GetArrayLength((jarray) %1);
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="drawPolygon(const QPointF *, int, QPaintEngine::PolygonDrawMode)">
+            <modify-argument index="1">
+                <replace-type modified-type="qt.core.QPointF[]"/>
+                <conversion-rule class="shell">
+                jobjectArray %out = qtjambi_from_array(__jni_env, %in, %2,
+                                                       "QPointF", "com/trolltech/qt/core/");
+                </conversion-rule>
+                <conversion-rule class="native">
+                QVarLengthArray&lt;QPointF, 32&gt; __data;
+                int __size = %1 == 0 ? 0 : __jni_env-&gt;GetArrayLength((jarray) %1);
+                for (int i=0; i&lt;__size; ++i)
+                    __data.append(*(QPointF *)qtjambi_to_object(__jni_env, __jni_env-&gt;GetObjectArrayElement((jobjectArray) %in, i)));
+                const QPointF *%out = %1 == 0 ? 0 : __data.constData();
+                </conversion-rule>
+            </modify-argument>
+            <modify-argument index="2">
+                <remove-argument/>
+                <conversion-rule class="shell">
+                /* nothing */
+                </conversion-rule>
+                <conversion-rule class="native">
+                int %out = %1 == 0 ? 0 : __jni_env-&gt;GetArrayLength((jarray) %1);
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+		-->
+    </object-type>
+
+  <object-type name="QAbstractTableModel">
+    <extra-includes>
+        <include file-name="QStringList" location="global"/>
+        <include file-name="QSize" location="global"/>
+    </extra-includes>
+  </object-type>
+
+  <object-type name="QGuiSignalMapper">
+        <modify-function signature="setMapping(QObject*,QWidget*)">
+            <modify-argument index="1">
+                <reference-count action="add" declare-variable="qt.core.QSignalMapper" variable-name="__rcMappings"/>
+            </modify-argument>
+            <inject-code class="java" position="end">
+                <argument-map index="1" meta-name="%1"/>
+                <argument-map index="2" meta-name="%2"/>
+                java.util.Hashtable&lt;qt.core.QObject, Object&gt; __rcWidgetForObject = (java.util.Hashtable&lt;qt.core.QObject, Object&gt;) qt.GeneratorUtilities.fetchField(this, qt.core.QSignalMapper.class, "__rcWidgetForObject");
+                if (%2 == null)
+                    __rcWidgetForObject.remove(%1);
+                else
+                    __rcWidgetForObject.put(%1,%2);
+            </inject-code>
+        </modify-function>
+    </object-type>
+
+  <object-type name="QComboBox">
+<!--    <modify-function signature="initStyleOption(QStyleOptionComboBox*)const">
+        <access modifier="private"/>
+    </modify-function>-->
+    <modify-function signature="setCompleter(QCompleter*)">
+        <modify-argument index="1">
+            <reference-count variable-name="__rcCompleter" action="set"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setValidator(const QValidator*)">
+        <modify-argument index="1">
+            <reference-count variable-name="__rcValidator" action="set"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setItemDelegate(QAbstractItemDelegate *)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+            <no-null-pointer/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setView(QAbstractItemView *)">
+        <modify-argument index="1">
+            <no-null-pointer/>
+            <!-- Safe to ignore because combo box reparents view -->
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setLineEdit(QLineEdit *)">
+        <modify-argument index="1">
+            <no-null-pointer/>
+            <!-- Safe to ignore because combo box reparents line edit -->
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setModel(QAbstractItemModel *)">
+        <modify-argument index="1">
+            <no-null-pointer/>
+            <reference-count action="set" variable-name="__rcModel"/>
+        </modify-argument>
+    </modify-function>
+<!--    <inject-code>
+        <insert-template name="gui.init_style_option">
+            <replace from="%TYPE" to="QStyleOptionComboBox"/>
+        </insert-template>
+    </inject-code>-->
+    <inject-code>
+        <import-file name="typesystem_gui-java.java" quote-after-line="class QComboBox___" quote-before-line="}// class"/>
+    </inject-code>
+    <modify-function signature="activated(int)">&gt;
+        <rename to="activatedIndex"/>
+    </modify-function>
+    <modify-function signature="currentIndexChanged(const QString &amp;)">
+        <rename to="currentStringChanged"/>
+    </modify-function>
+    <modify-function signature="highlighted(int)">
+        <rename to="highlightedIndex"/>
+    </modify-function>
+
+      <modify-function signature="autoCompletion()const" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="autoCompletionCaseSensitivity()const" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="setAutoCompletion(bool)" remove="all"/> <!--### Obsolete in 4.3-->
+      <modify-function signature="setAutoCompletionCaseSensitivity(Qt::CaseSensitivity)" remove="all"/> <!--### Obsolete in 4.3-->
+  </object-type>
+
+  <object-type name="QTextEdit">
+    <extra-includes>
+        <include file-name="QTextCursor" location="global"/>
+    </extra-includes>
+    <modify-function signature="setDocument(QTextDocument*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcDocument"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertFromMimeData(const QMimeData*)    ">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+
+  <object-type name="QPrinter" delete-in-main-thread="yes">
+  
+  
+    <modify-function signature="setEngines(QPrintEngine*,QPaintEngine*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcPrintEngine"/>
+        </modify-argument>
+        <modify-argument index="2">
+            <reference-count action="set" variable-name="__rcPaintEngine"/>
+        </modify-argument>
+    </modify-function>
+  
+        <modify-function signature="getPageMargins(double*,double*,double*,double*,QPrinter::Unit)const" access="private"/>
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QPrinter___" quote-before-line="}// class"/>
+        </inject-code>
+    </object-type>
+
+  <object-type name="QAction">
+      <modify-function signature="setMenu(QMenu*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcMenu"/>
+        </modify-argument>
+    </modify-function>
+
+  
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QAction___" quote-before-line="}// class"/>
+        </inject-code>
+<!--
+        <modify-function signature="setActionGroup(QActionGroup*)">
+            <modify-argument index="1">
+                <reference-count action="ignore"/>
+            </modify-argument>
+            <inject-code position="end">
+                <argument-map index="1" meta-name="%1"/>
+            java.util.Collection&lt;Object&gt; __rcTmp = null;
+            if (__rcActionGroup != null) {
+                __rcTmp = (java.util.Collection&lt;Object&gt;)qt.GeneratorUtilities.fetchField(__rcActionGroup, QActionGroup.class, "__rcActions");
+                while (__rcTmp.contains(this))
+                    __rcTmp.remove(this);
+            }
+            __rcActionGroup = %1;
+            if (__rcActionGroup != null) {
+                __rcTmp = (java.util.Collection&lt;Object&gt;)qt.GeneratorUtilities.fetchField(__rcActionGroup, QActionGroup.class, "__rcActions");
+                __rcTmp.add(this);
+            }
+            </inject-code>
+        </modify-function>
+		-->
+    </object-type>
+
+  <object-type name="QPainter">
+<!--  <add-class name="QPaintEngineState"/> -->
+    <extra-includes>
+      <include file-name="QWidget" location="global"/>
+      <include file-name="QPainterPath" location="global"/>
+      <include file-name="QPixmap" location="global"/>
+	  <include file-name="qt.gui.QGradient" location="java"/>
+    </extra-includes>
+
+    <modify-function signature="drawText(const QPointF &amp;, const QString &amp;, int, int)" remove="all"/>
+
+    <modify-function signature="drawConvexPolygon(const QPoint *, int)">
+      <access modifier="private"/>
+    </modify-function>
+    <modify-function signature="drawConvexPolygon(const QPointF *, int)">
+      <access modifier="private"/>
+    </modify-function>
+    <modify-function signature="drawLines(const QLine *, int)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="drawLines(const QLineF *, int)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="drawLines(const QPoint *, int)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="drawLines(const QPointF *, int)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="drawPoints(const QPoint *, int)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="drawPoints(const QPointF *, int)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="drawPolygon(const QPoint *, int, Qt::FillRule)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="drawPolygon(const QPointF *, int, Qt::FillRule)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="drawPolyline(const QPoint *, int)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="drawPolyline(const QPointF *, int)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="drawRects(const QRect *, int)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="drawRects(const QRectF *, int)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="drawLines(const QVector&lt;QPoint&gt; &amp;)">
+        <rename to="drawLinesFromPoints"/>
+    </modify-function>
+    <modify-function signature="drawLines(const QVector&lt;QPointF&gt; &amp;)">
+        <rename to="drawLinesFromPointsF"/>
+    </modify-function>
+    <modify-function signature="drawLines(const QVector&lt;QLineF&gt; &amp;)">
+        <rename to="drawLinesF"/>
+    </modify-function>
+    <modify-function signature="drawRects(const QVector&lt;QRectF&gt; &amp;)">
+        <rename to="drawRectsF"/>
+    </modify-function>
+
+    <modify-function signature="QPainter(QPaintDevice *)">
+        <modify-argument index="1">
+            <no-null-pointer/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="begin(QPaintDevice *)">
+        <modify-argument index="1">
+            <no-null-pointer/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="initFrom(const QWidget *)">
+        <modify-argument index="1">
+            <no-null-pointer/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setRedirected(const QPaintDevice *, QPaintDevice *, const QPoint &amp;)">
+        <modify-argument index="1">
+            <no-null-pointer/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="restoreRedirected(const QPaintDevice *)">
+        <modify-argument index="1">
+            <no-null-pointer/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="drawText(QRect,int,QString,QRect*)">
+        <access modifier="private"/>
+        <modify-argument index="4">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="drawText(QRectF,int,QString,QRectF*)">
+        <access modifier="private"/>
+        <modify-argument index="4">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="drawText(int,int,int,int,int,QString,QRect*)">
+        <access modifier="private"/>
+        <modify-argument index="7">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="redirected(const QPaintDevice*,QPoint*)">
+        <access modifier="private"/>
+        <modify-argument index="2">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="matrix()const" remove="all"/> <!--### Obsolete in 4.3-->
+    <modify-function signature="matrixEnabled()const" remove="all"/> <!--### Obsolete in 4.3-->
+    <modify-function signature="setMatrix(QMatrix, bool)" remove="all"/> <!--### Obsolete in 4.3-->
+    <modify-function signature="setMatrixEnabled(bool)" remove="all"/> <!--### Obsolete in 4.3-->
+  
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QPainter___" quote-before-line="}// class"/>
+        </inject-code>
+<!--
+    <inject-code class="destructor-function">
+      if (((QPainter *) ptr)-&gt;isActive()) {
+          qWarning("QPainter: trying to delete an active painter, "
+                       "did you forget to call \"end()\"?\n");
+              return;
+          }
+        </inject-code>
+
+        <template name="gui.painter_draw_text_general">
+        public final void drawText(%RECT_ARGUMENTS, int flags, String text, %RECT_TYPE boundingRect) {
+            drawText(%RECT_CALL_ARGUMENTS, flags, text, boundingRect == null ? null : boundingRect.nativePointer());
+        }
+
+        public final void drawText(%RECT_ARGUMENTS, int flags, String text) {
+            drawText(%RECT_CALL_ARGUMENTS, flags, text, (%RECT_TYPE) null);
+        }
+        </template>
+
+        <template name="gui.painter_draw_text_qrect">
+            <insert-template name="gui.painter_draw_text_general">
+                <replace from="%RECT_ARGUMENTS" to="%RECT_TYPE rectangle"/>
+                <replace from="%RECT_CALL_ARGUMENTS" to="rectangle"/>
+            </insert-template>
+        </template>
+        <inject-code>
+            <insert-template name="gui.painter_draw_text_qrect">
+                <replace from="%RECT_TYPE" to="qt.core.QRect"/>
+            </insert-template>
+        </inject-code>
+        <inject-code>
+            <insert-template name="gui.painter_draw_text_qrect">
+                <replace from="%RECT_TYPE" to="qt.core.QRectF"/>
+            </insert-template>
+        </inject-code>
+        <inject-code>
+            <insert-template name="gui.painter_draw_text_general">
+                <replace from="%RECT_TYPE" to="qt.core.QRect"/>
+                <replace from="%RECT_ARGUMENTS" to="int x, int y, int width, int height"/>
+                <replace from="%RECT_CALL_ARGUMENTS" to="x, y, width, height"/>
+            </insert-template>
+        </inject-code>
+
+
+        <modify-function signature="setRedirected(const QPaintDevice*, QPaintDevice*, const QPoint &amp;)">
+            <modify-argument index="1">
+                <reference-count action="ignore"/>
+            </modify-argument>
+            <modify-argument index="2">
+                <reference-count action="ignore"/>
+            </modify-argument>
+            <inject-code position="end">
+                <argument-map index="1" meta-name="%1"/>
+                <argument-map index="2" meta-name="%2"/>
+            __rcRedirections.push(%1);
+            __rcRedirections.push(%2);
+            </inject-code>
+        </modify-function>
+        <modify-function signature="restoreRedirected(const QPaintDevice*)">
+            <inject-code position="end">
+            if (!__rcRedirections.empty()) __rcRedirections.pop();
+            if (!__rcRedirections.empty()) __rcRedirections.pop();
+            </inject-code>
+        </modify-function>
+		-->
+    </object-type>
+
+  <object-type name="QApplication">
+    <extra-includes>
+      <include file-name="QBasicTimer" location="global"/>
+      <include file-name="QFont" location="global"/>
+      <include file-name="QFontMetrics" location="global"/>
+      <include file-name="QPalette" location="global"/>
+      <include file-name="QIcon" location="global"/>
+      <include file-name="QLocale" location="global"/>
+
+      <include file-name="qt.qtd.Str" location="java"/>
+    </extra-includes>
+
+    <!-- qtd2 -->
+    <modify-function signature="inputContext() const" remove="all"/>
+    <modify-function signature="setStyle(QStyle*)" remove="all"/>
+    <modify-function signature="setStyle(const QString&amp;)" remove="all"/>
+    <modify-function signature="style()" remove="all"/>
+
+
+    <modify-function signature="QApplication(int &amp;, char  **, int)">
+        <access modifier="private"/>
+    </modify-function>
+    <modify-function signature="QApplication(int &amp;, char **, QApplication::Type, int)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="QApplication(int &amp;, char **, bool, int)">
+        <remove/>
+    </modify-function>
+
+    <modify-function signature="font(const char*)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="setFont(QFont,const char*)">
+        <access modifier="private"/>
+        <modify-argument index="2">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="palette(const char*)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="setPalette(QPalette,const char*)">
+        <access modifier="private"/>
+        <modify-argument index="2">
+            <remove-default-expression/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="overrideCursor()">
+        <access modifier="private"/>
+        <rename to="overrideCursor_private"/>
+    </modify-function>
+
+    <modify-function signature="setInputContext(QInputContext*)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setActiveWindow(QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+<!--    <modify-function signature="setStyle(QStyle*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+  -->
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QApplication___" quote-before-line="}// class"/>
+        </inject-code>
+<!--        <modify-function signature="QApplication(int &amp;, char  **, int)">
+            <inject-code class="shell">
+                qtjambi_register_variant_handler();
+            </inject-code>
+        </modify-function>-->
+        <template name="gui.application_char_pointer_function">
+        public static %RETURN_TYPE %FUNCTION_NAME(%PRE_ARGUMENTS %COMMA QByteArray className) {
+            return %FUNCTION_NAME(%PRE_CALL_ARGUMENTS %COMMA className == null ? null : className.data());
+        }
+        </template>
+    </object-type>
+
+  <object-type name="QCommandLinkButton"/>
+  <object-type name="QFileSystemModel">
+    <modify-function signature="setIconProvider(QFileIconProvider*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcIconProvider"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+  <object-type name="QFormLayout">
+    <modify-function signature="addRow(QWidget*,QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+        <modify-argument index="2">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="addRow(QLayout*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="addRow(QWidget*,QLayout*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+        <modify-argument index="2">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="addRow(QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="addRow(QString,QLayout*)">
+        <modify-argument index="2">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="addRow(QString,QWidget*)">
+        <modify-argument index="2">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertRow(int,QLayout*)">
+        <modify-argument index="2">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertRow(int,QWidget*,QLayout*)">
+        <modify-argument index="2">
+            <reference-count action="ignore"/>
+        </modify-argument>
+        <modify-argument index="3">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertRow(int,QWidget*,QWidget*)">
+        <modify-argument index="2">
+            <reference-count action="ignore"/>
+        </modify-argument>
+        <modify-argument index="3">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertRow(int,QWidget*)">
+        <modify-argument index="2">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertRow(int,QString,QLayout*)">
+        <modify-argument index="3">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertRow(int,QString,QWidget*)">
+        <modify-argument index="3">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setLayout(int,QFormLayout::ItemRole,QLayout*)">
+        <modify-argument index="3">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setWidget(int,QFormLayout::ItemRole,QWidget*)">
+        <modify-argument index="3">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setItem(int,QFormLayout::ItemRole,QLayoutItem*)" access="private" rename="setItem_private">
+        <modify-argument index="3">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="addItem(QLayoutItem*)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+  
+        <modify-function signature="getLayoutPosition(QLayout*,int*,QFormLayout::ItemRole*)const" access="private"/>
+        <modify-function signature="getWidgetPosition(QWidget*,int*,QFormLayout::ItemRole*)const" access="private"/>
+        <modify-function signature="getItemPosition(int,int*,QFormLayout::ItemRole*)const" access="private"/>
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QFormLayout___" quote-before-line="}// class"/>
+        </inject-code>
+    </object-type>
+  <object-type name="QGraphicsGridLayout" delete-in-main-thread="yes">
+    <modify-function signature="addItem(QGraphicsLayoutItem*,int,int,QFlags&lt;Qt::AlignmentFlag&gt;)">
+        <modify-argument index="1">
+            <reference-count action="add" variable-name="__rcItems"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="addItem(QGraphicsLayoutItem*,int,int,int,int,QFlags&lt;Qt::AlignmentFlag&gt;)">
+        <modify-argument index="1">
+            <reference-count action="add" variable-name="__rcItems"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setAlignment(QGraphicsLayoutItem*,QFlags&lt;Qt::AlignmentFlag&gt;)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+  <object-type name="QGraphicsLayout" delete-in-main-thread="yes">
+
+    <modify-function signature="widgetEvent(QEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="setParentLayoutItem(QGraphicsLayoutItem*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcParentLayoutItem"/>
+        </modify-argument>
+    </modify-function>
+  
+       <!-- <modify-function signature="getContentsMargins(double*,double*,double*,double*)const" access="private"/> -->
+	<modify-function signature="getContentsMargins(double*,double*,double*,double*)const" remove="all"/>
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class Subclass_of_QGraphicsLayoutItem___" quote-before-line="}// class"/>
+        </inject-code>
+    </object-type>
+  <interface-type name="QGraphicsLayoutItem" delete-in-main-thread="yes">
+  	<modify-function signature="setExtension(QGraphicsItem::Extension,QVariant)" remove="all"/>
+	<modify-function signature="supportsExtension(QGraphicsItem::Extension)const" remove="all"/>
+	<modify-function signature="getContentsMargins(double*,double*,double*,double*)const" remove="all"/>
+  <!--
+    <modify-function signature="setParentLayoutItem(QGraphicsLayoutItem*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcParentLayoutItem"/>
+        </modify-argument>
+    </modify-function>
+  
+        <modify-function signature="getContentsMargins(double*,double*,double*,double*)const" access="private"/>
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class Subclass_of_QGraphicsLayoutItem___" quote-before-line="}// class"/>
+        </inject-code>
+        <inject-code class="interface">
+            public QMarginsF getContentsMargins();
+        </inject-code>  
+    -->
+    </interface-type>
+ 
+  <object-type name="QGraphicsLinearLayout" delete-in-main-thread="yes">
+    <modify-function signature="addItem(QGraphicsLayoutItem*)">
+        <modify-argument index="1">
+            <reference-count action="add" variable-name="__rcItems"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertItem(int,QGraphicsLayoutItem*)">
+        <modify-argument index="2">
+            <reference-count action="add" variable-name="__rcItems"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="removeItem(QGraphicsLayoutItem*)">
+        <modify-argument index="1">
+            <reference-count action="remove" variable-name="__rcItems"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setAlignment(QGraphicsLayoutItem*,QFlags&lt;Qt::AlignmentFlag&gt;)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setStretchFactor(QGraphicsLayoutItem*,int)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+  <object-type name="QGraphicsProxyWidget">
+    <modify-function signature="getContentsMargins(double*,double*,double*,double*)const" remove="all" />  
+    <!--
+    <modify-function signature="setWidget(QWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+        <inject-code>
+            <argument-map index="1" meta-name="%1"/>
+            if (%1 != null)
+                %1.disableGarbageCollection();
+            else if (widget() != null)
+                widget().reenableGarbageCollection();
+        </inject-code>
+    </modify-function>
+    -->
+    </object-type> <!-- a QObject so main-thread delete redundant -->
+  <object-type name="QGraphicsWidget">  <!-- a QObject so main-thread delete redundant -->
+    <!-- Duplicate function to QObject::children() to override accidental shadowing which is not present in Jambi -->
+    <modify-function signature="children()const" remove="all"/>
+    <modify-function signature="setLayout(QGraphicsLayout*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcLayout"/>
+        </modify-argument>
+    </modify-function>
+
+    <modify-function signature="changeEvent(QEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="closeEvent(QCloseEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="grabKeyboardEvent(QEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="grabMouseEvent(QEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="hideEvent(QHideEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="moveEvent(QGraphicsSceneMoveEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="paintWindowFrame(QPainter*,const QStyleOptionGraphicsItem*,QWidget*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="resizeEvent(QGraphicsSceneResizeEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="showEvent(QShowEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="ungrabKeyboardEvent(QEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="ungrabMouseEvent(QEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="windowFrameEvent(QEvent*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+
+    <modify-function signature="setStyle(QStyle*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcStyle"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setTabOrder(QGraphicsWidget*,QGraphicsWidget*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+        <modify-argument index="2">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+  <!--
+        <modify-function signature="getContentsMargins(double*,double*,double*,double*)const" access="private"/>
+        <modify-function signature="getWindowFrameMargins(double*,double*,double*,double*)const" access="private"/>
+   
+        <inject-code>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class QGraphicsWidget___" quote-before-line="}// class"/>
+            <import-file name="typesystem_gui-java.java" quote-after-line="class Subclass_of_QGraphicsLayoutItem___" quote-before-line="}// class"/>
+        </inject-code>
+    -->
+        <modify-function signature="initStyleOption(QStyleOption*)const">
+	    <!--
+            <modify-argument index="1">
+                <replace-type modified-type="qt.gui.QStyleOption"/>
+                <conversion-rule class="shell">
+                    jobject %out = qtjambi_from_object(__jni_env, %in, "QStyleOption", "com/trolltech/qt/gui/", "Lcom_trolltech_qt_gui_QStyleOption_2", false);
+                    jobject __tmp = %out;
+                </conversion-rule>
+                <conversion-rule class="native">
+                    QStyleOption *%out = (QStyleOption *) qtjambi_to_object(__jni_env, %in);
+                </conversion-rule>
+            </modify-argument>
+            <modify-argument index="return">
+                <conversion-rule class="shell">
+                    // Make sure the java object is not usable after this, since
+                    // the QStyleOption* may be deleted at any time.
+                    qtjambi_invalidate_object(__jni_env, __tmp);
+                    __tmp = 0;
+                </conversion-rule>
+            </modify-argument>
+	    -->
+        </modify-function>
+
+        <modify-function signature="paintWindowFrame(QPainter*,const QStyleOptionGraphicsItem*,QWidget*)">
+	<!--
+            <modify-argument index="2">
+                <conversion-rule class="shell">
+                    jobject %out = qtjambi_from_object(__jni_env, %in, "QStyleOptionGraphicsItem", "com/trolltech/qt/gui/", "Lcom_trolltech_qt_gui_QStyleOption_2", true);
+                </conversion-rule>
+                <conversion-rule class="native">
+                    const QStyleOptionGraphicsItem *%out = (QStyleOptionGraphicsItem *) qtjambi_to_object(__jni_env, %in);
+                </conversion-rule>
+                <replace-type modified-type="qt.gui.QStyleOptionGraphicsItem"/>
+            </modify-argument>
+	 -->
+        </modify-function>
+
+    </object-type>
+  <object-type name="QPlainTextDocumentLayout"/>
+  <object-type name="QPlainTextEdit">
+    <modify-function signature="setDocument(QTextDocument*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcDocument"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="insertFromMimeData(const QMimeData*)">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+  <object-type name="QPrintPreviewDialog"/>
+  <object-type name="QPrintPreviewWidget"/>
+  <object-type name="QStyledItemDelegate">
+    <modify-function signature="setItemEditorFactory(QItemEditorFactory*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcItemEditorFactory"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setEditorData(QWidget*,QModelIndex)const">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+    <modify-function signature="setModelData(QWidget*,QAbstractItemModel*,QModelIndex)const">
+        <modify-argument index="1">
+            <reference-count action="ignore"/>
+        </modify-argument>
+    </modify-function>
+  
+        <modify-function signature="initStyleOption(QStyleOptionViewItem*,QModelIndex)const">
+            <modify-argument index="1">
+                <conversion-rule class="shell">
+                    jobject %out = qtjambi_from_object(__jni_env, %in, "QStyleOptionViewItem", "com/trolltech/qt/gui/", "Lcom_trolltech_qt_gui_QStyleOption_2", false);
+                </conversion-rule>
+                <conversion-rule class="native">
+                    QStyleOptionViewItem *%out = (QStyleOptionViewItem *) qtjambi_to_object(__jni_env, %in);
+                </conversion-rule>
+                <replace-type modified-type="qt.gui.QStyleOptionViewItem"/>
+            </modify-argument>
+        </modify-function>
+    </object-type>
+
+  <interface-type name="QAccessibleFactoryInterface" java-name="QAbstractAccessibleFactory"/>
+  <interface-type name="QIconEngineFactoryInterfaceV2" java-name="QAbstractIconEngineFactoryV2"/>
+  <interface-type name="QImageIOHandlerFactoryInterface" java-name="QAbstractImageIOHandlerFactory"/>
+  <interface-type name="QInputContextFactoryInterface" java-name="QAbstractInputContextFactory"/>
+  <interface-type name="QStyleFactoryInterface" java-name="QAbstractStyleFactory"/>
+  <interface-type name="QTextCodecFactoryInterface" java-name="QAbstractTextCodecFactory"/>
+  <interface-type name="QPictureFormatInterface" java-name="QAbstractPictureFormat">
+        <modify-function signature="loadPicture(QString,QString,QPicture*)">
+            <modify-argument index="3">
+                <replace-type modified-type="qt.gui.QPicture"/>
+                <conversion-rule class="shell">
+                    jobject %out = qtjambi_from_object(__jni_env, %in, "QPicture", "com/trolltech/qt/gui/", false);
+                    jobject __tmp = %out;
+                </conversion-rule>
+                <conversion-rule class="native">
+                    QPicture *%out = (QPicture *) qtjambi_to_object(__jni_env, %in);
+                </conversion-rule>
+            </modify-argument>
+            <modify-argument index="return">
+                <conversion-rule class="shell">
+                    // Make sure the java object is not usable after this, since
+                    // the QPicture* may be deleted at any time.
+                    qtjambi_invalidate_object(__jni_env, __tmp);
+                    __tmp = 0;
+                    bool %out = (bool) %in;
+                </conversion-rule>
+                <conversion-rule class="native">
+                    jboolean %out = (jboolean) %in;
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+    </interface-type>
+
+  <object-type name="QIconEnginePluginV2"/>
+  <object-type name="QAccessiblePlugin"/>
+  <object-type name="QImageIOPlugin"/>
+  <object-type name="QInputContextPlugin"/>
+  <object-type name="QPictureFormatPlugin"/>
+  <object-type name="QStylePlugin"/>
+  <object-type name="QTextCodecPlugin"/>
+
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QPixmap::QPixmap', unmatched parameter type 'QPixmapData*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type '*Private&amp;'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type '*Private\*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type '*Private const\*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QTextEngine\*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QFontEngine\*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QPixmap::Type'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QInputDialog::Type'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QTextFrameLayoutData\*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QAbstractUndoItem\*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type '*QImageTextKeyLang*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: non-public function '*' in interface '*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: visibility of function '*' modified in class '*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: hiding of function '*' in class '*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: unsupported default value 'QVector&lt;FormatRange&gt;()' of argument in function '*', class '*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: unsupported default value 'QVariantList()' of argument in function '*', class '*'"/>
+  <suppress-warning text="WARNING(CppImplGenerator) :: protected function '*' in final class '*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QTextLayout::QTextLayout', unmatched parameter type 'QTextEngine*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: unsupported default value of argument in function 'doAction', class 'QAccessibleInterface'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QFileDialog::QFileDialog', unmatched parameter type 'QFileDialogArgs const&amp;'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: unsupported default value '0., 0., 1000000000., 1000000000.' of argument in function 'update', class 'QAbstractTextDocumentLayout'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QWidget::windowSurface', unmatched return type 'QWindowSurface*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QWidget::setWindowSurface', unmatched parameter type 'QWindowSurface*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: enum 'QStyleOption::StyleOptionType' does not have a type entry or is not an enum"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: unhandled enum value: ~FlagMask in QMessageBox::StandardButton"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: unmatched enum ~FlagMask"/>
+  <suppress-warning text="WARNING(MetaInfoGenerator) :: class 'QGraphicsSceneEvent' inherits from polymorphic class 'QEvent', but has no polymorphic id set"/>
+  <suppress-warning text="WARNING(MetaInfoGenerator) :: class 'QInputEvent' inherits from polymorphic class 'QEvent', but has no polymorphic id set"/>
+  <suppress-warning text="WARNING(JavaGenerator) :: either add or remove specified for reference count variable '__rcMenus' in 'qt.gui.QMenu' but not both"/>
+  <suppress-warning text="WARNING(JavaGenerator) :: either add or remove specified for reference count variable '__rcMenus' in 'qt.gui.QMenuBar' but not both"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QBrush' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QTextFrame_iterator' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QRegion' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QPolygon' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QTextTableCell' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QTextLength' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QPalette' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QTextBlock_iterator' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QTextBlock' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QTextCursor' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QFont' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QMatrix' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QPen' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QColor' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QTransform' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QPainterPath_Element' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QPainterPath' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QItemSelection' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QKeySequence' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QLine' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QPolygonF' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QSizePolicy' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QTextFragment' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QFontMetrics' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QGradient' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QFontMetricsF' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QTextFormat' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QLineF' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QImage' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QNetworkCookie' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QNetworkRequest' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QPixmap::pixmapData', unmatched return type 'QPixmapData*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: object type 'QAccessible' extended by interface type 'QAbstractAccessibleFactory'. The resulting API will be less expressive than the original."/>
+
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QTextOption_Tab' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Rejected enum has no alternative...: QPalette::NColorRoles"/>
+
+</typesystem>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/typesystem_network-common.xml	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,155 @@
+<typesystem>
+  <namespace-type name="QSsl">
+    <include file-name="qssl.h" location="global" />
+  </namespace-type>
+
+  <enum-type name="QAbstractSocket::NetworkLayerProtocol" />
+  <enum-type name="QAbstractSocket::SocketError" />
+  <enum-type name="QAbstractSocket::SocketState" />
+  <enum-type name="QAbstractSocket::SocketType" />
+  <enum-type name="QFtp::Command" />
+  <enum-type name="QFtp::Error" />
+  <enum-type name="QFtp::State" />
+  <enum-type name="QFtp::TransferMode" />
+  <enum-type name="QFtp::TransferType" />
+  <enum-type name="QHostAddress::SpecialAddress" />
+  <enum-type name="QHttp::Error" />
+  <enum-type name="QHttp::State" />
+  <enum-type name="QHttp::ConnectionMode" />
+  <enum-type name="QNetworkInterface::InterfaceFlag" flags="QNetworkInterface::InterfaceFlags" />
+  <enum-type name="QNetworkProxy::ProxyType" />
+  <enum-type name="QUdpSocket::BindFlag" flags="QUdpSocket::BindMode" />
+  <enum-type name="QUrlInfo::PermissionSpec" />
+  <enum-type name="QHostInfo::HostInfoError" />
+  <enum-type name="QSsl::KeyType" />
+  <enum-type name="QSsl::EncodingFormat" />
+  <enum-type name="QSsl::KeyAlgorithm"/>
+  <enum-type name="QSsl::AlternateNameEntryType"/>
+  <enum-type name="QSsl::SslProtocol" />
+  <enum-type name="QLocalSocket::LocalSocketError" />
+  <enum-type name="QLocalSocket::LocalSocketState" />
+  <enum-type name="QNetworkAccessManager::Operation" />
+  <enum-type name="QNetworkCookie::RawForm" />
+  <enum-type name="QNetworkReply::NetworkError" />
+  <enum-type name="QNetworkRequest::Attribute" extensible="yes" />
+  <enum-type name="QNetworkRequest::CacheLoadControl" />
+  <enum-type name="QNetworkRequest::KnownHeaders" />
+
+  <object-type name="QAbstractSocket" />
+  <object-type name="QFtp" />
+
+  <object-type name="QHttp">
+      <modify-function signature="closeConnection()" remove="all"/>
+  </object-type>
+  <object-type name="QTcpServer" />
+  <object-type name="QTcpSocket" />
+  <object-type name="QUdpSocket" />
+
+  <object-type name="QHttpHeader">
+    <modify-function signature="operator=(QHttpHeader)" remove="all"/>
+  </object-type>
+  <object-type name="QLocalServer" />
+  <object-type name="QLocalSocket" />
+  <object-type name="QNetworkAccessManager">
+    <modify-function signature="setCookieJar(QNetworkCookieJar*)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++" />
+        </modify-argument>
+    </modify-function>
+  </object-type>
+  <object-type name="QNetworkCookieJar" />
+  <object-type name="QNetworkReply" />
+
+  <value-type name="QHostAddress">
+    <modify-function signature="QHostAddress(unsigned char*)" remove="all"/>
+    <modify-function signature="setAddress(unsigned char*)" remove="all"/>
+    <modify-function signature="operator=(QString)" remove="all"/>
+    <modify-function signature="operator=(QHostAddress)" remove="all"/>
+  </value-type>
+
+  <value-type name="QHostInfo">
+        <modify-function signature="operator=(QHostInfo)" remove="all"/>
+        <modify-function signature="lookupHost(QString,QObject*,const char*)" access="private" />
+  </value-type>
+
+  <value-type name="QHttpRequestHeader">
+    <modify-function signature="operator=(QHttpRequestHeader)" remove="all"/>
+  </value-type>
+
+  <value-type name="QHttpResponseHeader">
+    <modify-function signature="operator=(QHttpResponseHeader)" remove="all"/>
+  </value-type>
+
+  <value-type name="QNetworkAddressEntry">
+    <modify-function signature="operator=(QNetworkAddressEntry)" remove="all"/>
+  </value-type>
+
+  <value-type name="QNetworkInterface">
+    <modify-function signature="operator=(QNetworkInterface)" remove="all"/>
+  </value-type>
+
+  <value-type name="QNetworkProxy">
+    <modify-function signature="operator=(QNetworkProxy)" remove="all"/>
+  </value-type>
+
+  <value-type name="QUrlInfo">
+    <modify-function signature="operator=(QUrlInfo)" remove="all"/>
+  </value-type>
+
+  <value-type name="QIPv6Address">
+    <modify-function signature="operator[](int)const">
+        <remove/>
+    </modify-function>
+    <modify-function signature="operator[](int)">
+        <remove/>
+    </modify-function>
+  </value-type>
+
+  <value-type name="QAuthenticator">
+    <modify-function signature="operator=(QAuthenticator)" remove="all"/>
+  </value-type>
+  <value-type name="QNetworkCookie">
+    <modify-function signature="operator=(QNetworkCookie)" remove="all" />
+  </value-type>
+  <value-type name="QNetworkRequest">
+    <modify-function signature="operator=(QNetworkRequest)" remove="all" />
+  </value-type>
+
+  <enum-type name="QSslError::SslError"/>
+  <enum-type name="QSslCertificate::SubjectInfo" />
+  <enum-type name="QSslSocket::SslMode" />
+  <enum-type name="QSslSocket::PeerVerifyMode" />
+
+  <value-type name="QSslCipher" />
+  <value-type name="QSslError" />
+  <value-type name="QSslKey" />
+  <value-type name="QSslCertificate" />
+  <value-type name="QSslConfiguration" />
+
+  <object-type name="QSslSocket" />
+
+  <suppress-warning text="*unmatched parameter type 'sockaddr const*" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QUrlInfo' has equals operators but no qHash() function" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QAuthenticator' has equals operators but no qHash() function" />
+
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QSslKey' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QSslError' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QSslCertificate' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QSslCipher' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QSslConfiguration' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QNetworkProxy' has equals operators but no qHash() function" />
+
+  <!-- For people building without SSL support -->
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.network.QSslSocket' for enum 'SslMode' is not declared" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QSslError' is specified in typesystem, but not defined. This could potentially lead to compilation errors." />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QSslCipher' is specified in typesystem, but not defined. This could potentially lead to compilation errors." />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QSslKey' is specified in typesystem, but not defined. This could potentially lead to compilation errors." />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.network.QSslError' for enum 'SslError' is not declared" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QSslCertificate' is specified in typesystem, but not defined. This could potentially lead to compilation errors." />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.network.QSslSocket' for enum 'PeerVerifyMode' is not declared"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.network.QSslCertificate' for enum 'SubjectInfo' is not declared"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QSslConfiguration' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QSslSocket' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <!-- -->
+
+</typesystem>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/typesystem_network-java.java	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,466 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+package generator;
+
+import qt.*;
+import qt.network.*;
+
+class QHostInfo___ extends QHostInfo {
+    /**
+     * Looks up the IP address(es) associated with host name <code>name</code>,
+     * and returns an ID for the lookup. When the result of the lookup is ready,
+     * the specified method in <code>receiver</code> is called with a
+     * <code>QHostInfo</code> argument. The <code>QHostInfo</code> object can
+     * then be inspected to get the results of the lookup.
+     *
+     * @param name The host name.
+     * @param receiver The object on which the method will be called.
+     * @param methodName The name of a method which takes a single <code>QHostInfo</code> argument.
+     */
+    public static int lookupHost(String name, qt.core.QObject receiver, String methodName)
+    {
+        methodName = qt.internal.QtJambiInternal.SlotPrefix + methodName + "(QHostInfo)";
+        return lookupHost(name, receiver, qt.QNativePointer.createCharPointer(methodName));
+    }
+
+    /**
+     * Looks up the IP address(es) associated with host name <code>name</code>,
+     * and returns an ID for the lookup. When the result of the lookup is ready,
+     * the specified signal is emitted with a <code>QHostInfo</code> argument.
+     * The <code>QHostInfo</code> object can then be inspected to get the results
+     * of the lookup.
+     *
+     * @param name The host name.
+     * @param signal The signal to emit. Must take a single <code>QHostInfo</code>
+     *               argument, and must be contained in a <code>QObject</code>
+     *               subclass.
+     */
+    public static int lookupHost(String name, qt.QSignalEmitter.Signal1<QHostInfo> signal)
+    {
+        if (!(signal.containingObject() instanceof qt.core.QObject)) {
+            throw new IllegalArgumentException("Only signals contained in QObject subclasses are supported. "
+                                             + "Signal's class is '" + signal.containingObject().getClass() + "'.");
+        }
+
+        String methodName = qt.internal.QtJambiInternal.SignalPrefix + signal.name() + "(QHostInfo)";
+        return lookupHost(name, (qt.core.QObject)signal.containingObject(),
+                          qt.QNativePointer.createCharPointer(methodName));
+    }
+}// class
+
+class QAbstractSocket___ extends QAbstractSocket {
+
+    public Signal2<QNetworkProxy, QAuthenticator> proxyAuthenticationRequired = new Signal2<QNetworkProxy, QAuthenticator>();
+    private boolean inEmission = false;
+
+    private void emitProxyAuthenticationRequiredPrivate(QNetworkProxy proxy, QAuthenticator authenticator) {
+        if (!inEmission) {
+            inEmission = true;
+            proxyAuthenticationRequiredPrivate.emit(proxy, authenticator.nativePointer());
+            inEmission = false;
+        }
+    }
+
+    private void emitProxyAuthenticationRequired(QNetworkProxy proxy, QNativePointer authenticator) {
+        if (!inEmission) {
+            inEmission = true;
+            proxyAuthenticationRequired.emit(proxy, QAuthenticator.fromNativePointer(authenticator));
+            inEmission = false;
+        }
+    }
+
+    public final void connectToHost(String host, int port, qt.core.QIODevice.OpenMode mode) {
+        connectToHost(host, (char) port, mode);
+    }
+
+    public final void connectToHost(String host, int port, qt.core.QIODevice.OpenModeFlag ... mode) {
+        connectToHost(host, (char) port, mode);
+    }
+
+    public final void connectToHost(String host, int port) {
+        connectToHost(host, (char) port);
+    }
+
+    public final void connectToHost(QHostAddress host, int port, qt.core.QIODevice.OpenMode mode) {
+        connectToHost(host, (char) port, mode);
+    }
+
+    public final void connectToHost(QHostAddress host, int port, qt.core.QIODevice.OpenModeFlag ... mode) {
+        connectToHost(host, (char) port, mode);
+    }
+
+    public final void connectToHost(QHostAddress host, int port)
+    {
+        connectToHost(host, (char) port);
+    }
+
+    protected void connectToHostImplementation(String host, int port, qt.core.QIODevice.OpenMode mode) {
+        connectToHostImplementation(host, (char) port, mode);
+    }
+
+    protected void connectToHostImplementation(String host, int port, qt.core.QIODevice.OpenModeFlag ... mode) {
+        connectToHostImplementation(host, (char) port, mode);
+    }
+
+    protected void connectToHostImplementation(String host, int port) {
+        connectToHostImplementation(host, (char) port);
+    }
+
+    public final int localPort()
+    {
+        return localPort_private();
+    }
+
+    public final int peerPort() {
+        return peerPort_private();
+    }
+
+    protected final void setLocalPort(int port) {
+        setLocalPort((char) port);
+    }
+
+    protected final void setPeerPort(int port) {
+        setPeerPort((char) port);
+    }
+
+}// class
+
+class QSslSocket___ extends QSslSocket {
+
+    protected void connectToHostImplementation(String host, int port, qt.core.QIODevice.OpenMode mode) {
+        connectToHostImplementation(host, (char) port, mode);
+    }
+
+    protected void connectToHostImplementation(String host, int port, qt.core.QIODevice.OpenModeFlag ... mode) {
+        connectToHostImplementation(host, (char) port, mode);
+    }
+
+    protected void connectToHostImplementation(String host, int port) {
+        connectToHostImplementation(host, (char) port);
+    }
+}// class
+
+class QHttp___ extends QHttp {
+
+    public Signal2<QNetworkProxy, QAuthenticator> proxyAuthenticationRequired = new Signal2<QNetworkProxy, QAuthenticator>();
+    private boolean inEmission = false;
+
+    private void emitProxyAuthenticationRequiredPrivate(QNetworkProxy proxy, QAuthenticator authenticator) {
+        if (!inEmission) {
+            inEmission = true;
+            proxyAuthenticationRequiredPrivate.emit(proxy, authenticator.nativePointer());
+            inEmission = false;
+        }
+    }
+
+    private void emitProxyAuthenticationRequired(QNetworkProxy proxy, QNativePointer authenticator) {
+        if (!inEmission) {
+            inEmission = true;
+            proxyAuthenticationRequired.emit(proxy, QAuthenticator.fromNativePointer(authenticator));
+            inEmission = false;
+        }
+    }
+
+    public Signal3<String, Integer, QAuthenticator> authenticationRequired = new Signal3<String, Integer, QAuthenticator>();
+    private boolean inEmissionAuthenticationRequired = false;
+
+    private void emitAuthenticationRequiredPrivate(String hostName, int port, QAuthenticator authenticator) {
+        if (!inEmissionAuthenticationRequired) {
+            inEmissionAuthenticationRequired = true;
+            authenticationRequiredPrivate.emit(hostName, (char) port, authenticator.nativePointer());
+            inEmissionAuthenticationRequired = false;
+        }
+    }
+
+    private void emitAuthenticationRequired(String hostName, char port, QNativePointer authenticator) {
+        if (!inEmissionAuthenticationRequired) {
+            inEmissionAuthenticationRequired = true;
+            authenticationRequired.emit(hostName, (int) port, QAuthenticator.fromNativePointer(authenticator));
+            inEmissionAuthenticationRequired = false;
+        }
+    }
+
+    public QHttp(String hostname) {
+        this(hostname, (char) 80);
+    }
+
+    public QHttp(String hostname, int port) {
+        this(hostname, (char) port);
+    }
+
+    public QHttp(String hostname, int port, qt.core.QObject parent) {
+        this(hostname, (char) port, parent);
+    }
+
+    public QHttp(java.lang.String hostname, qt.network.QHttp.ConnectionMode mode) {
+        this(hostname, mode, '\0');
+    }
+
+    public QHttp(String hostname, QHttp.ConnectionMode mode, int port) {
+        this(hostname, mode, (char) port);
+    }
+
+    public QHttp(String hostname, QHttp.ConnectionMode mode, int port, qt.core.QObject parent) {
+        this(hostname, mode, (char) port, parent);
+    }
+
+    public final int setHost(String hostName, QHttp.ConnectionMode mode) {
+        return setHost(hostName, mode, '\0');
+    }
+
+    public final int setHost(String hostname, QHttp.ConnectionMode mode, int port) {
+        return setHost(hostname, mode, (char) port);
+    }
+
+    public final int setHost(String hostname) {
+        return setHost(hostname, (char) 80);
+    }
+
+    public final int setHost(String hostname, int port) {
+        return setHost(hostname, (char) port);
+    }
+
+}// class
+
+class QTcpServer___ extends QTcpServer {
+
+    public final boolean listen(QHostAddress address, int port) {
+        return listen(address, (char) port);
+    }
+
+    public final boolean listen(QHostAddress address) {
+        return listen(address, '\0');
+    }
+
+    public final boolean listen() {
+        return listen(new qt.network.QHostAddress(qt.network.QHostAddress.SpecialAddress.Any));
+    }
+
+    public final int serverPort() {
+        return serverPort_private();
+    }
+
+    public enum Result {
+        Success, Failure, TimedOut
+    }
+
+    public final Result waitForNewConnection(int msec) {
+        QNativePointer np = new QNativePointer(QNativePointer.Type.Boolean);
+        boolean success = waitForNewConnection(msec, np);
+
+        return (np.booleanValue() ? Result.TimedOut : (success ? Result.Success : Result.Failure));
+    }
+
+    public final Result waitForNewConnection() {
+        return waitForNewConnection(0);
+    }
+
+}// class
+
+class QUdpSocket___ extends QUdpSocket {
+
+    public final boolean bind(QHostAddress address, int port) {
+        return bind_private(address, (char) port);
+    }
+
+    public final boolean bind() {
+        return bind_private();
+    }
+
+    public final boolean bind(int port) {
+        return bind_private((char) port);
+    }
+
+    public final boolean bind(QHostAddress address, int port, BindFlag ... mode) {
+        return bind_private(address, (char) port, mode);
+    }
+
+    public final boolean bind(QHostAddress address, int port, BindMode mode) {
+        return bind_private(address, (char) port, mode);
+    }
+
+    public final boolean bind(int port, BindFlag ... mode) {
+        return bind_private((char) port, mode);
+    }
+
+    public final boolean bind(int port, BindMode mode) {
+        return bind_private((char) port, mode);
+    }
+
+    public static class HostInfo {
+        public HostInfo() {
+            address = new QHostAddress();
+            port = 0;
+        }
+
+        public QHostAddress address;
+        public int port;
+    }
+
+    public final int readDatagram(byte data[], HostInfo info) {
+        QNativePointer np = new QNativePointer(QNativePointer.Type.Byte, data.length);
+        QNativePointer address = info != null && info.address != null ? info.address.nativePointer() : null;
+        QNativePointer port = new QNativePointer(QNativePointer.Type.Char);
+
+        int len = (int) readDatagram(np, data.length, address, port);
+        if (info != null)
+            info.port = port.charValue();
+        for (int i = 0; i < len; ++i)
+            data[i] = np.byteAt(i);
+
+        return len;
+    }
+
+    public final int readDatagram(byte data[]) {
+        return readDatagram(data, null);
+    }
+
+    public final int writeDatagram(byte data[], QHostAddress address, int port) {
+        QNativePointer np = qt.internal.QtJambiInternal.byteArrayToNativePointer(data);
+        return (int) writeDatagram(np, data.length, address, (char) port);
+    }
+
+    public final int writeDatagram(qt.core.QByteArray data, QHostAddress address, int port) {
+        return (int) writeDatagram(data, address, (char) port);
+    }
+
+}// class
+
+class QNetworkProxy___ extends QNetworkProxy {
+
+    public QNetworkProxy(QNetworkProxy.ProxyType type) {
+        this(type, null, '\0');
+    }
+
+    public QNetworkProxy(QNetworkProxy.ProxyType type, String host) {
+        this(type, host, '\0');
+    }
+
+    public QNetworkProxy(QNetworkProxy.ProxyType type, String host, int port) {
+        this(type, host, (char) port);
+    }
+
+    public QNetworkProxy(QNetworkProxy.ProxyType type, String host, int port, String username) {
+        this(type, host, (char) port, username);
+    }
+
+    public QNetworkProxy(QNetworkProxy.ProxyType type, String host, int port, String username, String password) {
+        this(type, host, (char) port, username, password);
+    }
+
+    public final void setPort(int port) {
+        setPort((char) port);
+    }
+
+    public final int port() {
+        return port_private();
+    }
+
+}// class
+
+class QNetworkAccessManager___ extends QNetworkAccessManager {
+    public Signal2<QNetworkProxy, QAuthenticator> proxyAuthenticationRequired = new Signal2<QNetworkProxy, QAuthenticator>();
+    private boolean inEmission = false;
+
+    private void emitProxyAuthenticationRequiredPrivate(QNetworkProxy proxy, QAuthenticator authenticator)
+    {
+        if (!inEmission)
+        {
+            inEmission = true;
+            proxyAuthenticationRequiredPrivate.emit(proxy, authenticator.nativePointer());
+            inEmission = false;
+        }
+    }
+
+    private void emitProxyAuthenticationRequired(QNetworkProxy proxy, QNativePointer authenticator)
+    {
+        if (!inEmission)
+        {
+            inEmission = true;
+            proxyAuthenticationRequired.emit(proxy, QAuthenticator.fromNativePointer(authenticator));
+            inEmission = false;
+        }
+    }
+
+    public Signal2<QNetworkReply, QAuthenticator> authenticationRequired = new Signal2<QNetworkReply, QAuthenticator>();
+    private boolean inEmissionAuthenticationRequired = false;
+
+    private void emitAuthenticationRequiredPrivate(QNetworkReply reply, QAuthenticator authenticator)
+    {
+        if (!inEmissionAuthenticationRequired)
+        {
+            inEmissionAuthenticationRequired = true;
+            authenticationRequiredPrivate.emit(reply, authenticator.nativePointer());
+            inEmissionAuthenticationRequired = false;
+        }
+    }
+
+    private void emitAuthenticationRequired(QNetworkReply reply, QNativePointer authenticator)
+    {
+        if (!inEmissionAuthenticationRequired)
+        {
+            inEmissionAuthenticationRequired = true;
+            authenticationRequired.emit(reply, QAuthenticator.fromNativePointer(authenticator));
+            inEmissionAuthenticationRequired = false;
+        }
+    }
+
+}// class
+
+class QLocalServer___ extends QLocalServer {
+
+    public enum Result {
+        Success, Failure, TimedOut
+    }
+
+    public final Result waitForNewConnection(int msec) {
+        QNativePointer np = new QNativePointer(QNativePointer.Type.Boolean);
+        boolean success = waitForNewConnection(msec, np);
+
+        return (np.booleanValue() ? Result.TimedOut : (success ? Result.Success : Result.Failure));
+    }
+
+    public final Result waitForNewConnection() {
+        return waitForNewConnection(0);
+    }
+
+}// class
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/typesystem_network-java.xml	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,290 @@
+<?xml version="1.0"?>
+<typesystem package="qt.network" default-superclass="qt.QtJambiObject">
+    <inject-code>
+        qt.Utilities.loadQtLibrary("QtNetwork");
+    </inject-code>
+
+    <template name="network.read_char*_long_long">
+        public final int read(byte data[]) {
+            if (data.length == 0) return 0;
+
+            qt.QNativePointer np = new qt.QNativePointer(qt.QNativePointer.Type.Byte, data.length);
+            int len = (int) read(np, data.length);
+            for (int i=0; i&lt;len; ++i) data[i] = np.byteAt(i);
+
+            return len;
+        }
+    </template>
+
+
+
+    <object-type name="QAbstractSocket">
+        <inject-code>
+            <import-file name="typesystem_network-java.java" quote-after-line="class QAbstractSocket___" quote-before-line="}// class"/>
+        </inject-code>
+        <inject-code class="constructors">
+proxyAuthenticationRequired.connect(this, "emitProxyAuthenticationRequiredPrivate(QNetworkProxy, QAuthenticator)", qt.core.Qt.ConnectionType.DirectConnection);
+proxyAuthenticationRequiredPrivate.connect(this, "emitProxyAuthenticationRequired(QNetworkProxy,QNativePointer)", qt.core.Qt.ConnectionType.DirectConnection);
+        </inject-code>
+        <modify-function signature="proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)">
+            <access modifier="private"/>
+            <rename to="proxyAuthenticationRequiredPrivate"/>
+        </modify-function>
+        <modify-function signature="connectToHostImplementation(QString, unsigned short, QFlags&lt;QIODevice::OpenModeFlag&gt;)" access="private" />
+        <modify-function signature="localPort()const" access="private" rename="localPort_private"/>
+        <modify-function signature="peerPort()const" access="private" rename="peerPort_private"/>
+        <modify-function signature="setLocalPort(unsigned short)" access="private"/>
+        <modify-function signature="setPeerPort(unsigned short)" access="private"/>
+        <modify-function signature="connectToHost(QString, unsigned short, QFlags&lt;QIODevice::OpenModeFlag&gt;)" access="private"/>
+        <modify-function signature="connectToHost(QHostAddress, unsigned short, QFlags&lt;QIODevice::OpenModeFlag&gt;)" access="private"/>
+
+        <modify-function signature="abort()" access="non-final" />
+        <modify-function signature="disconnectFromHostImplementation()" access="non-final" />
+        <modify-function signature="flush()" access="non-final" />
+        <modify-function signature="setReadBufferSize(long long)" access="non-final" />
+    <modify-function signature="setSocketDescriptor(int,QAbstractSocket::SocketState,QFlags&lt;QIODevice::OpenModeFlag&gt;)" access="non-final" />
+        <modify-function signature="waitForConnected(int)" access="non-final" />
+        <modify-function signature="waitForDisconnected(int)" access="non-final" />
+
+    </object-type>
+
+    <value-type name="QHostInfo">
+        <inject-code class="java">
+            <import-file name="typesystem_network-java.java" quote-after-line="class QHostInfo___" quote-before-line="}// class"/>
+        </inject-code>
+    </value-type>
+
+
+    <object-type name="QFtp">
+        <modify-function signature="read(char*,long long)">
+            <access modifier="private"/>
+        </modify-function>
+        <inject-code>
+            <insert-template name="network.read_char*_long_long"/>
+        </inject-code>
+    </object-type>
+
+
+    <object-type name="QHttp">
+        <inject-code>
+            <import-file name="typesystem_network-java.java" quote-after-line="class QHttp___" quote-before-line="}// class"/>
+        </inject-code>
+        <modify-function signature="proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)">
+            <access modifier="private"/>
+            <rename to="proxyAuthenticationRequiredPrivate"/>
+        </modify-function>
+
+        <modify-function signature="authenticationRequired(QString,unsigned short,QAuthenticator*)">
+            <access modifier="private"/>
+            <rename to="authenticationRequiredPrivate"/>
+        </modify-function>
+
+        <inject-code class="constructors">
+proxyAuthenticationRequired.connect(this, "emitProxyAuthenticationRequiredPrivate(QNetworkProxy, QAuthenticator)", qt.core.Qt.ConnectionType.DirectConnection);
+proxyAuthenticationRequiredPrivate.connect(this, "emitProxyAuthenticationRequired(QNetworkProxy,QNativePointer)", qt.core.Qt.ConnectionType.DirectConnection);
+authenticationRequired.connect(this, "emitAuthenticationRequiredPrivate(String, int, QAuthenticator)", qt.core.Qt.ConnectionType.DirectConnection);
+authenticationRequiredPrivate.connect(this, "emitAuthenticationRequired(String, char, QNativePointer)", qt.core.Qt.ConnectionType.DirectConnection);
+        </inject-code>
+
+        <modify-function signature="QHttp(const QString &amp;, unsigned short, QObject *)" access="private">
+            <modify-argument index="2">
+                <remove-default-expression />
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="QHttp(const QString &amp;, QHttp::ConnectionMode, unsigned short, QObject *)" access="private">
+            <modify-argument index="3">
+                <remove-default-expression />
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="read(char*,long long)">
+            <access modifier="private"/>
+        </modify-function>
+        <inject-code>
+            <insert-template name="network.read_char*_long_long"/>
+        </inject-code>
+        <modify-function signature="setSocket(QTcpSocket*)">
+            <modify-argument index="1">
+                <reference-count action="set" variable-name="__rcSocket"/>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="setHost(QString, unsigned short)" access="private">
+            <modify-argument index="2">
+                <remove-default-expression />
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="setHost(QString, QHttp::ConnectionMode, unsigned short)" access="private">
+            <modify-argument index="3">
+                <remove-default-expression />
+            </modify-argument>
+        </modify-function>
+
+    </object-type>
+
+
+
+    <object-type name="QTcpServer">
+        <inject-code>
+            <import-file name="typesystem_network-java.java" quote-after-line="class QTcpServer___" quote-before-line="}// class"/>
+        </inject-code>
+        <extra-includes>
+            <include file-name="qt.QNativePointer" location="java"/>
+        </extra-includes>
+        <modify-function signature="listen(QHostAddress,unsigned short)" access="private">
+            <modify-argument index="1">
+                <remove-default-expression />
+            </modify-argument>
+            <modify-argument index="2">
+                <remove-default-expression />
+            </modify-argument>
+        </modify-function>
+
+
+        <modify-function signature="serverPort()const" access="private" rename="serverPort_private"/>
+
+
+        <modify-function signature="waitForNewConnection(int,bool*)">
+            <access modifier="private"/>
+            <modify-argument index="1">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="2">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+
+    </object-type>
+
+    <object-type name="QTcpSocket">
+        <inject-code class="constructors">
+            proxyAuthenticationRequired.connect(this, "emitProxyAuthenticationRequiredPrivate(QNetworkProxy, QAuthenticator)", qt.core.Qt.ConnectionType.DirectConnection);
+            AbstractSignal sig = (AbstractSignal) qt.GeneratorUtilities.fetchField(this, QAbstractSocket.class, "proxyAuthenticationRequiredPrivate");
+            sig.connect(this, "emitProxyAuthenticationRequired(QNetworkProxy,QNativePointer)", qt.core.Qt.ConnectionType.DirectConnection);
+        </inject-code>
+    </object-type>
+
+
+    <object-type name="QUdpSocket">
+        <inject-code>
+            <import-file name="typesystem_network-java.java" quote-after-line="class QUdpSocket___" quote-before-line="}// class"/>
+        </inject-code>
+        <inject-code class="constructors">
+proxyAuthenticationRequired.connect(this, "emitProxyAuthenticationRequiredPrivate(QNetworkProxy, QAuthenticator)", qt.core.Qt.ConnectionType.DirectConnection);
+AbstractSignal sig = (AbstractSignal) qt.GeneratorUtilities.fetchField(this, QAbstractSocket.class, "proxyAuthenticationRequiredPrivate");
+sig.connect(this, "emitProxyAuthenticationRequired(QNetworkProxy,QNativePointer)", qt.core.Qt.ConnectionType.DirectConnection);
+        </inject-code>
+
+        <extra-includes>
+            <include file-name="qt.QNativePointer" location="java"/>
+        </extra-includes>
+
+        <modify-function signature="readDatagram(char*,long long,QHostAddress*,unsigned short*)">
+            <access modifier="private"/>
+            <modify-argument index="3">
+                <remove-default-expression />
+            </modify-argument>
+            <modify-argument index="4">
+                <remove-default-expression />
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="bind(QHostAddress, unsigned short)" access="private" rename="bind_private"/>
+
+        <modify-function signature="bind(unsigned short)" access="private" rename="bind_private"/>
+
+        <modify-function signature="bind(QHostAddress,unsigned short,QFlags&lt;QUdpSocket::BindFlag&gt;)" access="private" rename="bind_private"/>
+
+        <modify-function signature="bind(unsigned short, QFlags&lt;QUdpSocket::BindFlag&gt;)" access="private" rename="bind_private"/>
+
+        <modify-function signature="writeDatagram(const char*,long long,QHostAddress,unsigned short)">
+            <access modifier="private"/>
+        </modify-function>
+
+        <modify-function signature="writeDatagram(QByteArray, QHostAddress, unsigned short)" access="private"/>
+    </object-type>
+
+
+    <value-type name="QNetworkProxy">
+        <inject-code>
+            <import-file name="typesystem_network-java.java" quote-after-line="class QNetworkProxy___" quote-before-line="}// class"/>
+        </inject-code>
+        <modify-function signature="QNetworkProxy(QNetworkProxy::ProxyType,QString,unsigned short,QString,QString)" access="private">
+            <modify-argument index="2">
+                <remove-default-expression />
+            </modify-argument>
+            <modify-argument index="3">
+                <remove-default-expression />
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="setPort(unsigned short)" access="private"/>
+        <modify-function signature="port()const" access="private" rename="port_private"/>
+    </value-type>
+
+    <object-type name="QNetworkAccessManager">
+        <inject-code>
+            <import-file name="typesystem_network-java.java" quote-after-line="class QNetworkAccessManager___" quote-before-line="}// class"/>
+        </inject-code>
+        <modify-function signature="proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)">
+            <access modifier="private"/>
+            <rename to="proxyAuthenticationRequiredPrivate"/>
+        </modify-function>
+
+        <modify-function signature="authenticationRequired(QNetworkReply *,QAuthenticator*)">
+            <access modifier="private"/>
+            <rename to="authenticationRequiredPrivate"/>
+        </modify-function>
+
+        <inject-code class="constructors">
+            proxyAuthenticationRequired.connect(this, "emitProxyAuthenticationRequiredPrivate(QNetworkProxy, QAuthenticator)", qt.core.Qt.ConnectionType.DirectConnection);
+            proxyAuthenticationRequiredPrivate.connect(this, "emitProxyAuthenticationRequired(QNetworkProxy,QNativePointer)", qt.core.Qt.ConnectionType.DirectConnection);
+            authenticationRequired.connect(this, "emitAuthenticationRequiredPrivate(QNetworkReply, QAuthenticator)", qt.core.Qt.ConnectionType.DirectConnection);
+            authenticationRequiredPrivate.connect(this, "emitAuthenticationRequired(QNetworkReply, QNativePointer)", qt.core.Qt.ConnectionType.DirectConnection);
+        </inject-code>
+    </object-type>
+
+    <object-type name="QLocalServer">
+        <inject-code>
+            <import-file name="typesystem_network-java.java" quote-after-line="class QLocalServer___" quote-before-line="}// class"/>
+        </inject-code>
+        <modify-function signature="waitForNewConnection(int,bool*)">
+            <access modifier="private"/>
+            <modify-argument index="1">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="2">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+    </object-type>
+
+    <value-type name="QSslCipher">
+      <modify-function signature="operator=(QSslCipher)" remove="all" />
+    </value-type>
+
+    <value-type name="QSslError">
+      <modify-function signature="operator=(QSslError)" remove="all" />
+    </value-type>
+
+    <value-type name="QSslKey">
+      <modify-function signature="operator=(QSslKey)" remove="all" />
+    </value-type>
+
+    <value-type name="QSslCertificate">
+      <modify-function signature="operator=(QSslCertificate)" remove="all" />
+    </value-type>
+
+    <value-type name="QSslConfiguration">
+      <modify-function signature="operator=(QSslConfiguration)" remove="all" />
+    </value-type>
+
+
+    <object-type name="QSslSocket">
+      <inject-code>
+        <import-file name="typesystem_network-java.java" quote-after-line="class QSslSocket___" quote-before-line="}// class"/>
+      </inject-code>
+      <modify-function signature="connectToHostImplementation(QString, unsigned short, QFlags&lt;QIODevice::OpenModeFlag&gt;)" access="private" />
+    </object-type>
+
+
+</typesystem>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/typesystem_network.xml	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,399 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<typesystem package="qt.network" default-superclass="qt.QtJambiObject">
+<inject-code>
+        qt.Utilities.loadQtLibrary("QtNetwork");
+    </inject-code>
+<template name="network.read_char*_long_long">
+        public final int read(byte data[]) {
+            if (data.length == 0) return 0;
+
+            qt.QNativePointer np = new qt.QNativePointer(qt.QNativePointer.Type.Byte, data.length);
+            int len = (int) read(np, data.length);
+            for (int i=0; i&lt;len; ++i) data[i] = np.byteAt(i);
+
+            return len;
+        }
+    </template>
+  <namespace-type name="QSsl">
+    <include file-name="qssl.h" location="global"/>
+  </namespace-type>
+
+  <enum-type name="QAbstractSocket::NetworkLayerProtocol"/>
+  <enum-type name="QAbstractSocket::SocketError"/>
+  <enum-type name="QAbstractSocket::SocketState"/>
+  <enum-type name="QAbstractSocket::SocketType"/>
+  <enum-type name="QFtp::Command"/>
+  <enum-type name="QFtp::Error"/>
+  <enum-type name="QFtp::State"/>
+  <enum-type name="QFtp::TransferMode"/>
+  <enum-type name="QFtp::TransferType"/>
+  <enum-type name="QHostAddress::SpecialAddress"/>
+  <enum-type name="QHttp::Error"/>
+  <enum-type name="QHttp::State"/>
+  <enum-type name="QHttp::ConnectionMode"/>
+  <enum-type name="QNetworkInterface::InterfaceFlag" flags="QNetworkInterface::InterfaceFlags"/>
+  <enum-type name="QNetworkProxy::ProxyType"/>
+  <enum-type name="QUdpSocket::BindFlag" flags="QUdpSocket::BindMode"/>
+  <enum-type name="QUrlInfo::PermissionSpec"/>
+  <enum-type name="QHostInfo::HostInfoError"/>
+  <enum-type name="QSsl::KeyType"/>
+  <enum-type name="QSsl::EncodingFormat"/>
+  <enum-type name="QSsl::KeyAlgorithm"/>
+  <enum-type name="QSsl::AlternateNameEntryType"/>
+  <enum-type name="QSsl::SslProtocol"/>
+  <enum-type name="QLocalSocket::LocalSocketError"/>
+  <enum-type name="QLocalSocket::LocalSocketState"/>
+  <enum-type name="QNetworkAccessManager::Operation"/>
+  <enum-type name="QNetworkCookie::RawForm"/>
+  <enum-type name="QNetworkReply::NetworkError"/>
+  <enum-type name="QNetworkRequest::Attribute" extensible="yes"/>
+  <enum-type name="QNetworkRequest::CacheLoadControl"/>
+  <enum-type name="QNetworkRequest::KnownHeaders"/>
+
+  <object-type name="QAbstractSocket">
+        <inject-code>
+            <import-file name="typesystem_network-java.java" quote-after-line="class QAbstractSocket___" quote-before-line="}// class"/>
+        </inject-code>
+        <inject-code class="constructors">
+proxyAuthenticationRequired.connect(this, "emitProxyAuthenticationRequiredPrivate(QNetworkProxy, QAuthenticator)", qt.core.Qt.ConnectionType.DirectConnection);
+proxyAuthenticationRequiredPrivate.connect(this, "emitProxyAuthenticationRequired(QNetworkProxy,QNativePointer)", qt.core.Qt.ConnectionType.DirectConnection);
+        </inject-code>
+        <modify-function signature="proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)">
+            <access modifier="private"/>
+            <rename to="proxyAuthenticationRequiredPrivate"/>
+        </modify-function>
+        <modify-function signature="connectToHostImplementation(QString, unsigned short, QFlags&lt;QIODevice::OpenModeFlag&gt;)" access="private"/>
+        <modify-function signature="localPort()const" access="private" rename="localPort_private"/>
+        <modify-function signature="peerPort()const" access="private" rename="peerPort_private"/>
+        <modify-function signature="setLocalPort(unsigned short)" access="private"/>
+        <modify-function signature="setPeerPort(unsigned short)" access="private"/>
+        <modify-function signature="connectToHost(QString, unsigned short, QFlags&lt;QIODevice::OpenModeFlag&gt;)" access="private"/>
+        <modify-function signature="connectToHost(QHostAddress, unsigned short, QFlags&lt;QIODevice::OpenModeFlag&gt;)" access="private"/>
+
+        <modify-function signature="abort()" access="non-final"/>
+        <modify-function signature="disconnectFromHostImplementation()" access="non-final"/>
+        <modify-function signature="flush()" access="non-final"/>
+        <modify-function signature="setReadBufferSize(long long)" access="non-final"/>
+    <modify-function signature="setSocketDescriptor(int,QAbstractSocket::SocketState,QFlags&lt;QIODevice::OpenModeFlag&gt;)" access="non-final"/>
+        <modify-function signature="waitForConnected(int)" access="non-final"/>
+        <modify-function signature="waitForDisconnected(int)" access="non-final"/>
+
+    </object-type>
+  <object-type name="QFtp">
+        <modify-function signature="read(char*,long long)">
+            <access modifier="private"/>
+        </modify-function>
+        <inject-code>
+            <insert-template name="network.read_char*_long_long"/>
+        </inject-code>
+    </object-type>
+
+  <object-type name="QHttp">
+      <modify-function signature="closeConnection()" remove="all"/>
+  
+        <inject-code>
+            <import-file name="typesystem_network-java.java" quote-after-line="class QHttp___" quote-before-line="}// class"/>
+        </inject-code>
+        <modify-function signature="proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)">
+            <access modifier="private"/>
+            <rename to="proxyAuthenticationRequiredPrivate"/>
+        </modify-function>
+
+        <modify-function signature="authenticationRequired(QString,unsigned short,QAuthenticator*)">
+            <access modifier="private"/>
+            <rename to="authenticationRequiredPrivate"/>
+        </modify-function>
+
+        <inject-code class="constructors">
+proxyAuthenticationRequired.connect(this, "emitProxyAuthenticationRequiredPrivate(QNetworkProxy, QAuthenticator)", qt.core.Qt.ConnectionType.DirectConnection);
+proxyAuthenticationRequiredPrivate.connect(this, "emitProxyAuthenticationRequired(QNetworkProxy,QNativePointer)", qt.core.Qt.ConnectionType.DirectConnection);
+authenticationRequired.connect(this, "emitAuthenticationRequiredPrivate(String, int, QAuthenticator)", qt.core.Qt.ConnectionType.DirectConnection);
+authenticationRequiredPrivate.connect(this, "emitAuthenticationRequired(String, char, QNativePointer)", qt.core.Qt.ConnectionType.DirectConnection);
+        </inject-code>
+
+        <modify-function signature="QHttp(const QString &amp;, unsigned short, QObject *)" access="private">
+            <modify-argument index="2">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="QHttp(const QString &amp;, QHttp::ConnectionMode, unsigned short, QObject *)" access="private">
+            <modify-argument index="3">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="read(char*,long long)">
+            <access modifier="private"/>
+        </modify-function>
+        <inject-code>
+            <insert-template name="network.read_char*_long_long"/>
+        </inject-code>
+        <modify-function signature="setSocket(QTcpSocket*)">
+            <modify-argument index="1">
+                <reference-count action="set" variable-name="__rcSocket"/>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="setHost(QString, unsigned short)" access="private">
+            <modify-argument index="2">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="setHost(QString, QHttp::ConnectionMode, unsigned short)" access="private">
+            <modify-argument index="3">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+
+    </object-type>
+  <object-type name="QTcpServer">
+        <inject-code>
+            <import-file name="typesystem_network-java.java" quote-after-line="class QTcpServer___" quote-before-line="}// class"/>
+        </inject-code>
+        <extra-includes>
+            <include file-name="qt.QNativePointer" location="java"/>
+        </extra-includes>
+        <modify-function signature="listen(QHostAddress,unsigned short)" access="private">
+            <modify-argument index="1">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="2">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+
+
+        <modify-function signature="serverPort()const" access="private" rename="serverPort_private"/>
+
+
+        <modify-function signature="waitForNewConnection(int,bool*)">
+            <access modifier="private"/>
+            <modify-argument index="1">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="2">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+
+    </object-type>
+  <object-type name="QTcpSocket">
+        <inject-code class="constructors">
+            proxyAuthenticationRequired.connect(this, "emitProxyAuthenticationRequiredPrivate(QNetworkProxy, QAuthenticator)", qt.core.Qt.ConnectionType.DirectConnection);
+            AbstractSignal sig = (AbstractSignal) qt.GeneratorUtilities.fetchField(this, QAbstractSocket.class, "proxyAuthenticationRequiredPrivate");
+            sig.connect(this, "emitProxyAuthenticationRequired(QNetworkProxy,QNativePointer)", qt.core.Qt.ConnectionType.DirectConnection);
+        </inject-code>
+    </object-type>
+  <object-type name="QUdpSocket">
+        <inject-code>
+            <import-file name="typesystem_network-java.java" quote-after-line="class QUdpSocket___" quote-before-line="}// class"/>
+        </inject-code>
+        <inject-code class="constructors">
+proxyAuthenticationRequired.connect(this, "emitProxyAuthenticationRequiredPrivate(QNetworkProxy, QAuthenticator)", qt.core.Qt.ConnectionType.DirectConnection);
+AbstractSignal sig = (AbstractSignal) qt.GeneratorUtilities.fetchField(this, QAbstractSocket.class, "proxyAuthenticationRequiredPrivate");
+sig.connect(this, "emitProxyAuthenticationRequired(QNetworkProxy,QNativePointer)", qt.core.Qt.ConnectionType.DirectConnection);
+        </inject-code>
+
+        <extra-includes>
+            <include file-name="qt.QNativePointer" location="java"/>
+        </extra-includes>
+
+        <modify-function signature="readDatagram(char*,long long,QHostAddress*,unsigned short*)">
+            <access modifier="private"/>
+            <modify-argument index="3">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="4">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="bind(QHostAddress, unsigned short)" access="private" rename="bind_private"/>
+
+        <modify-function signature="bind(unsigned short)" access="private" rename="bind_private"/>
+
+        <modify-function signature="bind(QHostAddress,unsigned short,QFlags&lt;QUdpSocket::BindFlag&gt;)" access="private" rename="bind_private"/>
+
+        <modify-function signature="bind(unsigned short, QFlags&lt;QUdpSocket::BindFlag&gt;)" access="private" rename="bind_private"/>
+
+        <modify-function signature="writeDatagram(const char*,long long,QHostAddress,unsigned short)">
+            <access modifier="private"/>
+        </modify-function>
+
+        <modify-function signature="writeDatagram(QByteArray, QHostAddress, unsigned short)" access="private"/>
+    </object-type>
+
+  <object-type name="QHttpHeader">
+    <modify-function signature="operator=(QHttpHeader)" remove="all"/>
+  </object-type>
+  <object-type name="QLocalServer">
+        <inject-code>
+            <import-file name="typesystem_network-java.java" quote-after-line="class QLocalServer___" quote-before-line="}// class"/>
+        </inject-code>
+        <modify-function signature="waitForNewConnection(int,bool*)">
+            <access modifier="private"/>
+            <modify-argument index="1">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="2">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+    </object-type>
+  <object-type name="QLocalSocket"/>
+  <object-type name="QNetworkAccessManager">
+    <modify-function signature="setCookieJar(QNetworkCookieJar*)">
+        <modify-argument index="1">
+            <define-ownership class="java" owner="c++"/>
+        </modify-argument>
+    </modify-function>
+  
+        <inject-code>
+            <import-file name="typesystem_network-java.java" quote-after-line="class QNetworkAccessManager___" quote-before-line="}// class"/>
+        </inject-code>
+        <modify-function signature="proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)">
+            <access modifier="private"/>
+            <rename to="proxyAuthenticationRequiredPrivate"/>
+        </modify-function>
+
+        <modify-function signature="authenticationRequired(QNetworkReply *,QAuthenticator*)">
+            <access modifier="private"/>
+            <rename to="authenticationRequiredPrivate"/>
+        </modify-function>
+
+        <inject-code class="constructors">
+            proxyAuthenticationRequired.connect(this, "emitProxyAuthenticationRequiredPrivate(QNetworkProxy, QAuthenticator)", qt.core.Qt.ConnectionType.DirectConnection);
+            proxyAuthenticationRequiredPrivate.connect(this, "emitProxyAuthenticationRequired(QNetworkProxy,QNativePointer)", qt.core.Qt.ConnectionType.DirectConnection);
+            authenticationRequired.connect(this, "emitAuthenticationRequiredPrivate(QNetworkReply, QAuthenticator)", qt.core.Qt.ConnectionType.DirectConnection);
+            authenticationRequiredPrivate.connect(this, "emitAuthenticationRequired(QNetworkReply, QNativePointer)", qt.core.Qt.ConnectionType.DirectConnection);
+        </inject-code>
+    </object-type>
+  <object-type name="QNetworkCookieJar"/>
+  <object-type name="QNetworkReply"/>
+
+  <value-type name="QHostAddress">
+    <modify-function signature="QHostAddress(unsigned char*)" remove="all"/>
+    <modify-function signature="setAddress(unsigned char*)" remove="all"/>
+    <modify-function signature="operator=(QString)" remove="all"/>
+    <modify-function signature="operator=(QHostAddress)" remove="all"/>
+  </value-type>
+
+  <value-type name="QHostInfo">
+        <modify-function signature="operator=(QHostInfo)" remove="all"/>
+        <modify-function signature="lookupHost(QString,QObject*,const char*)" access="private"/>
+  
+        <inject-code class="java">
+            <import-file name="typesystem_network-java.java" quote-after-line="class QHostInfo___" quote-before-line="}// class"/>
+        </inject-code>
+    </value-type>
+
+  <value-type name="QHttpRequestHeader">
+    <modify-function signature="operator=(QHttpRequestHeader)" remove="all"/>
+  </value-type>
+
+  <value-type name="QHttpResponseHeader">
+    <modify-function signature="operator=(QHttpResponseHeader)" remove="all"/>
+  </value-type>
+
+  <value-type name="QNetworkAddressEntry">
+    <modify-function signature="operator=(QNetworkAddressEntry)" remove="all"/>
+  </value-type>
+
+  <value-type name="QNetworkInterface">
+    <modify-function signature="operator=(QNetworkInterface)" remove="all"/>
+  </value-type>
+
+  <value-type name="QNetworkProxy">
+    <modify-function signature="operator=(QNetworkProxy)" remove="all"/>
+  
+        <inject-code>
+            <import-file name="typesystem_network-java.java" quote-after-line="class QNetworkProxy___" quote-before-line="}// class"/>
+        </inject-code>
+        <modify-function signature="QNetworkProxy(QNetworkProxy::ProxyType,QString,unsigned short,QString,QString)" access="private">
+            <modify-argument index="2">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="3">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="setPort(unsigned short)" access="private"/>
+        <modify-function signature="port()const" access="private" rename="port_private"/>
+    </value-type>
+
+  <value-type name="QUrlInfo">
+    <modify-function signature="operator=(QUrlInfo)" remove="all"/>
+  </value-type>
+
+  <value-type name="QIPv6Address">
+    <modify-function signature="operator[](int)const">
+        <remove/>
+    </modify-function>
+    <modify-function signature="operator[](int)">
+        <remove/>
+    </modify-function>
+  </value-type>
+
+  <value-type name="QAuthenticator">
+    <modify-function signature="operator=(QAuthenticator)" remove="all"/>
+  </value-type>
+  <value-type name="QNetworkCookie">
+    <modify-function signature="operator=(QNetworkCookie)" remove="all"/>
+  </value-type>
+  <value-type name="QNetworkRequest">
+    <modify-function signature="operator=(QNetworkRequest)" remove="all"/>
+  </value-type>
+
+  <enum-type name="QSslError::SslError"/>
+  <enum-type name="QSslCertificate::SubjectInfo"/>
+  <enum-type name="QSslSocket::SslMode"/>
+  <enum-type name="QSslSocket::PeerVerifyMode"/>
+
+  <value-type name="QSslCipher">
+      <modify-function signature="operator=(QSslCipher)" remove="all"/>
+    </value-type>
+  <value-type name="QSslError">
+      <modify-function signature="operator=(QSslError)" remove="all"/>
+    </value-type>
+  <value-type name="QSslKey">
+      <modify-function signature="operator=(QSslKey)" remove="all"/>
+    </value-type>
+  <value-type name="QSslCertificate">
+      <modify-function signature="operator=(QSslCertificate)" remove="all"/>
+    </value-type>
+  <value-type name="QSslConfiguration">
+      <modify-function signature="operator=(QSslConfiguration)" remove="all"/>
+    </value-type>
+
+  <object-type name="QSslSocket">
+      <inject-code>
+        <import-file name="typesystem_network-java.java" quote-after-line="class QSslSocket___" quote-before-line="}// class"/>
+      </inject-code>
+      <modify-function signature="connectToHostImplementation(QString, unsigned short, QFlags&lt;QIODevice::OpenModeFlag&gt;)" access="private"/>
+    </object-type>
+
+  <suppress-warning text="*unmatched parameter type 'sockaddr const*"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QUrlInfo' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QAuthenticator' has equals operators but no qHash() function"/>
+
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QSslKey' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QSslError' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QSslCertificate' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QSslCipher' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QSslConfiguration' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QNetworkProxy' has equals operators but no qHash() function"/>
+
+  <!-- For people building without SSL support -->
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.network.QSslSocket' for enum 'SslMode' is not declared"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QSslError' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QSslCipher' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QSslKey' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.network.QSslError' for enum 'SslError' is not declared"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QSslCertificate' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.network.QSslSocket' for enum 'PeerVerifyMode' is not declared"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.network.QSslCertificate' for enum 'SubjectInfo' is not declared"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QSslConfiguration' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QSslSocket' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <!-- -->
+
+</typesystem>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/typesystem_opengl-common.xml	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,69 @@
+<?xml-stylesheet type="text/xsl" href="merge.xsl"?>
+<typesystem>
+  <rejection class="QGLColormap::QGLColormapData" />
+  <rejection class="QGLWidget" function-name="setMouseTracking"/>
+
+  <enum-type name="QGL::FormatOption" flags="QGL::FormatOptions"/>
+  <enum-type name="QGLFormat::OpenGLVersionFlag" flags="QGLFormat::OpenGLVersionFlags"/>
+  <enum-type name="QGLFramebufferObject::Attachment" />
+
+  <namespace-type name="QGL">
+     <include file-name="qgl.h" location="global"/>
+  </namespace-type>
+
+  <value-type name="QGLColormap">
+    <modify-function signature="operator=(QGLColormap)" remove="all"/>
+
+    <modify-function signature="setEntries(int,const unsigned int*,int)">
+        <access modifier="private" />
+    </modify-function>
+  </value-type>
+
+  <value-type name="QGLFormat">
+    <modify-function signature="operator=(QGLFormat)" remove="all"/>
+  </value-type>
+
+  <object-type name="QGLContext">
+
+    <modify-function signature="chooseContext(const QGLContext*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+    <modify-function signature="create(const QGLContext*)">
+        <modify-argument index="1" invalidate-after-use="yes" />
+    </modify-function>
+
+    <modify-function signature="getProcAddress(QString)const">
+        <remove />
+    </modify-function>
+    <modify-field name="currentCtx" read="false" write="false" />
+    <modify-function signature="setDevice(QPaintDevice*)">
+        <remove />
+    </modify-function>
+    <modify-function signature="generateFontDisplayLists(QFont, int)" remove="all"/>
+  </object-type>
+  <object-type name="QGLFramebufferObject"/>
+  <object-type name="QGLPixelBuffer">
+    <extra-includes>
+        <include file-name="QImage" location="global"/>
+    </extra-includes>
+  </object-type>
+  <object-type name="QGLWidget">
+    <extra-includes>
+        <include file-name="QImage" location="global"/>
+        <include file-name="QPixmap" location="global"/>
+    </extra-includes>
+    <modify-function signature="setContext(QGLContext*,const QGLContext*,bool)">
+        <remove /> <!--- Obsolete -->
+    </modify-function>
+    <modify-function signature="fontDisplayListBase(QFont, int)" remove="all"/>
+    <modify-function signature="setFormat(QGLFormat)" remove="all"/>
+  </object-type>
+
+
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QGLColormap::QGLColormapData\*'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: visibility of function '*' modified in class '*'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: hiding of function '*' in class '*'" />
+  <suppress-warning text="WARNING(CppImplGenerator) :: protected function '*' in final class '*'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QGLFormat' has equals operators but no qHash() function" />
+
+</typesystem>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/typesystem_opengl-java.java	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+package generator;
+
+import qt.*;
+import qt.opengl.*;
+
+class QGLColormap___ extends QGLColormap {
+/*
+    public final void setEntries(int colors[], int base) {
+        setEntries(colors.length, qt.internal.QtJambiInternal.intArrayToNativePointer(colors), base);
+    }
+
+    public final void setEntries(int colors[]) {
+        setEntries(colors.length, qt.internal.QtJambiInternal.intArrayToNativePointer(colors));
+    }
+*/
+}// class
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/typesystem_opengl-java.xml	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,19 @@
+<?xml version="1.0"?>
+<typesystem package="qt.opengl" default-superclass="QtDObject">
+  <inject-code>
+    qt.Utilities.loadQtLibrary("QtGui");
+    qt.Utilities.loadQtLibrary("QtOpenGL");
+  </inject-code>
+
+  <primitive-type name="GLuint" java-name="int" preferred-conversion="no" jni-name="jint"/>
+  <primitive-type name="GLint" java-name="int" preferred-conversion="no" jni-name="jint"/>
+  <primitive-type name="GLenum" java-name="int" preferred-conversion="no" jni-name="jint"/>
+
+
+    <value-type name="QGLColormap">
+        <inject-code>
+            <import-file name="typesystem_opengl-java.java" quote-after-line="class QGLColormap___" quote-before-line="}// class"/>
+        </inject-code>
+
+  </value-type>
+</typesystem>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/typesystem_opengl.xml	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?xml-stylesheet type="text/xsl" href="merge.xsl"?>
+
+<typesystem package="qt.opengl" default-superclass="QtDObject">
+<inject-code>
+    qt.Utilities.loadQtLibrary("QtGui");
+    qt.Utilities.loadQtLibrary("QtOpenGL");
+  </inject-code>
+<primitive-type name="GLuint" java-name="int" preferred-conversion="no" jni-name="jint"/>
+<primitive-type name="GLint" java-name="int" preferred-conversion="no" jni-name="jint"/>
+<primitive-type name="GLenum" java-name="int" preferred-conversion="no" jni-name="jint"/>
+  <rejection class="QGLColormap::QGLColormapData"/>
+  <rejection class="QGLWidget" function-name="setMouseTracking"/>
+
+  <enum-type name="QGL::FormatOption" flags="QGL::FormatOptions"/>
+  <enum-type name="QGLFormat::OpenGLVersionFlag" flags="QGLFormat::OpenGLVersionFlags"/>
+  <enum-type name="QGLFramebufferObject::Attachment"/>
+
+  <namespace-type name="QGL">
+     <include file-name="qgl.h" location="global"/>
+  </namespace-type>
+
+  <value-type name="QGLColormap">
+    <modify-function signature="operator=(QGLColormap)" remove="all"/>
+
+    <modify-function signature="setEntries(int,const unsigned int*,int)">
+        <access modifier="private"/>
+    </modify-function>
+  
+        <inject-code>
+            <import-file name="typesystem_opengl-java.java" quote-after-line="class QGLColormap___" quote-before-line="}// class"/>
+        </inject-code>
+
+  </value-type>
+
+  <value-type name="QGLFormat">
+    <modify-function signature="operator=(QGLFormat)" remove="all"/>
+  </value-type>
+
+  <object-type name="QGLContext">
+
+    <modify-function signature="chooseContext(const QGLContext*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+    <modify-function signature="create(const QGLContext*)">
+        <modify-argument index="1" invalidate-after-use="yes"/>
+    </modify-function>
+
+    <modify-function signature="getProcAddress(QString)const">
+        <remove/>
+    </modify-function>
+    <modify-field name="currentCtx" read="false" write="false"/>
+    <modify-function signature="setDevice(QPaintDevice*)">
+        <remove/>
+    </modify-function>
+    <modify-function signature="generateFontDisplayLists(QFont, int)" remove="all"/>
+  </object-type>
+  <object-type name="QGLFramebufferObject"/>
+  <object-type name="QGLPixelBuffer">
+    <extra-includes>
+        <include file-name="QImage" location="global"/>
+    </extra-includes>
+  </object-type>
+  <object-type name="QGLWidget">
+    <extra-includes>
+        <include file-name="QImage" location="global"/>
+        <include file-name="QPixmap" location="global"/>
+    </extra-includes>
+    <modify-function signature="setContext(QGLContext*,const QGLContext*,bool)">
+        <remove/> <!--- Obsolete -->
+    </modify-function>
+    <modify-function signature="fontDisplayListBase(QFont, int)" remove="all"/>
+    <modify-function signature="setFormat(QGLFormat)" remove="all"/>
+  </object-type>
+
+
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QGLColormap::QGLColormapData\*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: visibility of function '*' modified in class '*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: hiding of function '*' in class '*'"/>
+  <suppress-warning text="WARNING(CppImplGenerator) :: protected function '*' in final class '*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QGLFormat' has equals operators but no qHash() function"/>
+
+</typesystem>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/typesystem_phonon-common.xml	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,194 @@
+<?xml version="1.0"?>
+<typesystem>
+
+    <rejection class="Phonon::ObjectDescriptionData" />
+    <rejection class="Phonon::ObjectDescriptionModelData" />
+    <rejection class="Phonon::MediaNodeDestructionHandler" />
+    <rejection class="Phonon::GlobalConfig" />
+    <rejection class="Phonon::IODeviceStream" />
+    <rejection class="Phonon::Factory" />
+    <rejection class="Phonon::Experimental" />
+    <rejection class="Phonon::ObjectDescriptionModel" />
+    <rejection class="Phonon::BackendCapabilities::Notifier" />
+    <rejection class="AudioOutputAdaptor" />
+    <rejection class="*" field-name="k_ptr" />
+
+    <namespace-type name="Phonon" />
+    <namespace-type name="Phonon::BackendCapabilities" java-name="BackendCapabilities" />
+
+    <enum-type name="Phonon::Category">
+        <reject-enum-value name="LastCategory" />
+    </enum-type>
+    <enum-type name="Phonon::DiscType" />
+    <enum-type name="Phonon::ErrorType" />
+    <enum-type name="Phonon::MetaData" />
+    <enum-type name="Phonon::ObjectDescriptionType" />
+    <enum-type name="Phonon::State" />
+
+    <enum-type name="Phonon::AddonInterface::AngleCommand" />
+    <enum-type name="Phonon::AddonInterface::ChapterCommand" />
+    <enum-type name="Phonon::AddonInterface::Interface" />
+    <enum-type name="Phonon::AddonInterface::NavigationCommand" />
+    <enum-type name="Phonon::AddonInterface::TitleCommand" />
+    <enum-type name="Phonon::BackendInterface::Class" />
+    <enum-type name="Phonon::EffectParameter::Hint" flags="Phonon::EffectParameter::Hints" />
+    <enum-type name="Phonon::MediaController::Feature" flags="Phonon::MediaController::Features" />
+    <enum-type name="Phonon::MediaSource::Type" />
+    <enum-type name="Phonon::VideoWidget::AspectRatio" />
+    <enum-type name="Phonon::VideoWidget::ScaleMode" />
+    <enum-type name="Phonon::VolumeFaderEffect::FadeCurve" />
+
+    <interface-type name="Phonon::AbstractVideoOutput" java-name="AbstractVideoOutput" />
+    <interface-type name="Phonon::AddonInterface" java-name="AbstractAddon" />
+    <interface-type name="Phonon::AudioOutputInterface" java-name="AudioOutputInterface" />
+    <interface-type name="Phonon::BackendInterface" java-name="AbstractBackend" />
+    <interface-type name="Phonon::EffectInterface" java-name="AbstractEffect" />
+    <interface-type name="Phonon::MediaNode" java-name="MediaNode" />
+
+    <interface-type name="Phonon::MediaObjectInterface" java-name="AbstractMediaObject" />
+    <interface-type name="Phonon::PlatformPlugin" java-name="PlatformPlugin" />
+    <interface-type name="Phonon::StreamInterface" java-name="AbstractStream" />
+    <interface-type name="Phonon::VideoWidgetInterface" java-name="AbstractVideoWidget" />
+    <interface-type name="Phonon::VolumeFaderInterface" java-name="AbstractVolumeFader" />
+
+    <value-type name="Phonon::EffectParameter" java-name="EffectParameter">
+        <modify-function signature="EffectParameter()" remove="all" /> <!-- internal -->
+        <modify-function signature="operator&lt;(const Phonon::EffectParameter &amp;)const" remove="all" /> <!-- internal -->
+        <modify-function signature="operator&gt;(const Phonon::EffectParameter &amp;)const" remove="all" /> <!-- internal -->
+        <modify-function signature="id()const" remove="all" /> <!-- internal -->
+        <modify-function signature="operator=(Phonon::EffectParameter)" remove="all" /> <!-- Covered by copy constructor -->
+    </value-type>
+    <value-type name="Phonon::MediaSource" java-name="MediaSource">
+        <modify-function signature="operator=(Phonon::MediaSource)" remove="all" /> <!-- Covered by copy constructor -->
+    </value-type>
+    <value-type name="Phonon::Path" java-name="Path">
+        <modify-function signature="disconnect()" rename="disconnectPath" />
+        <modify-function signature="operator=(Phonon::Path)" remove="all" /> <!-- Covered by copy constructor -->
+        <modify-function signature="insertEffect(Phonon::EffectDescription,Phonon::Effect*)">
+            <modify-argument index="1">
+                <reference-count action="add" variable-name="__rcEffects" />
+            </modify-argument>
+            <modify-argument index="2">
+                <reference-count action="ignore" />
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="insertEffect(Phonon::Effect*,Phonon::Effect*)">
+            <modify-argument index="1">
+                <reference-count action="add" variable-name="__rcEffects" />
+            </modify-argument>
+            <modify-argument index="2">
+                <reference-count action="ignore" />
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="removeEffect(Phonon::Effect*)">
+            <modify-argument index="1">
+                <reference-count action="remove" variable-name="__rcEffects" />
+            </modify-argument>
+        </modify-function>
+    </value-type>
+    <value-type name="Phonon::ObjectDescription" generate="no" />
+    <value-type name="Phonon::EffectDescription" java-name="EffectDescription" />
+    <value-type name="Phonon::AudioOutputDevice" java-name="AudioOutputDevice" />
+
+    <object-type name="Phonon::AbstractAudioOutput" java-name="AbstractAudioOutput" />
+    <object-type name="Phonon::AbstractMediaStream" java-name="AbstractMediaStream" />
+    <object-type name="Phonon::AudioOutput" java-name="AudioOutput" />
+    <object-type name="Phonon::Effect" java-name="Effect" />
+    <object-type name="Phonon::EffectWidget" java-name="EffectWidget" />
+    <object-type name="Phonon::MediaController" java-name="MediaController" />
+    <object-type name="Phonon::MediaObject" java-name="MediaObject">
+        <modify-function signature="enqueue(const QList&lt;QUrl&gt; &amp;)" rename="enqueueUrls" />
+        <modify-function signature="setQueue(const QList&lt;QUrl&gt; &amp;)" rename="setQueueToUrls" />
+    </object-type>
+    <object-type name="Phonon::SeekSlider" java-name="SeekSlider">
+        <modify-function signature="setMediaObject(Phonon::MediaObject*)">
+            <modify-argument index="1">
+                <reference-count action="set" variable-name="__rcMediaObject" />
+            </modify-argument>
+        </modify-function>
+    </object-type>
+    <object-type name="Phonon::VideoPlayer" java-name="VideoPlayer" />
+    <object-type name="Phonon::VideoWidget" java-name="VideoWidget" />
+    <object-type name="Phonon::VolumeFaderEffect" java-name="VolumeFaderEffect" />
+    <object-type name="Phonon::VolumeSlider" java-name="VolumeSlider">
+        <modify-function signature="setAudioOutput(Phonon::AudioOutput*)">
+            <modify-argument index="1">
+                <reference-count action="set" variable-name="__rcAudioOutput" />
+            </modify-argument>
+        </modify-function>
+    </object-type>
+
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: Final class 'AbstractAudioOutput' set to non-final, as it is extended by other classes" />
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'QDBus' does not have a type entry" />
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: private virtual function 'create(const QString &amp; name)' in 'QTextCodecPlugin'" />
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: private virtual function 'keys() const' in 'QTextCodecPlugin'" />
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'MediaSource' has equals operators but no qHash() function" />
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'Path' has equals operators but no qHash() function" />
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'EffectParameter' has equals operators but no qHash() function" />
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'Phonon_ObjectDescription' has equals operators but no qHash() function" />
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'EffectDescription' has equals operators but no qHash() function" />
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'AudioOutputDevice' has equals operators but no qHash() function" />
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'Phonon::operator&lt;&lt;', unmatched return type 'QDebug'" />
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'Phonon::ObjectDescription::ObjectDescription', unmatched parameter type 'QExplicitlySharedDataPointer&lt;ObjectDescriptionData&gt; const&amp;'" />
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'Phonon::BackendCapabilities::notifier', unmatched return type 'Phonon::BackendCapabilities::Notifier*'" />
+
+
+
+
+
+
+
+
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'Phonon::AudioOutputInterface' is specified in typesystem, but not defined. This could potentially lead to compilation errors." />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.phonon.VolumeFaderEffect' for enum 'FadeCurve' is not declared" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'Phonon::MediaSource' is specified in typesystem, but not defined. This could potentially lead to compilation errors." />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'Phonon::MediaController' is specified in typesystem, but not defined. This could potentially lead to compilation errors." />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QAbstractXmlForwardIterator' is specified in typesystem, but not defined. This could potentially lead to compilation errors." />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: enum 'QFormLayout::FormStyle' is specified in typesystem, but not declared" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'Phonon::AbstractAudioOutput' is specified in typesystem, but not defined. This could potentially lead to compilation errors." />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.phonon.Phonon' for enum 'DiscType' is not declared" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'Phonon::AudioOutput' is specified in typesystem, but not defined. This could potentially lead to compilation errors." />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.phonon.VideoWidget' for enum 'AspectRatio' is not declared" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'Phonon::Effect' is specified in typesystem, but not defined. This could potentially lead to compilation errors." />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.phonon.MediaSource' for enum 'Type' is not declared" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'Phonon::VolumeSlider' is specified in typesystem, but not defined. This could potentially lead to compilation errors." />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'Phonon::BackendInterface' is specified in typesystem, but not defined. This could potentially lead to compilation errors." />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'Phonon::EffectParameter' is specified in typesystem, but not defined. This could potentially lead to compilation errors." />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'Phonon::VideoWidget' is specified in typesystem, but not defined. This could potentially lead to compilation errors." />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'Phonon::StreamInterface' is specified in typesystem, but not defined. This could potentially lead to compilation errors." />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.phonon.Phonon' for enum 'ErrorType' is not declared" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.phonon.VideoWidget' for enum 'ScaleMode' is not declared" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.phonon.AbstractAddon' for enum 'Interface' is not declared" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'Phonon::MediaObjectInterface' is specified in typesystem, but not defined. This could potentially lead to compilation errors." />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.phonon.Phonon' for enum 'MetaData' is not declared" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'Phonon::Path' is specified in typesystem, but not defined. This could potentially lead to compilation errors." />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.phonon.EffectParameter' for enum 'Hint' is not declared" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.phonon.MediaController' for enum 'Feature' is not declared" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'Phonon::VideoPlayer' is specified in typesystem, but not defined. This could potentially lead to compilation errors." />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'Phonon::MediaObject' is specified in typesystem, but not defined. This could potentially lead to compilation errors." />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.phonon.AbstractBackend' for enum 'Class' is not declared" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.phonon.AbstractAddon' for enum 'AngleCommand' is not declared" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.phonon.AbstractAddon' for enum 'TitleCommand' is not declared" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'Phonon::VolumeFaderEffect' is specified in typesystem, but not defined. This could potentially lead to compilation errors." />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'Phonon::AudioOutputDevice' is specified in typesystem, but not defined. This could potentially lead to compilation errors." />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'Phonon::ObjectDescription' is specified in typesystem, but not defined. This could potentially lead to compilation errors." />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'Phonon::EffectDescription' is specified in typesystem, but not defined. This could potentially lead to compilation errors." />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'Phonon::VideoWidgetInterface' is specified in typesystem, but not defined. This could potentially lead to compilation errors." />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'Phonon::EffectInterface' is specified in typesystem, but not defined. This could potentially lead to compilation errors." />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.phonon.Phonon' for enum 'State' is not declared" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'Phonon::SeekSlider' is specified in typesystem, but not defined. This could potentially lead to compilation errors." />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.phonon.AbstractAddon' for enum 'NavigationCommand' is not declared" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'Phonon::MediaNode' is specified in typesystem, but not defined. This could potentially lead to compilation errors." />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.phonon.Phonon' for enum 'Category' is not declared" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'JObjectWrapper' is specified in typesystem, but not defined. This could potentially lead to compilation errors." />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'Phonon::AbstractMediaStream' is specified in typesystem, but not defined. This could potentially lead to compilation errors." />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'Phonon::PlatformPlugin' is specified in typesystem, but not defined. This could potentially lead to compilation errors." />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'Phonon::AddonInterface' is specified in typesystem, but not defined. This could potentially lead to compilation errors." />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.phonon.Phonon' for enum 'ObjectDescriptionType' is not declared" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.phonon.AbstractAddon' for enum 'ChapterCommand' is not declared" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'Phonon::AbstractVideoOutput' is specified in typesystem, but not defined. This could potentially lead to compilation errors." />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'Phonon::EffectWidget' is specified in typesystem, but not defined. This could potentially lead to compilation errors." />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'Phonon::VolumeFaderInterface' is specified in typesystem, but not defined. This could potentially lead to compilation errors." />
+
+
+</typesystem>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/typesystem_phonon-java.java	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+class ObjectDescriptionSubclass___ {
+
+    /**
+     * Returns a named property.
+     *
+     * If the property is not set an invalid value is returned.
+     *
+     * @param name The name of the property to return
+     * @return The property corresponding to the name
+     */
+    public final java.lang.Object property(String name) {
+        return property(QNativePointer.createCharPointer(name));
+    }
+
+}// class
+
+class Phonon___ {
+
+    public String phononVersion() {
+        qt.QNativePointer np = phononVersion_private();
+        if (np != null)
+            return qt.internal.QtJambiInternal.charPointerToString(np);
+        else
+            return null;
+    }
+
+}// class
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/typesystem_phonon-java.xml	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,101 @@
+<?xml version="1.0"?>
+<typesystem package="qt.phonon" default-superclass="qt.QtJambiObject">
+    <inject-code>
+        qt.Utilities.loadQtLibrary("QtXml");
+        qt.Utilities.loadQtLibrary("QtGui");
+        qt.Utilities.loadQtLibrary("QtOpenGL");
+        qt.Utilities.loadQtLibrary("phonon");
+    </inject-code>
+
+    <value-type name="Phonon::EffectDescription">
+        <modify-function signature="fromIndex(int)" remove="all" /> <!-- temporarily removed so we can compile this (not needed in current API) -->
+        <modify-function signature="operator!=(Phonon::ObjectDescription)const" remove="all" />
+        <modify-function signature="operator==(Phonon::ObjectDescription)const" access="private">
+            <modify-argument index="1">
+                <replace-type modified-type="qt.phonon.EffectDescription" />
+                <conversion-rule class="native">
+                    Phonon::EffectDescription %out = (Phonon::EffectDescription ) *(Phonon::EffectDescription *)%in;
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="property(const char*)const" access="private" />
+        <inject-code>
+            <import-file name="typesystem_phonon-java.java" quote-after-line="class ObjectDescriptionSubclass___" quote-before-line="}// class"/>
+        </inject-code>
+    </value-type>
+
+    <value-type name="Phonon::AudioOutputDevice">
+        <modify-function signature="fromIndex(int)" remove="all" /> <!-- temporarily removed so we can compile this (not needed in current API) -->
+        <modify-function signature="operator==(Phonon::ObjectDescription)const" access="private">
+            <modify-argument index="1">
+                <replace-type modified-type="qt.phonon.AudioOutputDevice" />
+                <conversion-rule class="native">
+                    Phonon::AudioOutputDevice %out = (Phonon::AudioOutputDevice) *(Phonon::AudioOutputDevice *)%in;
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="operator!=(Phonon::ObjectDescription)const" remove="all" />
+        <modify-function signature="property(const char*)const" access="private" />
+        <inject-code>
+            <import-file name="typesystem_phonon-java.java" quote-after-line="class ObjectDescriptionSubclass___" quote-before-line="}// class"/>
+        </inject-code>
+    </value-type>
+
+    <namespace-type name="Phonon">
+        <modify-function signature="createPlayer(Phonon::Category, Phonon::MediaSource)">
+            <modify-argument index="2">
+                <replace-default-expression with="null" />
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="phononVersion()" access="private" rename="phononVersion_private" associated-to="phononVersion()" />
+        <inject-code>
+            <import-file name="typesystem_phonon-java.java" quote-after-line="class Phonon___" quote-before-line="}// class"/>
+        </inject-code>
+    </namespace-type>
+
+    <interface-type name="Phonon::PlatformPlugin">
+        <modify-function signature="notification(const char *, const QString &amp;, const QStringList&lt;QString&gt; &amp;, QObject *, const char *)const">
+            <modify-argument index="3">
+                <replace-default-expression with="null" />
+            </modify-argument>
+            <modify-argument index="1">
+                <replace-type modified-type="java.lang.String" />
+                <conversion-rule class="shell">
+                    jobject %out = qtjambi_from_qstring(__jni_env, QString::fromUtf8(QByteArray(%in)));
+                </conversion-rule>
+                <conversion-rule class="native">
+                    QByteArray b1 = qtjambi_to_qstring(__jni_env, (jstring) %in).toUtf8();
+                    const char* %out = b1.data();
+                </conversion-rule>
+            </modify-argument>
+            <modify-argument index="5">
+                <replace-type modified-type="java.lang.String" />
+                <conversion-rule class="shell">
+                    jobject %out = qtjambi_from_qstring(__jni_env, QString::fromUtf8(QByteArray(%in)));
+                </conversion-rule>
+                <conversion-rule class="native">
+                    QByteArray b2 = qtjambi_to_qstring(__jni_env, (jstring) %in).toUtf8();
+                    const char* %out = b1.data();
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+    </interface-type>
+
+    <interface-type name="Phonon::AddonInterface">
+        <modify-function signature="interfaceCall(Phonon::AddonInterface::Interface, int, const QList&lt;QVariant&gt; &amp;)">
+            <modify-argument index="3">
+                <replace-default-expression with="null" />
+            </modify-argument>
+        </modify-function>
+    </interface-type>
+
+    <interface-type name="Phonon::BackendInterface">
+        <modify-function signature="createObject(Phonon::BackendInterface::Class, QObject *, const QList&lt;QVariant&gt; &amp;)">
+            <modify-argument index="3">
+                <replace-default-expression with="null" />
+            </modify-argument>
+        </modify-function>
+    </interface-type>
+
+
+</typesystem>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/typesystem_phonon.xml	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,278 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<typesystem package="qt.phonon" default-superclass="qt.QtJambiObject">
+<inject-code>
+        qt.Utilities.loadQtLibrary("QtXml");
+        qt.Utilities.loadQtLibrary("QtGui");
+        qt.Utilities.loadQtLibrary("QtOpenGL");
+        qt.Utilities.loadQtLibrary("phonon");
+    </inject-code>
+
+    <rejection class="Phonon::ObjectDescriptionData"/>
+    <rejection class="Phonon::ObjectDescriptionModelData"/>
+    <rejection class="Phonon::MediaNodeDestructionHandler"/>
+    <rejection class="Phonon::GlobalConfig"/>
+    <rejection class="Phonon::IODeviceStream"/>
+    <rejection class="Phonon::Factory"/>
+    <rejection class="Phonon::Experimental"/>
+    <rejection class="Phonon::ObjectDescriptionModel"/>
+    <rejection class="Phonon::BackendCapabilities::Notifier"/>
+    <rejection class="AudioOutputAdaptor"/>
+    <rejection class="*" field-name="k_ptr"/>
+
+    <namespace-type name="Phonon">
+        <modify-function signature="createPlayer(Phonon::Category, Phonon::MediaSource)">
+            <modify-argument index="2">
+                <replace-default-expression with="null"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="phononVersion()" access="private" rename="phononVersion_private" associated-to="phononVersion()"/>
+        <inject-code>
+            <import-file name="typesystem_phonon-java.java" quote-after-line="class Phonon___" quote-before-line="}// class"/>
+        </inject-code>
+    </namespace-type>
+    <namespace-type name="Phonon::BackendCapabilities" java-name="BackendCapabilities"/>
+
+    <enum-type name="Phonon::Category">
+        <reject-enum-value name="LastCategory"/>
+    </enum-type>
+    <enum-type name="Phonon::DiscType"/>
+    <enum-type name="Phonon::ErrorType"/>
+    <enum-type name="Phonon::MetaData"/>
+    <enum-type name="Phonon::ObjectDescriptionType"/>
+    <enum-type name="Phonon::State"/>
+
+    <enum-type name="Phonon::AddonInterface::AngleCommand"/>
+    <enum-type name="Phonon::AddonInterface::ChapterCommand"/>
+    <enum-type name="Phonon::AddonInterface::Interface"/>
+    <enum-type name="Phonon::AddonInterface::NavigationCommand"/>
+    <enum-type name="Phonon::AddonInterface::TitleCommand"/>
+    <enum-type name="Phonon::BackendInterface::Class"/>
+    <enum-type name="Phonon::EffectParameter::Hint" flags="Phonon::EffectParameter::Hints"/>
+    <enum-type name="Phonon::MediaController::Feature" flags="Phonon::MediaController::Features"/>
+    <enum-type name="Phonon::MediaSource::Type"/>
+    <enum-type name="Phonon::VideoWidget::AspectRatio"/>
+    <enum-type name="Phonon::VideoWidget::ScaleMode"/>
+    <enum-type name="Phonon::VolumeFaderEffect::FadeCurve"/>
+
+    <interface-type name="Phonon::AbstractVideoOutput" java-name="AbstractVideoOutput"/>
+    <interface-type name="Phonon::AddonInterface" java-name="AbstractAddon">
+        <modify-function signature="interfaceCall(Phonon::AddonInterface::Interface, int, const QList&lt;QVariant&gt; &amp;)">
+            <modify-argument index="3">
+                <replace-default-expression with="null"/>
+            </modify-argument>
+        </modify-function>
+    </interface-type>
+    <interface-type name="Phonon::AudioOutputInterface" java-name="AudioOutputInterface"/>
+    <interface-type name="Phonon::BackendInterface" java-name="AbstractBackend">
+        <modify-function signature="createObject(Phonon::BackendInterface::Class, QObject *, const QList&lt;QVariant&gt; &amp;)">
+            <modify-argument index="3">
+                <replace-default-expression with="null"/>
+            </modify-argument>
+        </modify-function>
+    </interface-type>
+    <interface-type name="Phonon::EffectInterface" java-name="AbstractEffect"/>
+    <interface-type name="Phonon::MediaNode" java-name="MediaNode"/>
+
+    <interface-type name="Phonon::MediaObjectInterface" java-name="AbstractMediaObject"/>
+    <interface-type name="Phonon::PlatformPlugin" java-name="PlatformPlugin">
+        <modify-function signature="notification(const char *, const QString &amp;, const QStringList&lt;QString&gt; &amp;, QObject *, const char *)const">
+            <modify-argument index="3">
+                <replace-default-expression with="null"/>
+            </modify-argument>
+            <modify-argument index="1">
+                <replace-type modified-type="java.lang.String"/>
+                <conversion-rule class="shell">
+                    jobject %out = qtjambi_from_qstring(__jni_env, QString::fromUtf8(QByteArray(%in)));
+                </conversion-rule>
+                <conversion-rule class="native">
+                    QByteArray b1 = qtjambi_to_qstring(__jni_env, (jstring) %in).toUtf8();
+                    const char* %out = b1.data();
+                </conversion-rule>
+            </modify-argument>
+            <modify-argument index="5">
+                <replace-type modified-type="java.lang.String"/>
+                <conversion-rule class="shell">
+                    jobject %out = qtjambi_from_qstring(__jni_env, QString::fromUtf8(QByteArray(%in)));
+                </conversion-rule>
+                <conversion-rule class="native">
+                    QByteArray b2 = qtjambi_to_qstring(__jni_env, (jstring) %in).toUtf8();
+                    const char* %out = b1.data();
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+    </interface-type>
+    <interface-type name="Phonon::StreamInterface" java-name="AbstractStream"/>
+    <interface-type name="Phonon::VideoWidgetInterface" java-name="AbstractVideoWidget"/>
+    <interface-type name="Phonon::VolumeFaderInterface" java-name="AbstractVolumeFader"/>
+
+    <value-type name="Phonon::EffectParameter" java-name="EffectParameter">
+        <modify-function signature="EffectParameter()" remove="all"/> <!-- internal -->
+        <modify-function signature="operator&lt;(const Phonon::EffectParameter &amp;)const" remove="all"/> <!-- internal -->
+        <modify-function signature="operator&gt;(const Phonon::EffectParameter &amp;)const" remove="all"/> <!-- internal -->
+        <modify-function signature="id()const" remove="all"/> <!-- internal -->
+        <modify-function signature="operator=(Phonon::EffectParameter)" remove="all"/> <!-- Covered by copy constructor -->
+    </value-type>
+    <value-type name="Phonon::MediaSource" java-name="MediaSource">
+        <modify-function signature="operator=(Phonon::MediaSource)" remove="all"/> <!-- Covered by copy constructor -->
+    </value-type>
+    <value-type name="Phonon::Path" java-name="Path">
+        <modify-function signature="disconnect()" rename="disconnectPath"/>
+        <modify-function signature="operator=(Phonon::Path)" remove="all"/> <!-- Covered by copy constructor -->
+        <modify-function signature="insertEffect(Phonon::EffectDescription,Phonon::Effect*)">
+            <modify-argument index="1">
+                <reference-count action="add" variable-name="__rcEffects"/>
+            </modify-argument>
+            <modify-argument index="2">
+                <reference-count action="ignore"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="insertEffect(Phonon::Effect*,Phonon::Effect*)">
+            <modify-argument index="1">
+                <reference-count action="add" variable-name="__rcEffects"/>
+            </modify-argument>
+            <modify-argument index="2">
+                <reference-count action="ignore"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="removeEffect(Phonon::Effect*)">
+            <modify-argument index="1">
+                <reference-count action="remove" variable-name="__rcEffects"/>
+            </modify-argument>
+        </modify-function>
+    </value-type>
+    <value-type name="Phonon::ObjectDescription" generate="no"/>
+    <value-type name="Phonon::EffectDescription" java-name="EffectDescription">
+        <modify-function signature="fromIndex(int)" remove="all"/> <!-- temporarily removed so we can compile this (not needed in current API) -->
+        <modify-function signature="operator!=(Phonon::ObjectDescription)const" remove="all"/>
+        <modify-function signature="operator==(Phonon::ObjectDescription)const" access="private">
+            <modify-argument index="1">
+                <replace-type modified-type="qt.phonon.EffectDescription"/>
+                <conversion-rule class="native">
+                    Phonon::EffectDescription %out = (Phonon::EffectDescription ) *(Phonon::EffectDescription *)%in;
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="property(const char*)const" access="private"/>
+        <inject-code>
+            <import-file name="typesystem_phonon-java.java" quote-after-line="class ObjectDescriptionSubclass___" quote-before-line="}// class"/>
+        </inject-code>
+    </value-type>
+    <value-type name="Phonon::AudioOutputDevice" java-name="AudioOutputDevice">
+        <modify-function signature="fromIndex(int)" remove="all"/> <!-- temporarily removed so we can compile this (not needed in current API) -->
+        <modify-function signature="operator==(Phonon::ObjectDescription)const" access="private">
+            <modify-argument index="1">
+                <replace-type modified-type="qt.phonon.AudioOutputDevice"/>
+                <conversion-rule class="native">
+                    Phonon::AudioOutputDevice %out = (Phonon::AudioOutputDevice) *(Phonon::AudioOutputDevice *)%in;
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="operator!=(Phonon::ObjectDescription)const" remove="all"/>
+        <modify-function signature="property(const char*)const" access="private"/>
+        <inject-code>
+            <import-file name="typesystem_phonon-java.java" quote-after-line="class ObjectDescriptionSubclass___" quote-before-line="}// class"/>
+        </inject-code>
+    </value-type>
+
+    <object-type name="Phonon::AbstractAudioOutput" java-name="AbstractAudioOutput"/>
+    <object-type name="Phonon::AbstractMediaStream" java-name="AbstractMediaStream"/>
+    <object-type name="Phonon::AudioOutput" java-name="AudioOutput"/>
+    <object-type name="Phonon::Effect" java-name="Effect"/>
+    <object-type name="Phonon::EffectWidget" java-name="EffectWidget"/>
+    <object-type name="Phonon::MediaController" java-name="MediaController"/>
+    <object-type name="Phonon::MediaObject" java-name="MediaObject">
+        <modify-function signature="enqueue(const QList&lt;QUrl&gt; &amp;)" rename="enqueueUrls"/>
+        <modify-function signature="setQueue(const QList&lt;QUrl&gt; &amp;)" rename="setQueueToUrls"/>
+    </object-type>
+    <object-type name="Phonon::SeekSlider" java-name="SeekSlider">
+        <modify-function signature="setMediaObject(Phonon::MediaObject*)">
+            <modify-argument index="1">
+                <reference-count action="set" variable-name="__rcMediaObject"/>
+            </modify-argument>
+        </modify-function>
+    </object-type>
+    <object-type name="Phonon::VideoPlayer" java-name="VideoPlayer"/>
+    <object-type name="Phonon::VideoWidget" java-name="VideoWidget"/>
+    <object-type name="Phonon::VolumeFaderEffect" java-name="VolumeFaderEffect"/>
+    <object-type name="Phonon::VolumeSlider" java-name="VolumeSlider">
+        <modify-function signature="setAudioOutput(Phonon::AudioOutput*)">
+            <modify-argument index="1">
+                <reference-count action="set" variable-name="__rcAudioOutput"/>
+            </modify-argument>
+        </modify-function>
+    </object-type>
+
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: Final class 'AbstractAudioOutput' set to non-final, as it is extended by other classes"/>
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'QDBus' does not have a type entry"/>
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: private virtual function 'create(const QString &amp; name)' in 'QTextCodecPlugin'"/>
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: private virtual function 'keys() const' in 'QTextCodecPlugin'"/>
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'MediaSource' has equals operators but no qHash() function"/>
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'Path' has equals operators but no qHash() function"/>
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'EffectParameter' has equals operators but no qHash() function"/>
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'Phonon_ObjectDescription' has equals operators but no qHash() function"/>
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'EffectDescription' has equals operators but no qHash() function"/>
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'AudioOutputDevice' has equals operators but no qHash() function"/>
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'Phonon::operator&lt;&lt;', unmatched return type 'QDebug'"/>
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'Phonon::ObjectDescription::ObjectDescription', unmatched parameter type 'QExplicitlySharedDataPointer&lt;ObjectDescriptionData&gt; const&amp;'"/>
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'Phonon::BackendCapabilities::notifier', unmatched return type 'Phonon::BackendCapabilities::Notifier*'"/>
+
+
+
+
+
+
+
+
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'Phonon::AudioOutputInterface' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.phonon.VolumeFaderEffect' for enum 'FadeCurve' is not declared"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'Phonon::MediaSource' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'Phonon::MediaController' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QAbstractXmlForwardIterator' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: enum 'QFormLayout::FormStyle' is specified in typesystem, but not declared"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'Phonon::AbstractAudioOutput' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.phonon.Phonon' for enum 'DiscType' is not declared"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'Phonon::AudioOutput' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.phonon.VideoWidget' for enum 'AspectRatio' is not declared"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'Phonon::Effect' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.phonon.MediaSource' for enum 'Type' is not declared"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'Phonon::VolumeSlider' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'Phonon::BackendInterface' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'Phonon::EffectParameter' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'Phonon::VideoWidget' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'Phonon::StreamInterface' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.phonon.Phonon' for enum 'ErrorType' is not declared"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.phonon.VideoWidget' for enum 'ScaleMode' is not declared"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.phonon.AbstractAddon' for enum 'Interface' is not declared"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'Phonon::MediaObjectInterface' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.phonon.Phonon' for enum 'MetaData' is not declared"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'Phonon::Path' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.phonon.EffectParameter' for enum 'Hint' is not declared"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.phonon.MediaController' for enum 'Feature' is not declared"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'Phonon::VideoPlayer' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'Phonon::MediaObject' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.phonon.AbstractBackend' for enum 'Class' is not declared"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.phonon.AbstractAddon' for enum 'AngleCommand' is not declared"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.phonon.AbstractAddon' for enum 'TitleCommand' is not declared"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'Phonon::VolumeFaderEffect' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'Phonon::AudioOutputDevice' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'Phonon::ObjectDescription' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'Phonon::EffectDescription' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'Phonon::VideoWidgetInterface' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'Phonon::EffectInterface' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.phonon.Phonon' for enum 'State' is not declared"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'Phonon::SeekSlider' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.phonon.AbstractAddon' for enum 'NavigationCommand' is not declared"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'Phonon::MediaNode' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.phonon.Phonon' for enum 'Category' is not declared"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'JObjectWrapper' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'Phonon::AbstractMediaStream' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'Phonon::PlatformPlugin' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'Phonon::AddonInterface' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.phonon.Phonon' for enum 'ObjectDescriptionType' is not declared"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.phonon.AbstractAddon' for enum 'ChapterCommand' is not declared"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'Phonon::AbstractVideoOutput' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'Phonon::EffectWidget' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'Phonon::VolumeFaderInterface' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+
+
+</typesystem>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/typesystem_sql-common.xml	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,128 @@
+<typesystem>
+  <rejection class="QSqlDriverCreator" />
+  <rejection class="QSqlDriverPlugin" />
+  <rejection class="QSqlDriverFactoryInterface" />
+
+  <namespace-type name="QSql">
+     <include file-name="qsql.h" location="global" />
+  </namespace-type>
+
+  <value-type name="QSqlDatabase">
+    <extra-includes>
+        <include file-name="QSqlQuery" location="global" />
+        <include file-name="QSqlError" location="global" />
+        <include file-name="QSqlIndex" location="global" />
+        <include file-name="QSqlRecord" location="global" />
+        <include file-name="QStringList" location="global" />
+        <include file-name="QSize" location="global" />
+    </extra-includes>
+    <modify-function signature="operator=(QSqlDatabase)" remove="all"/>
+  </value-type>
+
+  <value-type name="QSqlQuery">
+    <extra-includes>
+        <include file-name="QSqlError" location="global" />
+        <include file-name="QSqlRecord" location="global" />
+        <include file-name="QStringList" location="global" />
+        <include file-name="QSize" location="global" />
+    </extra-includes>
+    <modify-function signature="operator=(QSqlQuery)" remove="all"/>
+  </value-type>
+
+  <value-type name="QSqlRecord">
+    <extra-includes>
+        <include file-name="QSqlField" location="global" />
+    </extra-includes>
+    <modify-function signature="append(QSqlField)" access="non-final"/>
+    <modify-function signature="operator=(QSqlRecord)" remove="all"/>
+  </value-type>
+
+  <value-type name="QSqlError">
+    <modify-function signature="operator=(QSqlError)" remove="all"/>
+  </value-type>
+
+  <value-type name="QSqlIndex">
+    <modify-function signature="operator=(QSqlIndex)" remove="all"/>
+  </value-type>
+
+  <value-type name="QSqlRelation" />
+
+  <value-type name="QSqlField">
+    <modify-function signature="operator=(QSqlField)" remove="all"/>
+  </value-type>
+
+  <object-type name="QSqlDriver">
+    <extra-includes>
+        <include file-name="QSqlQuery" location="global" />
+        <include file-name="QSqlError" location="global" />
+        <include file-name="QSqlIndex" location="global" />
+        <include file-name="QSqlRecord" location="global" />
+        <include file-name="QStringList" location="global" />
+        <include file-name="QSize" location="global" />
+    </extra-includes>
+  </object-type>
+
+  <object-type name="QSqlQueryModel">
+    <modify-function signature="indexInQuery(QModelIndex)const" access="non-final"/>
+    <modify-function signature="setQuery(QSqlQuery)" access="non-final"/>
+    <extra-includes>
+        <include file-name="QSqlError" location="global" />
+        <include file-name="QSqlQuery" location="global" />
+        <include file-name="QSqlRecord" location="global" />
+        <include file-name="QStringList" location="global" />
+        <include file-name="QSize" location="global" />
+    </extra-includes>
+  </object-type>
+  <object-type name="QSqlRelationalTableModel">
+    <extra-includes>
+        <include file-name="QStringList" location="global" />
+        <include file-name="QSize" location="global" />
+    </extra-includes>
+  </object-type>
+  <object-type name="QSqlResult">
+      <extra-includes>
+        <include file-name="QSqlError" location="global" />
+        <include file-name="QSqlQuery" location="global" />
+        <include file-name="QSqlRecord" location="global" />
+        <include file-name="QStringList" location="global" />
+        <include file-name="QSize" location="global" />
+      </extra-includes>
+      <modify-function signature="virtual_hook(int,void*)">
+        <remove />
+      </modify-function>
+
+  </object-type>
+  <object-type name="QSqlTableModel">
+    <extra-includes>
+        <include file-name="QSqlIndex" location="global" />
+        <include file-name="QStringList" location="global" />
+        <include file-name="QSize" location="global" />
+    </extra-includes>
+  </object-type>
+  <object-type name="QSqlDriverCreatorBase">
+    <extra-includes>
+        <include file-name="QSqlDriver" location="global" />
+    </extra-includes>
+  </object-type>
+
+  <enum-type name="QSql::Location" />
+  <enum-type name="QSql::ParamTypeFlag" flags="QSql::ParamType" />
+  <enum-type name="QSql::TableType" />
+  <enum-type name="QSql::NumericalPrecisionPolicy" />
+  <enum-type name="QSqlDriver::DriverFeature" />
+  <enum-type name="QSqlDriver::IdentifierType" />
+  <enum-type name="QSqlDriver::StatementType" />
+  <enum-type name="QSqlError::ErrorType" />
+  <enum-type name="QSqlField::RequiredStatus" />
+  <enum-type name="QSqlQuery::BatchExecutionMode"/>
+  <enum-type name="QSqlResult::BindingSyntax" />
+  <enum-type name="QSqlResult::VirtualHookOperation" />
+  <enum-type name="QSqlTableModel::EditStrategy" />
+
+  <suppress-warning text="WARNING(CppImplGenerator) :: protected function '*' in final class '*'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: visibility of function '*' modified in class '*'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: hiding of function '*' in class '*'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QSqlField' has equals operators but no qHash() function" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QSqlRecord' has equals operators but no qHash() function" />
+
+</typesystem>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/typesystem_sql-java.java	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+package generator;
+
+import qt.*;
+import qt.sql.*;
+
+class QSqlDatabase___ extends QSqlDatabase {
+
+    public static String defaultConnection() {
+        qt.QNativePointer np = defaultConnection_private();
+
+        String returned = "";
+        int i = 0;
+        while (np.byteAt(i) != 0)
+            returned += (char) np.byteAt(i++);
+        return returned;
+    }
+
+}// class
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/typesystem_sql-java.xml	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,97 @@
+<?xml version="1.0"?>
+<typesystem package="qt.sql" default-superclass="qt.QtJambiObject">
+    <inject-code>
+        qt.Utilities.loadQtLibrary("QtSql");
+    </inject-code>
+
+
+
+    <value-type name="QSqlDatabase">
+        <inject-code>
+            <import-file name="typesystem_sql-java.java" quote-after-line="class QSqlDatabase___" quote-before-line="}// class"/>
+        </inject-code>
+        <modify-function signature="addDatabase(QSqlDriver*,QString)">
+            <modify-argument index="1">
+                <define-ownership class="java" owner="c++"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="contains(QString)">
+            <modify-argument index="1">
+                <replace-default-expression with="defaultConnection()"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="addDatabase(QString,QString)">
+            <modify-argument index="2">
+                <replace-default-expression with="defaultConnection()"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="addDatabase(QSqlDriver *,QString)">
+            <modify-argument index="2">
+                <replace-default-expression with="defaultConnection()"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="database(QString,bool)">
+            <modify-argument index="1">
+                <replace-default-expression with="defaultConnection()"/>
+            </modify-argument>
+        </modify-function>
+        <modify-field name="defaultConnection">
+            <access modifier="private"/>
+            <rename to="defaultConnection_private"/>
+        </modify-field>
+
+    </value-type>
+
+    <object-type name="QSqlTableModel">
+
+        <template name="sql.convert_sqlrecord_reference_to_java">
+            jobject %out = qtjambi_from_object(__jni_env, &amp;%in, "QSqlRecord", "com/trolltech/qt/sql/", false);
+            Q_ASSERT(%out);
+        </template>
+
+        <template name="sql.convert_sqlrecord_reference_from_java">
+            QSqlRecord *__ptr_record = (QSqlRecord *) qtjambi_to_object(__jni_env, %in);
+
+            QSqlRecord dummy;
+            QSqlRecord &amp;%out = __ptr_record == 0 ? dummy : *__ptr_record;
+        </template>
+
+        <modify-function signature="beforeInsert(QSqlRecord&amp;)">
+            <modify-argument index="1">
+                <replace-type modified-type="qt.sql.QSqlRecord"/>
+                <conversion-rule class="shell">
+                    <insert-template name="sql.convert_sqlrecord_reference_to_java"/>
+                </conversion-rule>
+                <conversion-rule class="native">
+                    <insert-template name="sql.convert_sqlrecord_reference_from_java"/>
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="beforeUpdate(int,QSqlRecord&amp;)">
+            <modify-argument index="2">
+                <replace-type modified-type="qt.sql.QSqlRecord"/>
+                <conversion-rule class="shell">
+                    <insert-template name="sql.convert_sqlrecord_reference_to_java"/>
+                </conversion-rule>
+                <conversion-rule class="native">
+                    <insert-template name="sql.convert_sqlrecord_reference_from_java"/>
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="primeInsert(int,QSqlRecord&amp;)">
+            <modify-argument index="2">
+                <replace-type modified-type="qt.sql.QSqlRecord"/>
+                <conversion-rule class="shell">
+                    <insert-template name="sql.convert_sqlrecord_reference_to_java"/>
+                </conversion-rule>
+                <conversion-rule class="native">
+                    <insert-template name="sql.convert_sqlrecord_reference_from_java"/>
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+    </object-type>
+
+</typesystem>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/typesystem_sql.xml	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,216 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<typesystem package="qt.sql" default-superclass="qt.QtDObject">
+<inject-code>
+        qt.Utilities.loadQtLibrary("QtSql");
+    </inject-code>
+  <rejection class="QSqlDriverCreator"/>
+  <rejection class="QSqlDriverPlugin"/>
+  <rejection class="QSqlDriverFactoryInterface"/>
+
+  <namespace-type name="QSql">
+     <include file-name="qsql.h" location="global"/>
+  </namespace-type>
+
+  <value-type name="QSqlDatabase">
+    <extra-includes>
+        <include file-name="QSqlQuery" location="global"/>
+        <include file-name="QSqlError" location="global"/>
+        <include file-name="QSqlIndex" location="global"/>
+        <include file-name="QSqlRecord" location="global"/>
+        <include file-name="QStringList" location="global"/>
+        <include file-name="QSize" location="global"/>
+    </extra-includes>
+    <modify-function signature="operator=(QSqlDatabase)" remove="all"/>
+  
+        <inject-code>
+            <import-file name="typesystem_sql-java.java" quote-after-line="class QSqlDatabase___" quote-before-line="}// class"/>
+        </inject-code>
+        <modify-function signature="addDatabase(QSqlDriver*,QString)">
+            <modify-argument index="1">
+                <define-ownership class="java" owner="c++"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="contains(QString)">
+            <modify-argument index="1">
+                <replace-default-expression with="defaultConnection()"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="addDatabase(QString,QString)">
+            <modify-argument index="2">
+                <replace-default-expression with="defaultConnection()"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="addDatabase(QSqlDriver *,QString)">
+            <modify-argument index="2">
+                <replace-default-expression with="defaultConnection()"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="database(QString,bool)">
+            <modify-argument index="1">
+                <replace-default-expression with="defaultConnection()"/>
+            </modify-argument>
+        </modify-function>
+        <modify-field name="defaultConnection">
+            <access modifier="private"/>
+            <rename to="defaultConnection_private"/>
+        </modify-field>
+
+    </value-type>
+
+  <value-type name="QSqlQuery">
+    <extra-includes>
+        <include file-name="QSqlError" location="global"/>
+        <include file-name="QSqlRecord" location="global"/>
+        <include file-name="QStringList" location="global"/>
+        <include file-name="QSize" location="global"/>
+    </extra-includes>
+    <modify-function signature="operator=(QSqlQuery)" remove="all"/>
+  </value-type>
+
+  <value-type name="QSqlRecord">
+    <extra-includes>
+        <include file-name="QSqlField" location="global"/>
+    </extra-includes>
+    <modify-function signature="append(QSqlField)" access="non-final"/>
+    <modify-function signature="operator=(QSqlRecord)" remove="all"/>
+  </value-type>
+
+  <value-type name="QSqlError">
+    <modify-function signature="operator=(QSqlError)" remove="all"/>
+  </value-type>
+
+  <value-type name="QSqlIndex">
+    <modify-function signature="operator=(QSqlIndex)" remove="all"/>
+  </value-type>
+
+  <value-type name="QSqlRelation"/>
+
+  <value-type name="QSqlField">
+    <modify-function signature="operator=(QSqlField)" remove="all"/>
+  </value-type>
+
+  <object-type name="QSqlDriver">
+    <extra-includes>
+        <include file-name="QSqlQuery" location="global"/>
+        <include file-name="QSqlError" location="global"/>
+        <include file-name="QSqlIndex" location="global"/>
+        <include file-name="QSqlRecord" location="global"/>
+        <include file-name="QStringList" location="global"/>
+        <include file-name="QSize" location="global"/>
+    </extra-includes>
+  </object-type>
+
+  <object-type name="QSqlQueryModel">
+    <modify-function signature="indexInQuery(QModelIndex)const" access="non-final"/>
+    <modify-function signature="setQuery(QSqlQuery)" access="non-final"/>
+    <extra-includes>
+        <include file-name="QSqlError" location="global"/>
+        <include file-name="QSqlQuery" location="global"/>
+        <include file-name="QSqlRecord" location="global"/>
+        <include file-name="QStringList" location="global"/>
+        <include file-name="QSize" location="global"/>
+    </extra-includes>
+  </object-type>
+  <object-type name="QSqlRelationalTableModel">
+    <extra-includes>
+        <include file-name="QStringList" location="global"/>
+        <include file-name="QSize" location="global"/>
+    </extra-includes>
+  </object-type>
+  <object-type name="QSqlResult">
+      <extra-includes>
+        <include file-name="QSqlError" location="global"/>
+        <include file-name="QSqlQuery" location="global"/>
+        <include file-name="QSqlRecord" location="global"/>
+        <include file-name="QStringList" location="global"/>
+        <include file-name="QSize" location="global"/>
+      </extra-includes>
+      <modify-function signature="virtual_hook(int,void*)">
+        <remove/>
+      </modify-function>
+
+  </object-type>
+  <object-type name="QSqlTableModel">
+    <extra-includes>
+        <include file-name="QSqlIndex" location="global"/>
+        <include file-name="QStringList" location="global"/>
+        <include file-name="QSize" location="global"/>
+    </extra-includes>
+  
+
+        <template name="sql.convert_sqlrecord_reference_to_java">
+            jobject %out = qtjambi_from_object(__jni_env, &amp;%in, "QSqlRecord", "com/trolltech/qt/sql/", false);
+            Q_ASSERT(%out);
+        </template>
+
+        <template name="sql.convert_sqlrecord_reference_from_java">
+            QSqlRecord *__ptr_record = (QSqlRecord *) qtjambi_to_object(__jni_env, %in);
+
+            QSqlRecord dummy;
+            QSqlRecord &amp;%out = __ptr_record == 0 ? dummy : *__ptr_record;
+        </template>
+
+        <modify-function signature="beforeInsert(QSqlRecord&amp;)">
+            <modify-argument index="1">
+                <replace-type modified-type="qt.sql.QSqlRecord"/>
+                <conversion-rule class="shell">
+                    <insert-template name="sql.convert_sqlrecord_reference_to_java"/>
+                </conversion-rule>
+                <conversion-rule class="native">
+                    <insert-template name="sql.convert_sqlrecord_reference_from_java"/>
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="beforeUpdate(int,QSqlRecord&amp;)">
+            <modify-argument index="2">
+                <replace-type modified-type="qt.sql.QSqlRecord"/>
+                <conversion-rule class="shell">
+                    <insert-template name="sql.convert_sqlrecord_reference_to_java"/>
+                </conversion-rule>
+                <conversion-rule class="native">
+                    <insert-template name="sql.convert_sqlrecord_reference_from_java"/>
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="primeInsert(int,QSqlRecord&amp;)">
+            <modify-argument index="2">
+                <replace-type modified-type="qt.sql.QSqlRecord"/>
+                <conversion-rule class="shell">
+                    <insert-template name="sql.convert_sqlrecord_reference_to_java"/>
+                </conversion-rule>
+                <conversion-rule class="native">
+                    <insert-template name="sql.convert_sqlrecord_reference_from_java"/>
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+    </object-type>
+  <object-type name="QSqlDriverCreatorBase">
+    <extra-includes>
+        <include file-name="QSqlDriver" location="global"/>
+    </extra-includes>
+  </object-type>
+
+  <enum-type name="QSql::Location"/>
+  <enum-type name="QSql::ParamTypeFlag" flags="QSql::ParamType"/>
+  <enum-type name="QSql::TableType"/>
+  <enum-type name="QSql::NumericalPrecisionPolicy"/>
+  <enum-type name="QSqlDriver::DriverFeature"/>
+  <enum-type name="QSqlDriver::IdentifierType"/>
+  <enum-type name="QSqlDriver::StatementType"/>
+  <enum-type name="QSqlError::ErrorType"/>
+  <enum-type name="QSqlField::RequiredStatus"/>
+  <enum-type name="QSqlQuery::BatchExecutionMode"/>
+  <enum-type name="QSqlResult::BindingSyntax"/>
+  <enum-type name="QSqlResult::VirtualHookOperation"/>
+  <enum-type name="QSqlTableModel::EditStrategy"/>
+
+  <suppress-warning text="WARNING(CppImplGenerator) :: protected function '*' in final class '*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: visibility of function '*' modified in class '*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: hiding of function '*' in class '*'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QSqlField' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QSqlRecord' has equals operators but no qHash() function"/>
+
+</typesystem>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/typesystem_svg-common.xml	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,44 @@
+<typesystem>
+   <namespace-type name="QSvg" />
+
+  <enum-type name="QGraphicsSvgItem::enum_1"/>
+
+  <object-type name="QSvgRenderer">
+    <extra-includes>
+        <include file-name="QRectF" location="global" />
+        <include file-name="QMatrix" location="global" />
+        <include file-name="QSize" location="global" />
+        <include file-name="QByteArray" location="global" />
+    </extra-includes>
+  </object-type>
+
+  <object-type name="QSvgWidget">
+    <extra-includes>
+        <include file-name="QByteArray" location="global" />
+        <include file-name="QSvgRenderer" location="global" />
+        <include file-name="QSize" location="global" />
+    </extra-includes>
+  </object-type>
+
+  <object-type name="QSvgGenerator">
+    <modify-function signature="setOutputDevice(QIODevice*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcOutputDevice" />
+        </modify-argument>
+    </modify-function>
+  </object-type>
+
+  <object-type name="QGraphicsSvgItem">
+    <extra-includes>
+        <include file-name="QGraphicsItem" location="global" />
+        <include file-name="QSvgRenderer" location="global" />
+        <include file-name="QSize" location="global" />
+    </extra-includes>
+
+    <modify-function signature="matrix()const" remove="all"/>
+    <modify-function signature="resetMatrix()" remove="all"/>
+    <modify-function signature="sceneMatrix()const" remove="all"/>
+    <modify-function signature="setMatrix(QMatrix, bool)" remove="all"/>
+  </object-type>
+
+</typesystem>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/typesystem_svg-java.xml	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,52 @@
+<typesystem package="qt.svg" default-superclass="qt.QtJambiObject">
+    <inject-code>
+        qt.Utilities.loadQtLibrary("QtXml");
+        qt.Utilities.loadQtLibrary("QtGui");
+        qt.Utilities.loadQtLibrary("QtSvg");
+    </inject-code>
+
+
+    <object-type name="QGraphicsSvgItem" delete-in-main-thread="yes">
+        <modify-function signature="setGroup(QGraphicsItemGroup*)">
+            <modify-argument index="1">
+                <!-- Handled by injected code in QGraphicsItem -->
+                <reference-count action="ignore" />
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="setParentItem(QGraphicsItem*)">
+            <modify-argument index="1">
+                <!-- Handled by injected code in QGraphicsItem -->
+                <reference-count action="ignore" />
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="setSharedRenderer(QSvgRenderer*)">
+            <modify-argument index="1">
+                <define-ownership class="java" owner="c++" />
+            </modify-argument>
+            <inject-code position="beginning">
+                QSvgRenderer oldRenderer = renderer();
+            </inject-code>
+            <inject-code position="end">
+            if (oldRenderer != null)
+                oldRenderer.reenableGarbageCollection();
+            </inject-code>
+        </modify-function>
+        <modify-function signature="QGraphicsSvgItem(QGraphicsItem*)">
+            <inject-code position="end">
+                <argument-map index="1" meta-name="%1" />
+            if (%1 != null) disableGarbageCollection();
+            </inject-code>
+        </modify-function>
+        <modify-function signature="QGraphicsSvgItem(const QString &amp;,QGraphicsItem*)">
+            <inject-code position="end">
+                <argument-map index="2" meta-name="%2" />
+            if (%2 != null) disableGarbageCollection();
+            </inject-code>
+        </modify-function>
+
+    </object-type>
+
+    <suppress-warning text="WARNING(CppImplGenerator) :: protected function '*' in final class '*'" />
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: visibility of function '*' modified in class '*'" />
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: hiding of function '*' in class '*'" />
+</typesystem>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/typesystem_svg.xml	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<typesystem package="qt.svg" default-superclass="qt.QtJambiObject">
+<inject-code>
+        qt.Utilities.loadQtLibrary("QtXml");
+        qt.Utilities.loadQtLibrary("QtGui");
+        qt.Utilities.loadQtLibrary("QtSvg");
+    </inject-code>
+<suppress-warning text="WARNING(CppImplGenerator) :: protected function '*' in final class '*'"/>
+<suppress-warning text="WARNING(MetaJavaBuilder) :: visibility of function '*' modified in class '*'"/>
+<suppress-warning text="WARNING(MetaJavaBuilder) :: hiding of function '*' in class '*'"/>
+   <namespace-type name="QSvg"/>
+
+  <enum-type name="QGraphicsSvgItem::enum_1"/>
+
+  <object-type name="QSvgRenderer">
+    <extra-includes>
+        <include file-name="QRectF" location="global"/>
+        <include file-name="QMatrix" location="global"/>
+        <include file-name="QSize" location="global"/>
+        <include file-name="QByteArray" location="global"/>
+    </extra-includes>
+  </object-type>
+
+  <object-type name="QSvgWidget">
+    <extra-includes>
+        <include file-name="QByteArray" location="global"/>
+        <include file-name="QSvgRenderer" location="global"/>
+        <include file-name="QSize" location="global"/>
+    </extra-includes>
+  </object-type>
+
+  <object-type name="QSvgGenerator">
+    <modify-function signature="setOutputDevice(QIODevice*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcOutputDevice"/>
+        </modify-argument>
+    </modify-function>
+  </object-type>
+
+  <object-type name="QGraphicsSvgItem" delete-in-main-thread="yes">
+    <extra-includes>
+        <include file-name="QGraphicsItem" location="global"/>
+        <include file-name="QSvgRenderer" location="global"/>
+        <include file-name="QSize" location="global"/>
+    </extra-includes>
+
+    <modify-function signature="matrix()const" remove="all"/>
+    <modify-function signature="resetMatrix()" remove="all"/>
+    <modify-function signature="sceneMatrix()const" remove="all"/>
+    <modify-function signature="setMatrix(QMatrix, bool)" remove="all"/>
+  
+        <modify-function signature="setGroup(QGraphicsItemGroup*)">
+            <modify-argument index="1">
+                <!-- Handled by injected code in QGraphicsItem -->
+                <reference-count action="ignore"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="setParentItem(QGraphicsItem*)">
+            <modify-argument index="1">
+                <!-- Handled by injected code in QGraphicsItem -->
+                <reference-count action="ignore"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="setSharedRenderer(QSvgRenderer*)">
+            <modify-argument index="1">
+                <define-ownership class="java" owner="c++"/>
+            </modify-argument>
+            <inject-code position="beginning">
+                QSvgRenderer oldRenderer = renderer();
+            </inject-code>
+            <inject-code position="end">
+            if (oldRenderer != null)
+                oldRenderer.reenableGarbageCollection();
+            </inject-code>
+        </modify-function>
+        <modify-function signature="QGraphicsSvgItem(QGraphicsItem*)">
+            <inject-code position="end">
+                <argument-map index="1" meta-name="%1"/>
+            if (%1 != null) disableGarbageCollection();
+            </inject-code>
+        </modify-function>
+        <modify-function signature="QGraphicsSvgItem(const QString &amp;,QGraphicsItem*)">
+            <inject-code position="end">
+                <argument-map index="2" meta-name="%2"/>
+            if (%2 != null) disableGarbageCollection();
+            </inject-code>
+        </modify-function>
+
+    </object-type>
+
+</typesystem>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/typesystem_webkit-common.xml	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,97 @@
+<?xml version="1.0"?>
+<typesystem>
+    <namespace-type name="WebCore"/>
+
+    <enum-type name="QWebSettings::FontFamily"/>
+    <enum-type name="QWebSettings::FontSize"/>
+    <enum-type name="QWebSettings::WebGraphic"/>
+    <enum-type name="QWebSettings::WebAttribute"/>
+    <enum-type name="QWebPage::NavigationType"/>
+    <enum-type name="QWebPage::WebAction"/>
+    <enum-type name="QWebPage::WebWindowType"/>
+    <enum-type name="QWebPage::FindFlag" flags="QWebPage::FindFlags" />
+    <enum-type name="QWebPage::LinkDelegationPolicy" />
+
+    <object-type name="QWebView">
+        <modify-function signature="setPage(QWebPage*)">
+            <modify-argument index="1">
+                <define-ownership class="java" owner="c++"/>
+            </modify-argument>
+        </modify-function>
+    </object-type>
+    <object-type name="QWebFrame">
+        <modify-function signature="addToJavaScriptWindowObject(QString,QObject*)">
+            <modify-argument index="2">
+                <reference-count action="ignore"/>
+            </modify-argument>
+        </modify-function>
+    </object-type>
+    <object-type name="QWebHistory"/>
+    <object-type name="QWebSettings"/>
+    <object-type name="QWebPage">
+        <inject-code class="java">
+            <import-file name="typesystem_webkit-java.java" quote-after-line="class QWebPage___" quote-before-line="}// class"/>
+        </inject-code>
+        <modify-function signature="javaScriptPrompt(QWebFrame*,QString,QString,QString*)">
+            <access modifier="private"/>
+        </modify-function>
+        <modify-function signature="setView(QWidget*)">
+            <modify-argument index="1">
+                <reference-count action="set" variable-name="__rcView"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="setNetworkAccessManager(QNetworkAccessManager*)">
+            <modify-argument index="1">
+                 <define-ownership class="java" owner="c++"/>
+            </modify-argument>
+        </modify-function>
+    </object-type>
+
+    <value-type name="QWebHitTestResult">
+      <modify-function signature="operator=(QWebHitTestResult)" remove="all" />
+    </value-type>
+
+    <value-type name="QWebHistoryItem">
+        <custom-constructor>
+            return new QWebHistoryItem(*copy);
+        </custom-constructor>
+        <custom-destructor>
+            delete copy;
+        </custom-destructor>
+        <modify-function signature="operator=(QWebHistoryItem)" remove="all"/>
+    </value-type>
+
+    <object-type name="QWebHistoryInterface">
+        <modify-function signature="setDefaultInterface(QWebHistoryInterface*)">
+            <modify-argument index="1">
+                <reference-count action="set" variable-name="__rcInterface"/>
+            </modify-argument>
+        </modify-function>
+    </object-type>
+
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QWebFrame::QWebFrame', unmatched parameter type 'QWebFrameData*'" />
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QWebSettings::QWebSettings', unmatched parameter type 'WebCore::Settings*'" />
+
+    <!-- Needed to avoid warnings on compilers that don't support webkit -->
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.webkit.QWebPage' for enum 'NavigationRequestResponse' is not declared" />
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.webkit.QWebSettings' for enum 'WebAttribute' is not declared" />
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebSettings' is specified in typesystem, but not defined. This could potentially lead to compilation errors." />
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebHistoryItem' is specified in typesystem, but not defined. This could potentially lead to compilation errors." />
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebHistoryInterface' is specified in typesystem, but not defined. This could potentially lead to compilation errors." />
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.webkit.QWebPage' for enum 'WebAction' is not declared" />
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.webkit.QWebSettings' for enum 'FontSize' is not declared" />
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.webkit.QWebSettings' for enum 'WebGraphic' is not declared" />
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.webkit.QWebPage' for enum 'NavigationType' is not declared" />
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.webkit.QWebSettings' for enum 'FontType' is not declared" />
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebFrame' is specified in typesystem, but not defined. This could potentially lead to compilation errors." />
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebHistory' is specified in typesystem, but not defined. This could potentially lead to compilation errors." />
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebView' is specified in typesystem, but not defined. This could potentially lead to compilation errors." />
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebPage' is specified in typesystem, but not defined. This could potentially lead to compilation errors." />
+
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebHitTestResult' is specified in typesystem, but not defined. This could potentially lead to compilation errors." />
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.webkit.QWebPage' for enum 'FindFlag' is not declared" />
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.webkit.QWebPage' for enum 'LinkDelegationPolicy' is not declared" />
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.webkit.QWebSettings' for enum 'FontFamily' is not declared" />
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.webkit.QWebPage' for enum 'WebWindowType' is not declared" />
+
+</typesystem>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/typesystem_webkit-java.java	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+package generator;
+
+import qt.*;
+import qt.webkit.*;
+
+class QWebPage___ extends QWebPage {
+    protected String javaScriptPrompt(qt.webkit.QWebFrame originatingFrame, java.lang.String msg, java.lang.String defaultValue) {
+        qt.QNativePointer result = new qt.QNativePointer(QNativePointer.Type.String);
+        if (javaScriptPrompt(originatingFrame, msg, defaultValue, result))
+            return result.stringValue();
+        else
+            return null;
+    }
+
+}// class
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/typesystem_webkit-java.xml	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<typesystem package="qt.webkit" default-superclass="qt.QtJambiObject">
+    <inject-code>
+    qt.Utilities.loadQtLibrary("QtGui");
+    qt.Utilities.loadQtLibrary("QtNetwork");
+    qt.Utilities.loadQtLibrary("QtWebKit");
+    </inject-code>
+</typesystem>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/typesystem_webkit.xml	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<typesystem package="qt.webkit" default-superclass="qt.QtJambiObject">
+<inject-code>
+    qt.Utilities.loadQtLibrary("QtGui");
+    qt.Utilities.loadQtLibrary("QtNetwork");
+    qt.Utilities.loadQtLibrary("QtWebKit");
+    </inject-code>
+    <namespace-type name="WebCore"/>
+
+    <enum-type name="QWebSettings::FontFamily"/>
+    <enum-type name="QWebSettings::FontSize"/>
+    <enum-type name="QWebSettings::WebGraphic"/>
+    <enum-type name="QWebSettings::WebAttribute"/>
+    <enum-type name="QWebPage::NavigationType"/>
+    <enum-type name="QWebPage::WebAction"/>
+    <enum-type name="QWebPage::WebWindowType"/>
+    <enum-type name="QWebPage::FindFlag" flags="QWebPage::FindFlags"/>
+    <enum-type name="QWebPage::LinkDelegationPolicy"/>
+
+    <object-type name="QWebView">
+        <modify-function signature="setPage(QWebPage*)">
+            <modify-argument index="1">
+                <define-ownership class="java" owner="c++"/>
+            </modify-argument>
+        </modify-function>
+    </object-type>
+    <object-type name="QWebFrame">
+        <modify-function signature="addToJavaScriptWindowObject(QString,QObject*)">
+            <modify-argument index="2">
+                <reference-count action="ignore"/>
+            </modify-argument>
+        </modify-function>
+    </object-type>
+    <object-type name="QWebHistory"/>
+    <object-type name="QWebSettings"/>
+    <object-type name="QWebPage">
+        <inject-code class="java">
+            <import-file name="typesystem_webkit-java.java" quote-after-line="class QWebPage___" quote-before-line="}// class"/>
+        </inject-code>
+        <modify-function signature="javaScriptPrompt(QWebFrame*,QString,QString,QString*)">
+            <access modifier="private"/>
+        </modify-function>
+        <modify-function signature="setView(QWidget*)">
+            <modify-argument index="1">
+                <reference-count action="set" variable-name="__rcView"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="setNetworkAccessManager(QNetworkAccessManager*)">
+            <modify-argument index="1">
+                 <define-ownership class="java" owner="c++"/>
+            </modify-argument>
+        </modify-function>
+    </object-type>
+
+    <value-type name="QWebHitTestResult">
+      <modify-function signature="operator=(QWebHitTestResult)" remove="all"/>
+    </value-type>
+
+    <value-type name="QWebHistoryItem">
+        <custom-constructor>
+            return new QWebHistoryItem(*copy);
+        </custom-constructor>
+        <custom-destructor>
+            delete copy;
+        </custom-destructor>
+        <modify-function signature="operator=(QWebHistoryItem)" remove="all"/>
+    </value-type>
+
+    <object-type name="QWebHistoryInterface">
+        <modify-function signature="setDefaultInterface(QWebHistoryInterface*)">
+            <modify-argument index="1">
+                <reference-count action="set" variable-name="__rcInterface"/>
+            </modify-argument>
+        </modify-function>
+    </object-type>
+
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QWebFrame::QWebFrame', unmatched parameter type 'QWebFrameData*'"/>
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QWebSettings::QWebSettings', unmatched parameter type 'WebCore::Settings*'"/>
+
+    <!-- Needed to avoid warnings on compilers that don't support webkit -->
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.webkit.QWebPage' for enum 'NavigationRequestResponse' is not declared"/>
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.webkit.QWebSettings' for enum 'WebAttribute' is not declared"/>
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebSettings' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebHistoryItem' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebHistoryInterface' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.webkit.QWebPage' for enum 'WebAction' is not declared"/>
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.webkit.QWebSettings' for enum 'FontSize' is not declared"/>
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.webkit.QWebSettings' for enum 'WebGraphic' is not declared"/>
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.webkit.QWebPage' for enum 'NavigationType' is not declared"/>
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.webkit.QWebSettings' for enum 'FontType' is not declared"/>
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebFrame' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebHistory' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebView' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebPage' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebHitTestResult' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.webkit.QWebPage' for enum 'FindFlag' is not declared"/>
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.webkit.QWebPage' for enum 'LinkDelegationPolicy' is not declared"/>
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.webkit.QWebSettings' for enum 'FontFamily' is not declared"/>
+    <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.webkit.QWebPage' for enum 'WebWindowType' is not declared"/>
+
+</typesystem>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/typesystem_xml-common.xml	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,275 @@
+<?xml-stylesheet type="text/xsl" href="merge.xsl"?>
+<typesystem>
+    <rejection class="QXmlAttributes::Attribute" />
+    <rejection class="QDomNode" field-name="impl" />
+
+    <enum-type name="QDomNode::NodeType" />
+    <enum-type name="QDomNode::EncodingPolicy" />
+    <enum-type name="QDomImplementation::InvalidDataPolicy" />
+    <enum-type name="QXmlStreamReader::Error" />
+    <enum-type name="QXmlStreamReader::TokenType" />
+
+
+    <value-type name="QDomAttr">
+        <modify-function signature="operator=(QDomAttr)" remove="all"/>
+        <modify-function signature="nodeType()const" remove="all"/>
+    </value-type>
+
+    <value-type name="QDomCDATASection">
+        <modify-function signature="operator=(QDomCDATASection)" remove="all"/>
+        <modify-function signature="nodeType()const" remove="all"/>
+    </value-type>
+
+    <value-type name="QDomCharacterData">
+        <modify-function signature="operator=(QDomCharacterData)" remove="all"/>
+        <modify-function signature="nodeType()const" remove="all"/>
+    </value-type>
+
+    <value-type name="QDomComment">
+        <modify-function signature="operator=(QDomComment)" remove="all"/>
+        <modify-function signature="nodeType()const" remove="all"/>
+    </value-type>
+
+    <value-type name="QDomDocument">
+        <modify-function signature="nodeType()const" remove="all"/>
+        <modify-function signature="operator=(QDomDocument)" remove="all"/>
+
+        <!--bool setContent(QIODevice* dev, bool namespaceProcessing, QString *errorMsg=0, int *errorLine=0, int *errorColumn=0 ); -->
+        <modify-function signature="setContent(QIODevice*, bool, QString*, int*, int*)">
+            <modify-argument index="1">
+                <reference-count action="set" variable-name="__rcContent" />
+            </modify-argument>
+        </modify-function>
+
+
+        <modify-function signature="setContent(QXmlInputSource*,QXmlReader*,QString*,int*,int*)">
+            <modify-argument index="1">
+                <reference-count action="set" variable-name="__rcContent" />
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="setContent(QIODevice*,QString*,int*,int*)">
+            <modify-argument index="1">
+                <reference-count action="set" variable-name="__rcContent" />
+            </modify-argument>
+        </modify-function>
+
+    </value-type>
+
+    <value-type name="QDomDocumentFragment">
+        <modify-function signature="nodeType()const" remove="all"/>
+        <modify-function signature="operator=(QDomDocumentFragment)" remove="all"/>
+    </value-type>
+
+    <value-type name="QDomDocumentType" >
+        <modify-function signature="nodeType()const" remove="all"/>
+        <modify-function signature="operator=(QDomDocumentType)" remove="all"/>
+    </value-type>
+
+    <value-type name="QDomEntity">
+        <modify-function signature="nodeType()const" remove="all"/>
+        <modify-function signature="operator=(QDomEntity)" remove="all"/>
+    </value-type>
+
+    <value-type name="QDomEntityReference">
+        <modify-function signature="nodeType()const" remove="all"/>
+        <modify-function signature="operator=(QDomEntityReference)" remove="all"/>
+    </value-type>
+
+    <value-type name="QDomImplementation">
+        <modify-function signature="operator=(QDomImplementation)" remove="all"/>
+    </value-type>
+
+    <value-type name="QDomNamedNodeMap">
+        <modify-function signature="operator=(QDomNamedNodeMap)" remove="all"/>
+    </value-type>
+
+    <value-type name="QDomNode">
+        <modify-function signature="operator=(QDomNode)" remove="all"/>
+        <modify-function signature="attributes()const" remove="all" />
+    </value-type>
+
+    <value-type name="QDomNodeList">
+        <modify-function signature="operator=(const QDomNodeList &amp;)" remove="all"/>
+    </value-type>
+
+    <value-type name="QDomNotation">
+        <modify-function signature="nodeType()const" remove="all"/>
+        <modify-function signature="operator=(QDomNotation)" remove="all"/>
+    </value-type>
+
+    <value-type name="QDomProcessingInstruction">
+        <modify-function signature="nodeType()const" remove="all"/>
+        <modify-function signature="operator=(QDomProcessingInstruction)" remove="all"/>
+    </value-type>
+
+    <value-type name="QDomText">
+        <modify-function signature="nodeType()const" remove="all"/>
+        <modify-function signature="operator=(const QDomText &amp;)" remove="all"/>
+    </value-type>
+
+    <value-type name="QXmlParseException" />
+
+    <value-type name="QXmlStreamAttribute">
+        <modify-function signature="operator=(QXmlStreamAttribute)" remove="all"/>
+    </value-type>
+
+    <value-type name="QXmlStreamAttributes">
+        <modify-function signature="operator+(QVector&lt;QXmlStreamAttribute>)const" remove="all"/>
+        <modify-function signature="operator&lt;&lt;(QVector&lt;QXmlStreamAttribute>)" remove="all"/>
+        <modify-function signature="operator&lt;&lt;(QXmlStreamAttribute)" remove="all"/>
+        <modify-function signature="push_back(QXmlStreamAttribute)" remove="all"/>
+        <modify-function signature="pop_back()" remove="all"/>
+        <modify-function signature="push_front(QXmlStreamAttribute)" remove="all"/>
+        <modify-function signature="pop_front()" remove="all"/>
+
+        <modify-function signature="value(const QString &amp;, const QLatin1String &amp;)const">
+            <remove />
+        </modify-function>
+        <modify-function signature="value(const QLatin1String &amp;, const QLatin1String &amp;)const">
+            <remove />
+        </modify-function>
+        <modify-function signature="value(const QLatin1String &amp;)const">
+            <remove />
+        </modify-function>
+    </value-type>
+
+    <value-type name="QXmlStreamNamespaceDeclaration">
+        <modify-function signature="operator=(QXmlStreamNamespaceDeclaration)" remove="all"/>
+    </value-type>
+
+    <value-type name="QXmlStreamNotationDeclaration">
+        <modify-function signature="operator=(QXmlStreamNotationDeclaration)" remove="all"/>
+    </value-type>
+
+    <value-type name="QXmlStreamEntityDeclaration">
+        <modify-function signature="operator=(QXmlStreamEntityDeclaration)" remove="all"/>
+    </value-type>
+
+    <value-type name="QXmlAttributes">
+      <modify-function signature="index(const QLatin1String&amp;) const">
+        <remove/>
+      </modify-function>
+      <modify-function signature="value(const QLatin1String&amp;) const">
+        <remove/>
+      </modify-function>
+    </value-type>
+
+    <value-type name="QXmlNamespaceSupport">
+        <custom-constructor>
+            QXmlNamespaceSupport *clone = new QXmlNamespaceSupport;
+            clone->setPrefix("", copy->uri(""));
+
+            QStringList prefixes = copy->prefixes();
+            for (int i=0; i&lt;prefixes.size(); ++i)
+                clone->setPrefix(prefixes.at(i), copy->uri(prefixes.at(i)));
+
+            return clone;
+        </custom-constructor>
+        <custom-destructor>
+            delete (QXmlNamespaceSupport *)copy;
+        </custom-destructor>
+
+
+    </value-type>
+
+    <value-type name="QDomElement">
+        <modify-function signature="nodeType()const" remove="all"/>
+        <modify-function signature="operator=(QDomElement)" remove="all"/>
+
+        <modify-function signature="setAttribute(const QString &amp;, unsigned int)">
+            <remove />
+        </modify-function>
+        <modify-function signature="setAttribute(const QString &amp;, unsigned long long)">
+            <remove />
+        </modify-function>
+        <modify-function signature="setAttributeNS(const QString, const QString &amp;, unsigned int)">
+            <remove />
+        </modify-function>
+        <modify-function signature="setAttributeNS(const QString, const QString &amp;, unsigned long long)">
+            <remove />
+        </modify-function>
+
+    </value-type>
+
+    <interface-type name="QXmlContentHandler">
+        <modify-function signature="setDocumentLocator(QXmlLocator*)">
+            <modify-argument index="1">
+                <define-ownership class="shell" owner="c++" />
+            </modify-argument>
+        </modify-function>
+    </interface-type>
+    <interface-type name="QXmlDTDHandler" />
+    <interface-type name="QXmlDeclHandler" />
+    <interface-type name="QXmlEntityResolver" />
+    <interface-type name="QXmlErrorHandler" />
+    <interface-type name="QXmlLexicalHandler" />
+
+    <object-type name="QXmlDefaultHandler">
+        <modify-function signature="setDocumentLocator(QXmlLocator*)">
+            <modify-argument index="1">
+                <define-ownership class="shell" owner="c++" />
+            </modify-argument>
+        </modify-function>
+    </object-type>
+    <object-type name="QXmlInputSource" />
+    <object-type name="QXmlLocator" />
+    <object-type name="QXmlSimpleReader">
+        <modify-function signature="parse(const QXmlInputSource*,bool)">
+            <modify-argument index="1" invalidate-after-use="yes" />
+        </modify-function>
+
+        <modify-function signature="setContentHandler(QXmlContentHandler*)">
+            <modify-argument index="1">
+                <reference-count action="set" variable-name="__rcContentHandler" />
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="setDTDHandler(QXmlDTDHandler*)">
+            <modify-argument index="1">
+                <reference-count action="set" variable-name="__rcDTDHandler" />
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="setDeclHandler(QXmlDeclHandler*)">
+            <modify-argument index="1">
+                <reference-count action="set" variable-name="__rcDeclHandler" />
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="setEntityResolver(QXmlEntityResolver*)">
+            <modify-argument index="1">
+                <reference-count action="set" variable-name="__rcEntityResolver" />
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="setErrorHandler(QXmlErrorHandler*)">
+            <modify-argument index="1">
+                <reference-count action="set" variable-name="__rcErrorHandler" />
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="setLexicalHandler(QXmlLexicalHandler*)">
+            <modify-argument index="1">
+                <reference-count action="set" variable-name="__rcLexicalHandler" />
+            </modify-argument>
+        </modify-function>
+    </object-type>
+
+    <object-type name="QXmlStreamReader">
+      <modify-function signature="QXmlStreamReader(const char*)" remove="all" />
+      <modify-function signature="addData(const char*)" remove="all" />
+      <modify-function signature="setEntityResolver(QXmlStreamEntityResolver*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcEntityResolver" />
+        </modify-argument>
+      </modify-function>
+    </object-type>
+    <object-type name="QXmlStreamWriter">
+        <modify-function signature="QXmlStreamWriter(QString *)">
+            <remove />
+        </modify-function>
+    </object-type>
+
+    <object-type name="QXmlReader">
+        <modify-function signature="parse(const QXmlInputSource*)">
+            <modify-argument index="1" invalidate-after-use="yes" />
+        </modify-function>
+    </object-type>
+
+</typesystem>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/typesystem_xml-java.java	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,136 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+package generator;
+
+import qt.*;
+import qt.xml.*;
+
+class QDomDocument___ extends QDomDocument {
+
+    public class Result {
+        private Result(boolean success, QNativePointer errorMessage, QNativePointer errorLine, QNativePointer errorColumn) {
+            this.success = success;
+            this.errorMessage = errorMessage.stringValue();
+            this.errorLine = errorLine.intValue();
+            this.errorColumn = errorColumn.intValue();
+        }
+
+        public boolean success;
+        public String errorMessage;
+        public int errorLine;
+        public int errorColumn;
+
+    }
+
+}// class
+
+class QXmlNamespaceSupport___ extends QXmlNamespaceSupport {
+
+    public static class ProcessedName {
+        public ProcessedName(String nsuri, String localName) {
+            this.nsuri = nsuri;
+            this.localName = localName;
+        }
+
+        public String nsuri;
+        public String localName;
+    }
+
+    public final ProcessedName processName(String qname, boolean isAttribute) {
+        QNativePointer nsUri = new QNativePointer(QNativePointer.Type.String);
+        QNativePointer localName = new QNativePointer(QNativePointer.Type.String);
+        processName(qname, isAttribute, nsUri, localName);
+
+        return new ProcessedName(nsUri.stringValue(), localName.stringValue());
+    }
+
+    public static class SplitName {
+        public SplitName(String prefix, String localname) {
+            this.prefix = prefix;
+            this.localname = localname;
+        }
+
+        public String prefix;
+        public String localname;
+    }
+
+    public final SplitName splitName(String qname) {
+        QNativePointer prefix = new QNativePointer(QNativePointer.Type.String);
+        QNativePointer localName = new QNativePointer(QNativePointer.Type.String);
+        splitName(qname, prefix, localName);
+
+        return new SplitName(prefix.stringValue(), localName.stringValue());
+    }
+
+}// class
+
+class QXmlStreamWriter___ extends QXmlStreamWriter {
+
+    public QXmlStreamWriter(qt.core.QByteArray array) {
+        this(array.nativePointer());
+        __rcDevice = array;
+    }
+
+    public final void setCodec(String codecName) {
+        setCodec(QNativePointer.createCharPointer(codecName));
+        __rcCodec = null;
+    }
+
+}// class
+
+interface QXmlEntityResolver___ extends QXmlEntityResolver {
+
+    public static class ResolvedEntity {
+
+        public boolean error;
+        public QXmlInputSource inputSource;
+
+        public ResolvedEntity(boolean error, QXmlInputSource inputSource) {
+
+            this.error = error;
+            this.inputSource = inputSource;
+
+        }
+
+    }
+
+}// class
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/typesystem_xml-java.xml	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,354 @@
+<?xml version="1.0"?>
+<typesystem package="qt.xml" default-superclass="qt.QtJambiObject">
+    <inject-code>
+        qt.Utilities.loadQtLibrary("QtXml");
+    </inject-code>
+
+
+    <value-type name="QDomDocument">
+        <inject-code>
+            <import-file name="typesystem_xml-java.java" quote-after-line="class QDomDocument___" quote-before-line="}// class"/>
+        </inject-code>
+        <extra-includes>
+            <include file-name="qt.QNativePointer.Type" location="java"/>
+            <include file-name="qt.core.QIODevice" location="java"/>
+            <include file-name="qt.core.QByteArray" location="java"/>
+        </extra-includes>
+
+
+
+        <template name="xml.domdocument_setContent">
+            public final Result setContent(%ARGUMENTS){
+                QNativePointer errorStr = new QNativePointer(Type.String);
+                QNativePointer errorLine = new QNativePointer(Type.Int);
+                QNativePointer errorColumn = new QNativePointer(Type.Int);
+
+                boolean success = setContent(%CALL_ARGUMENTS, errorStr, errorLine, errorColumn);
+                return new Result(success, errorStr, errorLine, errorColumn);
+            }
+        </template>
+
+        <!--bool setContent(QIODevice* dev, bool namespaceProcessing, QString *errorMsg=0, int *errorLine=0, int *errorColumn=0 ); -->
+        <modify-function signature="setContent(QIODevice*, bool, QString*, int*, int*)">
+            <access modifier="private"/>
+            <modify-argument index="3">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="4">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="5">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+        <inject-code class="java">
+            <insert-template name="xml.domdocument_setContent">
+                <replace from="%ARGUMENTS" to="QIODevice dev, boolean namespaceProcessing"/>
+                <replace from="%CALL_ARGUMENTS" to="dev, namespaceProcessing"/>
+            </insert-template>
+        </inject-code>
+
+        <!--bool setContent(const QByteArray& text, bool namespaceProcessing, QString *errorMsg=0, int *errorLine=0, int *errorColumn=0 ); -->
+        <modify-function signature="setContent(QByteArray, bool, QString*, int*, int*)">
+            <access modifier="private"/>
+            <modify-argument index="3">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="4">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="5">
+                <remove-default-expression/>
+            </modify-argument>
+
+        </modify-function>
+        <inject-code class="java">
+            <insert-template name="xml.domdocument_setContent">
+                <replace from="%ARGUMENTS" to="QByteArray text, boolean namespaceProcessing"/>
+                <replace from="%CALL_ARGUMENTS" to="text, namespaceProcessing"/>
+            </insert-template>
+        </inject-code>
+
+        <!--bool setContent(const QString& text, bool namespaceProcessing, QString *errorMsg=0, int *errorLine=0, int *errorColumn=0 );-->
+        <modify-function signature="setContent(QString, bool, QString*, int*, int*)">
+            <access modifier="private"/>
+            <modify-argument index="3">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="4">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="5">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+        <inject-code class="java">
+            <insert-template name="xml.domdocument_setContent">
+                <replace from="%ARGUMENTS" to="String text, boolean namespaceProcessing"/>
+                <replace from="%CALL_ARGUMENTS" to="text, namespaceProcessing"/>
+            </insert-template>
+        </inject-code>
+
+        <modify-function signature="setContent(QXmlInputSource*,QXmlReader*,QString*,int*,int*)">
+            <access modifier="private"/>
+            <modify-argument index="3">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="4">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="5">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+        <inject-code>
+            <insert-template name="xml.domdocument_setContent">
+                <replace from="%ARGUMENTS" to="QXmlInputSource source, QXmlReader reader"/>
+                <replace from="%CALL_ARGUMENTS" to="source, reader"/>
+            </insert-template>
+        </inject-code>
+
+        <modify-function signature="setContent(QString,QString*,int*,int*)">
+            <access modifier="private"/>
+            <modify-argument index="2">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="3">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="4">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+        <inject-code>
+            <insert-template name="xml.domdocument_setContent">
+                <replace from="%ARGUMENTS" to="String text"/>
+                <replace from="%CALL_ARGUMENTS" to="text"/>
+            </insert-template>
+        </inject-code>
+
+        <modify-function signature="setContent(QByteArray,QString*,int*,int*)">
+            <access modifier="private"/>
+            <modify-argument index="2">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="3">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="4">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+        <inject-code>
+            <insert-template name="xml.domdocument_setContent">
+                <replace from="%ARGUMENTS" to="QByteArray buffer"/>
+                <replace from="%CALL_ARGUMENTS" to="buffer"/>
+            </insert-template>
+        </inject-code>
+
+        <modify-function signature="setContent(QIODevice*,QString*,int*,int*)">
+            <access modifier="private"/>
+            <modify-argument index="2">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="3">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="4">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+        <inject-code>
+            <insert-template name="xml.domdocument_setContent">
+                <replace from="%ARGUMENTS" to="QIODevice dev"/>
+                <replace from="%CALL_ARGUMENTS" to="dev"/>
+            </insert-template>
+        </inject-code>
+
+    </value-type>
+
+
+
+    <value-type name="QXmlNamespaceSupport">
+        <inject-code>
+            <import-file name="typesystem_xml-java.java" quote-after-line="class QXmlNamespaceSupport___" quote-before-line="}// class"/>
+        </inject-code>
+        <extra-includes>
+            <include file-name="qt.QNativePointer" location="java"/>
+        </extra-includes>
+        <modify-function signature="processName(QString,bool,QString&amp;,QString&amp;)const">
+            <access modifier="private"/>
+        </modify-function>
+
+
+        <modify-function signature="splitName(QString,QString&amp;,QString&amp;)const">
+            <access modifier="private"/>
+        </modify-function>
+
+    </value-type>
+
+    <value-type name="QDomElement">
+
+        <template name="xml.constQString_to_constQStringRef">
+            QString %out = qtjambi_to_qstring(__jni_env, (jstring) %in);
+        </template>
+
+        <modify-function signature="attributeNS(const QString, const QString &amp;, const QString &amp;) const">
+            <modify-argument index="1">
+                <conversion-rule class="native">
+                    <insert-template name="xml.constQString_to_constQStringRef"/>
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="setAttributeNS(const QString, const QString &amp;, const QString &amp;)">
+            <modify-argument index="1">
+                <conversion-rule class="native">
+                    <insert-template name="xml.constQString_to_constQStringRef"/>
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="setAttributeNS(const QString, const QString &amp;, int)">
+            <modify-argument index="1">
+                <conversion-rule class="native">
+                    <insert-template name="xml.constQString_to_constQStringRef"/>
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="setAttributeNS(const QString, const QString &amp;, uint)">
+            <modify-argument index="1">
+                <conversion-rule class="native">
+                    <insert-template name="xml.constQString_to_constQStringRef"/>
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="setAttributeNS(const QString, const QString &amp;, long long)">
+            <modify-argument index="1">
+                <conversion-rule class="native">
+                    <insert-template name="xml.constQString_to_constQStringRef"/>
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="setAttributeNS(const QString, const QString &amp;, unsigned long long)">
+            <modify-argument index="1">
+                <conversion-rule class="native">
+                    <insert-template name="xml.constQString_to_constQStringRef"/>
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="setAttributeNS(const QString, const QString &amp;, double)">
+            <modify-argument index="1">
+                <conversion-rule class="native">
+                    <insert-template name="xml.constQString_to_constQStringRef"/>
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+    </value-type>
+    <object-type name="QXmlStreamReader">
+        <modify-function signature="setDevice(QIODevice*)">
+            <modify-argument index="1">
+                <reference-count action="set" variable-name="__rcDevice"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="clear()">
+            <inject-code class="java" position="end">
+                __rcDevice = null; // clear() call removes device from stream
+            </inject-code>
+        </modify-function>
+    </object-type>
+
+    <object-type name="QXmlStreamWriter">
+        <inject-code>
+            <import-file name="typesystem_xml-java.java" quote-after-line="class QXmlStreamWriter___" quote-before-line="}// class"/>
+        </inject-code>
+        <modify-function signature="QXmlStreamWriter(QByteArray *)">
+            <access modifier="private"/>
+        </modify-function>
+
+        <modify-function signature="setCodec(const char *)">
+            <access modifier="private"/>
+        </modify-function>
+
+        <modify-function signature="setCodec(QTextCodec*)">
+            <modify-argument index="1">
+                <reference-count action="set" variable-name="__rcCodec"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="setDevice(QIODevice*)">
+            <modify-argument index="1">
+                <reference-count action="set" variable-name="__rcDevice"/>
+            </modify-argument>
+        </modify-function>
+    </object-type>
+
+    <object-type name="QXmlReader">
+        <modify-function signature="parse(const QXmlInputSource &amp;)">
+            <remove class="java"/>
+        </modify-function>
+
+        <modify-function signature="property(QString,bool*)const">
+            <remove class="java"/>
+        </modify-function>
+        <modify-function signature="setProperty(QString,void*)">
+            <remove class="java"/>
+        </modify-function>
+
+        <modify-function signature="feature(QString,bool*)const">
+            <modify-argument index="2">
+                <remove-argument/>
+                <conversion-rule class="shell">
+                    // nothing
+                </conversion-rule>
+                <conversion-rule class="native">
+                    bool *%out = 0;
+                </conversion-rule>
+            </modify-argument>
+
+            <modify-argument index="0">
+                <conversion-rule class="shell">
+                    bool %out = (bool) %in;
+                    if (%2 != 0) *%2 = hasFeature(%1);
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+    </object-type>
+
+    <interface-type name="QXmlEntityResolver">
+        <inject-code>
+            <import-file name="typesystem_xml-java.java" quote-after-line="interface QXmlEntityResolver___" quote-before-line="}// class"/>
+        </inject-code>
+        <modify-function signature="resolveEntity(QString,QString,QXmlInputSource&amp;*)">
+            <modify-argument index="3">
+                <remove-argument/>
+                <conversion-rule class="shell">
+                    // nothing
+                </conversion-rule>
+                <conversion-rule class="native">
+                    QXmlInputSource *inputSourceHolder = 0;
+                    QXmlInputSource *&amp;%out = inputSourceHolder;
+                </conversion-rule>
+            </modify-argument>
+            <modify-argument index="return">
+                <replace-type modified-type="qt.xml.QXmlEntityResolver$ResolvedEntity" />
+                <conversion-rule class="native">
+                    jobject %out = qtjambi_to_resolvedentity(__jni_env, %in, inputSourceHolder);
+                </conversion-rule>
+                <conversion-rule class="shell">
+                    bool %out = qtjambi_from_resolvedentity(__jni_env, (void *&amp;) %3, %in);
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+    </interface-type>
+
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QDomNodeList' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QXmlStreamNamespaceDeclaration' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QDomNamedNodeMap' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QXmlStreamNotationDeclaration' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QDomNode' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QDomImplementation' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QXmlStreamAttribute' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QXmlStreamAttributes' has equals operators but no qHash() function"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QXmlStreamEntityDeclaration' has equals operators but no qHash() function"/>
+
+</typesystem>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/typesystem_xml.xml	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,610 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?xml-stylesheet type="text/xsl" href="merge.xsl"?>
+
+<typesystem package="qt.xml" default-superclass="qt.QtJambiObject">
+<inject-code>
+        qt.Utilities.loadQtLibrary("QtXml");
+    </inject-code>
+<suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QDomNodeList' has equals operators but no qHash() function"/>
+<suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QXmlStreamNamespaceDeclaration' has equals operators but no qHash() function"/>
+<suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QDomNamedNodeMap' has equals operators but no qHash() function"/>
+<suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QXmlStreamNotationDeclaration' has equals operators but no qHash() function"/>
+<suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QDomNode' has equals operators but no qHash() function"/>
+<suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QDomImplementation' has equals operators but no qHash() function"/>
+<suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QXmlStreamAttribute' has equals operators but no qHash() function"/>
+<suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QXmlStreamAttributes' has equals operators but no qHash() function"/>
+<suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QXmlStreamEntityDeclaration' has equals operators but no qHash() function"/>
+    <rejection class="QXmlAttributes::Attribute"/>
+    <rejection class="QDomNode" field-name="impl"/>
+
+    <enum-type name="QDomNode::NodeType"/>
+    <enum-type name="QDomNode::EncodingPolicy"/>
+    <enum-type name="QDomImplementation::InvalidDataPolicy"/>
+    <enum-type name="QXmlStreamReader::Error"/>
+    <enum-type name="QXmlStreamReader::TokenType"/>
+
+
+    <value-type name="QDomAttr">
+        <modify-function signature="operator=(QDomAttr)" remove="all"/>
+        <modify-function signature="nodeType()const" remove="all"/>
+    </value-type>
+
+    <value-type name="QDomCDATASection">
+        <modify-function signature="operator=(QDomCDATASection)" remove="all"/>
+        <modify-function signature="nodeType()const" remove="all"/>
+    </value-type>
+
+    <value-type name="QDomCharacterData">
+        <modify-function signature="operator=(QDomCharacterData)" remove="all"/>
+        <modify-function signature="nodeType()const" remove="all"/>
+    </value-type>
+
+    <value-type name="QDomComment">
+        <modify-function signature="operator=(QDomComment)" remove="all"/>
+        <modify-function signature="nodeType()const" remove="all"/>
+    </value-type>
+
+    <value-type name="QDomDocument">
+        <modify-function signature="nodeType()const" remove="all"/>
+        <modify-function signature="operator=(QDomDocument)" remove="all"/>
+
+        <!--bool setContent(QIODevice* dev, bool namespaceProcessing, QString *errorMsg=0, int *errorLine=0, int *errorColumn=0 ); -->
+        <modify-function signature="setContent(QIODevice*, bool, QString*, int*, int*)">
+            <modify-argument index="1">
+                <reference-count action="set" variable-name="__rcContent"/>
+            </modify-argument>
+        </modify-function>
+
+
+        <modify-function signature="setContent(QXmlInputSource*,QXmlReader*,QString*,int*,int*)">
+            <modify-argument index="1">
+                <reference-count action="set" variable-name="__rcContent"/>
+            </modify-argument>
+        </modify-function>
+
+        <modify-function signature="setContent(QIODevice*,QString*,int*,int*)">
+            <modify-argument index="1">
+                <reference-count action="set" variable-name="__rcContent"/>
+            </modify-argument>
+        </modify-function>
+
+    
+        <inject-code>
+            <import-file name="typesystem_xml-java.java" quote-after-line="class QDomDocument___" quote-before-line="}// class"/>
+        </inject-code>
+        <extra-includes>
+            <include file-name="qt.QNativePointer.Type" location="java"/>
+            <include file-name="qt.core.QIODevice" location="java"/>
+            <include file-name="qt.core.QByteArray" location="java"/>
+        </extra-includes>
+
+
+
+        <template name="xml.domdocument_setContent">
+            public final Result setContent(%ARGUMENTS){
+                QNativePointer errorStr = new QNativePointer(Type.String);
+                QNativePointer errorLine = new QNativePointer(Type.Int);
+                QNativePointer errorColumn = new QNativePointer(Type.Int);
+
+                boolean success = setContent(%CALL_ARGUMENTS, errorStr, errorLine, errorColumn);
+                return new Result(success, errorStr, errorLine, errorColumn);
+            }
+        </template>
+
+        <!--bool setContent(QIODevice* dev, bool namespaceProcessing, QString *errorMsg=0, int *errorLine=0, int *errorColumn=0 ); -->
+        <modify-function signature="setContent(QIODevice*, bool, QString*, int*, int*)">
+            <access modifier="private"/>
+            <modify-argument index="3">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="4">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="5">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+        <inject-code class="java">
+            <insert-template name="xml.domdocument_setContent">
+                <replace from="%ARGUMENTS" to="QIODevice dev, boolean namespaceProcessing"/>
+                <replace from="%CALL_ARGUMENTS" to="dev, namespaceProcessing"/>
+            </insert-template>
+        </inject-code>
+
+        <!--bool setContent(const QByteArray& text, bool namespaceProcessing, QString *errorMsg=0, int *errorLine=0, int *errorColumn=0 ); -->
+        <modify-function signature="setContent(QByteArray, bool, QString*, int*, int*)">
+            <access modifier="private"/>
+            <modify-argument index="3">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="4">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="5">
+                <remove-default-expression/>
+            </modify-argument>
+
+        </modify-function>
+        <inject-code class="java">
+            <insert-template name="xml.domdocument_setContent">
+                <replace from="%ARGUMENTS" to="QByteArray text, boolean namespaceProcessing"/>
+                <replace from="%CALL_ARGUMENTS" to="text, namespaceProcessing"/>
+            </insert-template>
+        </inject-code>
+
+        <!--bool setContent(const QString& text, bool namespaceProcessing, QString *errorMsg=0, int *errorLine=0, int *errorColumn=0 );-->
+        <modify-function signature="setContent(QString, bool, QString*, int*, int*)">
+            <access modifier="private"/>
+            <modify-argument index="3">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="4">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="5">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+        <inject-code class="java">
+            <insert-template name="xml.domdocument_setContent">
+                <replace from="%ARGUMENTS" to="String text, boolean namespaceProcessing"/>
+                <replace from="%CALL_ARGUMENTS" to="text, namespaceProcessing"/>
+            </insert-template>
+        </inject-code>
+
+        <modify-function signature="setContent(QXmlInputSource*,QXmlReader*,QString*,int*,int*)">
+            <access modifier="private"/>
+            <modify-argument index="3">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="4">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="5">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+        <inject-code>
+            <insert-template name="xml.domdocument_setContent">
+                <replace from="%ARGUMENTS" to="QXmlInputSource source, QXmlReader reader"/>
+                <replace from="%CALL_ARGUMENTS" to="source, reader"/>
+            </insert-template>
+        </inject-code>
+
+        <modify-function signature="setContent(QString,QString*,int*,int*)">
+            <access modifier="private"/>
+            <modify-argument index="2">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="3">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="4">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+        <inject-code>
+            <insert-template name="xml.domdocument_setContent">
+                <replace from="%ARGUMENTS" to="String text"/>
+                <replace from="%CALL_ARGUMENTS" to="text"/>
+            </insert-template>
+        </inject-code>
+
+        <modify-function signature="setContent(QByteArray,QString*,int*,int*)">
+            <access modifier="private"/>
+            <modify-argument index="2">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="3">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="4">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+        <inject-code>
+            <insert-template name="xml.domdocument_setContent">
+                <replace from="%ARGUMENTS" to="QByteArray buffer"/>
+                <replace from="%CALL_ARGUMENTS" to="buffer"/>
+            </insert-template>
+        </inject-code>
+
+        <modify-function signature="setContent(QIODevice*,QString*,int*,int*)">
+            <access modifier="private"/>
+            <modify-argument index="2">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="3">
+                <remove-default-expression/>
+            </modify-argument>
+            <modify-argument index="4">
+                <remove-default-expression/>
+            </modify-argument>
+        </modify-function>
+        <inject-code>
+            <insert-template name="xml.domdocument_setContent">
+                <replace from="%ARGUMENTS" to="QIODevice dev"/>
+                <replace from="%CALL_ARGUMENTS" to="dev"/>
+            </insert-template>
+        </inject-code>
+
+    </value-type>
+
+    <value-type name="QDomDocumentFragment">
+        <modify-function signature="nodeType()const" remove="all"/>
+        <modify-function signature="operator=(QDomDocumentFragment)" remove="all"/>
+    </value-type>
+
+    <value-type name="QDomDocumentType">
+        <modify-function signature="nodeType()const" remove="all"/>
+        <modify-function signature="operator=(QDomDocumentType)" remove="all"/>
+    </value-type>
+
+    <value-type name="QDomEntity">
+        <modify-function signature="nodeType()const" remove="all"/>
+        <modify-function signature="operator=(QDomEntity)" remove="all"/>
+    </value-type>
+
+    <value-type name="QDomEntityReference">
+        <modify-function signature="nodeType()const" remove="all"/>
+        <modify-function signature="operator=(QDomEntityReference)" remove="all"/>
+    </value-type>
+
+    <value-type name="QDomImplementation">
+        <modify-function signature="operator=(QDomImplementation)" remove="all"/>
+    </value-type>
+
+    <value-type name="QDomNamedNodeMap">
+        <modify-function signature="operator=(QDomNamedNodeMap)" remove="all"/>
+    </value-type>
+
+    <value-type name="QDomNode">
+        <modify-function signature="operator=(QDomNode)" remove="all"/>
+        <modify-function signature="attributes()const" remove="all"/>
+    </value-type>
+
+    <value-type name="QDomNodeList">
+        <modify-function signature="operator=(const QDomNodeList &amp;)" remove="all"/>
+    </value-type>
+
+    <value-type name="QDomNotation">
+        <modify-function signature="nodeType()const" remove="all"/>
+        <modify-function signature="operator=(QDomNotation)" remove="all"/>
+    </value-type>
+
+    <value-type name="QDomProcessingInstruction">
+        <modify-function signature="nodeType()const" remove="all"/>
+        <modify-function signature="operator=(QDomProcessingInstruction)" remove="all"/>
+    </value-type>
+
+    <value-type name="QDomText">
+        <modify-function signature="nodeType()const" remove="all"/>
+        <modify-function signature="operator=(const QDomText &amp;)" remove="all"/>
+    </value-type>
+
+    <value-type name="QXmlParseException"/>
+
+    <value-type name="QXmlStreamAttribute">
+        <modify-function signature="operator=(QXmlStreamAttribute)" remove="all"/>
+    </value-type>
+
+    <value-type name="QXmlStreamAttributes">
+        <modify-function signature="operator+(QVector&lt;QXmlStreamAttribute&gt;)const" remove="all"/>
+        <modify-function signature="operator&lt;&lt;(QVector&lt;QXmlStreamAttribute&gt;)" remove="all"/>
+        <modify-function signature="operator&lt;&lt;(QXmlStreamAttribute)" remove="all"/>
+        <modify-function signature="push_back(QXmlStreamAttribute)" remove="all"/>
+        <modify-function signature="pop_back()" remove="all"/>
+        <modify-function signature="push_front(QXmlStreamAttribute)" remove="all"/>
+        <modify-function signature="pop_front()" remove="all"/>
+
+        <modify-function signature="value(const QString &amp;, const QLatin1String &amp;)const">
+            <remove/>
+        </modify-function>
+        <modify-function signature="value(const QLatin1String &amp;, const QLatin1String &amp;)const">
+            <remove/>
+        </modify-function>
+        <modify-function signature="value(const QLatin1String &amp;)const">
+            <remove/>
+        </modify-function>
+    </value-type>
+
+    <value-type name="QXmlStreamNamespaceDeclaration">
+        <modify-function signature="operator=(QXmlStreamNamespaceDeclaration)" remove="all"/>
+    </value-type>
+
+    <value-type name="QXmlStreamNotationDeclaration">
+        <modify-function signature="operator=(QXmlStreamNotationDeclaration)" remove="all"/>
+    </value-type>
+
+    <value-type name="QXmlStreamEntityDeclaration">
+        <modify-function signature="operator=(QXmlStreamEntityDeclaration)" remove="all"/>
+    </value-type>
+
+    <value-type name="QXmlAttributes">
+      <modify-function signature="index(const QLatin1String&amp;) const">
+        <remove/>
+      </modify-function>
+      <modify-function signature="value(const QLatin1String&amp;) const">
+        <remove/>
+      </modify-function>
+    </value-type>
+
+    <value-type name="QXmlNamespaceSupport">
+        <custom-constructor>
+            QXmlNamespaceSupport *clone = new QXmlNamespaceSupport;
+            clone-&gt;setPrefix("", copy-&gt;uri(""));
+
+            QStringList prefixes = copy-&gt;prefixes();
+            for (int i=0; i&lt;prefixes.size(); ++i)
+                clone-&gt;setPrefix(prefixes.at(i), copy-&gt;uri(prefixes.at(i)));
+
+            return clone;
+        </custom-constructor>
+        <custom-destructor>
+            delete (QXmlNamespaceSupport *)copy;
+        </custom-destructor>
+
+
+    
+        <inject-code>
+            <import-file name="typesystem_xml-java.java" quote-after-line="class QXmlNamespaceSupport___" quote-before-line="}// class"/>
+        </inject-code>
+        <extra-includes>
+            <include file-name="qt.QNativePointer" location="java"/>
+        </extra-includes>
+        <modify-function signature="processName(QString,bool,QString&amp;,QString&amp;)const">
+            <access modifier="private"/>
+        </modify-function>
+
+
+        <modify-function signature="splitName(QString,QString&amp;,QString&amp;)const">
+            <access modifier="private"/>
+        </modify-function>
+
+    </value-type>
+
+    <value-type name="QDomElement">
+        <modify-function signature="nodeType()const" remove="all"/>
+        <modify-function signature="operator=(QDomElement)" remove="all"/>
+
+        <modify-function signature="setAttribute(const QString &amp;, unsigned int)">
+            <remove/>
+        </modify-function>
+        <modify-function signature="setAttribute(const QString &amp;, unsigned long long)">
+            <remove/>
+        </modify-function>
+        <modify-function signature="setAttributeNS(const QString, const QString &amp;, unsigned int)">
+            <remove/>
+        </modify-function>
+        <modify-function signature="setAttributeNS(const QString, const QString &amp;, unsigned long long)">
+            <remove/>
+        </modify-function>
+
+    
+
+        <template name="xml.constQString_to_constQStringRef">
+            QString %out = qtjambi_to_qstring(__jni_env, (jstring) %in);
+        </template>
+
+        <modify-function signature="attributeNS(const QString, const QString &amp;, const QString &amp;) const">
+            <modify-argument index="1">
+                <conversion-rule class="native">
+                    <insert-template name="xml.constQString_to_constQStringRef"/>
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="setAttributeNS(const QString, const QString &amp;, const QString &amp;)">
+            <modify-argument index="1">
+                <conversion-rule class="native">
+                    <insert-template name="xml.constQString_to_constQStringRef"/>
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="setAttributeNS(const QString, const QString &amp;, int)">
+            <modify-argument index="1">
+                <conversion-rule class="native">
+                    <insert-template name="xml.constQString_to_constQStringRef"/>
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="setAttributeNS(const QString, const QString &amp;, uint)">
+            <modify-argument index="1">
+                <conversion-rule class="native">
+                    <insert-template name="xml.constQString_to_constQStringRef"/>
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="setAttributeNS(const QString, const QString &amp;, long long)">
+            <modify-argument index="1">
+                <conversion-rule class="native">
+                    <insert-template name="xml.constQString_to_constQStringRef"/>
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="setAttributeNS(const QString, const QString &amp;, unsigned long long)">
+            <modify-argument index="1">
+                <conversion-rule class="native">
+                    <insert-template name="xml.constQString_to_constQStringRef"/>
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="setAttributeNS(const QString, const QString &amp;, double)">
+            <modify-argument index="1">
+                <conversion-rule class="native">
+                    <insert-template name="xml.constQString_to_constQStringRef"/>
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+    </value-type>
+
+    <interface-type name="QXmlContentHandler">
+        <modify-function signature="setDocumentLocator(QXmlLocator*)">
+            <modify-argument index="1">
+                <define-ownership class="shell" owner="c++"/>
+            </modify-argument>
+        </modify-function>
+    </interface-type>
+    <interface-type name="QXmlDTDHandler"/>
+    <interface-type name="QXmlDeclHandler"/>
+    <interface-type name="QXmlEntityResolver">
+        <inject-code>
+            <import-file name="typesystem_xml-java.java" quote-after-line="interface QXmlEntityResolver___" quote-before-line="}// class"/>
+        </inject-code>
+        <modify-function signature="resolveEntity(QString,QString,QXmlInputSource&amp;*)">
+            <modify-argument index="3">
+                <remove-argument/>
+                <conversion-rule class="shell">
+                    // nothing
+                </conversion-rule>
+                <conversion-rule class="native">
+                    QXmlInputSource *inputSourceHolder = 0;
+                    QXmlInputSource *&amp;%out = inputSourceHolder;
+                </conversion-rule>
+            </modify-argument>
+            <modify-argument index="return">
+                <replace-type modified-type="qt.xml.QXmlEntityResolver$ResolvedEntity"/>
+                <conversion-rule class="native">
+                    jobject %out = qtjambi_to_resolvedentity(__jni_env, %in, inputSourceHolder);
+                </conversion-rule>
+                <conversion-rule class="shell">
+                    bool %out = qtjambi_from_resolvedentity(__jni_env, (void *&amp;) %3, %in);
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+
+    </interface-type>
+    <interface-type name="QXmlErrorHandler"/>
+    <interface-type name="QXmlLexicalHandler"/>
+
+    <object-type name="QXmlDefaultHandler">
+        <modify-function signature="setDocumentLocator(QXmlLocator*)">
+            <modify-argument index="1">
+                <define-ownership class="shell" owner="c++"/>
+            </modify-argument>
+        </modify-function>
+    </object-type>
+    <object-type name="QXmlInputSource"/>
+    <object-type name="QXmlLocator"/>
+    <object-type name="QXmlSimpleReader">
+        <modify-function signature="parse(const QXmlInputSource*,bool)">
+            <modify-argument index="1" invalidate-after-use="yes"/>
+        </modify-function>
+
+        <modify-function signature="setContentHandler(QXmlContentHandler*)">
+            <modify-argument index="1">
+                <reference-count action="set" variable-name="__rcContentHandler"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="setDTDHandler(QXmlDTDHandler*)">
+            <modify-argument index="1">
+                <reference-count action="set" variable-name="__rcDTDHandler"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="setDeclHandler(QXmlDeclHandler*)">
+            <modify-argument index="1">
+                <reference-count action="set" variable-name="__rcDeclHandler"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="setEntityResolver(QXmlEntityResolver*)">
+            <modify-argument index="1">
+                <reference-count action="set" variable-name="__rcEntityResolver"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="setErrorHandler(QXmlErrorHandler*)">
+            <modify-argument index="1">
+                <reference-count action="set" variable-name="__rcErrorHandler"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="setLexicalHandler(QXmlLexicalHandler*)">
+            <modify-argument index="1">
+                <reference-count action="set" variable-name="__rcLexicalHandler"/>
+            </modify-argument>
+        </modify-function>
+    </object-type>
+
+    <object-type name="QXmlStreamReader">
+      <modify-function signature="QXmlStreamReader(const char*)" remove="all"/>
+      <modify-function signature="addData(const char*)" remove="all"/>
+      <modify-function signature="setEntityResolver(QXmlStreamEntityResolver*)">
+        <modify-argument index="1">
+            <reference-count action="set" variable-name="__rcEntityResolver"/>
+        </modify-argument>
+      </modify-function>
+    
+        <modify-function signature="setDevice(QIODevice*)">
+            <modify-argument index="1">
+                <reference-count action="set" variable-name="__rcDevice"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="clear()">
+            <inject-code class="java" position="end">
+                __rcDevice = null; // clear() call removes device from stream
+            </inject-code>
+        </modify-function>
+    </object-type>
+    <object-type name="QXmlStreamWriter">
+        <modify-function signature="QXmlStreamWriter(QString *)">
+            <remove/>
+        </modify-function>
+    
+        <inject-code>
+            <import-file name="typesystem_xml-java.java" quote-after-line="class QXmlStreamWriter___" quote-before-line="}// class"/>
+        </inject-code>
+        <modify-function signature="QXmlStreamWriter(QByteArray *)">
+            <access modifier="private"/>
+        </modify-function>
+
+        <modify-function signature="setCodec(const char *)">
+            <access modifier="private"/>
+        </modify-function>
+
+        <modify-function signature="setCodec(QTextCodec*)">
+            <modify-argument index="1">
+                <reference-count action="set" variable-name="__rcCodec"/>
+            </modify-argument>
+        </modify-function>
+        <modify-function signature="setDevice(QIODevice*)">
+            <modify-argument index="1">
+                <reference-count action="set" variable-name="__rcDevice"/>
+            </modify-argument>
+        </modify-function>
+    </object-type>
+
+    <object-type name="QXmlReader">
+        <modify-function signature="parse(const QXmlInputSource*)">
+            <modify-argument index="1" invalidate-after-use="yes"/>
+        </modify-function>
+    
+        <modify-function signature="parse(const QXmlInputSource &amp;)">
+            <remove class="java"/>
+        </modify-function>
+
+        <modify-function signature="property(QString,bool*)const">
+            <remove class="java"/>
+        </modify-function>
+        <modify-function signature="setProperty(QString,void*)">
+            <remove class="java"/>
+        </modify-function>
+
+        <modify-function signature="feature(QString,bool*)const">
+            <modify-argument index="2">
+                <remove-argument/>
+                <conversion-rule class="shell">
+                    // nothing
+                </conversion-rule>
+                <conversion-rule class="native">
+                    bool *%out = 0;
+                </conversion-rule>
+            </modify-argument>
+
+            <modify-argument index="0">
+                <conversion-rule class="shell">
+                    bool %out = (bool) %in;
+                    if (%2 != 0) *%2 = hasFeature(%1);
+                </conversion-rule>
+            </modify-argument>
+        </modify-function>
+    </object-type>
+
+</typesystem>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/typesystem_xmlpatterns-common.xml	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,181 @@
+<?xml version="1.0"?>
+<typesystem>
+
+
+  <namespace-type name="QPatternist"/>
+  <namespace-type name="QPatternistSDK"/>
+
+  <enum-type name="QXmlNodeModelIndex::NodeKind"/>
+  <enum-type name="QXmlNodeModelIndex::DocumentOrder"/>
+  <enum-type name="QAbstractXmlNodeModel::NodeCopySetting"/>
+  <enum-type name="QAbstractXmlNodeModel::SimpleAxis"/>
+
+  <object-type name="QAbstractMessageHandler">
+    <modify-function signature="QAbstractMessageHandler(QObject*)" remove="all" />
+  </object-type>
+  <object-type name="QAbstractUriResolver"/>
+  <object-type name="QAbstractXmlForwardIterator"/>
+
+  <rejection class="QPatternist::NodeIndexStorage" />
+  <rejection class="QAbstractXmlNodeModel" function-name="mapToItem" />
+  <rejection class="QAbstractXmlNodeModel" function-name="mapToSequence" />
+  <rejection class="QAbstractXmlNodeModel" function-name="sequencedTypedValue" />
+  <rejection class="QAbstractXmlNodeModel" function-name="sendNamespaces" />
+  <rejection class="QAbstractXmlNodeModel" function-name="iterate" />
+  <rejection class="QAbstractXmlNodeModel" function-name="copyNodeTo" />
+  <rejection class="QAbstractXmlNodeModel" function-name="type" />
+  <value-type name="QAbstractXmlNodeModel">
+    <modify-function signature="QAbstractXmlNodeModel()" remove="all" />
+    <modify-function signature="namespaceForPrefix(QXmlNodeModelIndex,short) const"
+             remove="all" />
+    <modify-function signature="isDeepEqual(QXmlNodeModelIndex,QXmlNodeModelIndex) const"
+             remove="all" />
+  </value-type>
+
+  <rejection class="QAbstractXmlReceiver" function-name="item" />
+  <rejection class="QAbstractXmlReceiver" function-name="sendAsNode" />
+  <value-type name="QAbstractXmlReceiver">
+  </value-type>
+
+  <value-type name="QSimpleXmlNodeModel" />
+
+  <value-type name="QSourceLocation">
+    <modify-function signature="operator=(QSourceLocation)" remove="all" />
+  </value-type>
+
+  <rejection class="QXmlFormatter" function-name="item" />
+  <object-type name="QXmlFormatter">
+    <modify-function signature="startFormattingContent()" remove="all" />
+  </object-type>
+
+  <value-type name="QXmlItem">
+    <modify-function signature="operator=(QXmlItem)" remove="all" />
+  </value-type>
+
+  <value-type name="QXmlName">
+    <modify-function signature="QXmlName(QXmlNamePool&amp;,QString,QString,QString)" access="private">
+      <modify-argument index="3">
+    <remove-default-expression />
+      </modify-argument>
+      <modify-argument index="4">
+    <remove-default-expression />
+      </modify-argument>
+    </modify-function>
+
+    <modify-function signature="operator=(QXmlName)" remove="all" />
+    <modify-function signature="QXmlName(short,short,short)"
+             remove="all" />
+    <modify-function signature="localName()const" remove="all" />
+    <modify-function signature="prefix()const" remove="all" />
+    <modify-function signature="hasPrefix()const" remove="all" />
+    <modify-function signature="hasNamespace()const" remove="all" />
+    <modify-function signature="namespaceURI()const" remove="all" />
+    <modify-function signature="isLexicallyEqual(const QXmlName)const" remove="all" />
+    <modify-function signature="setPrefix(const short)" remove="all" />
+    <modify-function signature="setNamespaceURI(const short)" remove="all" />
+    <modify-function signature="setLocalName(const short)" remove="all" />
+    <modify-function signature="code()const" remove="all" />
+  </value-type>
+
+  <value-type name="QXmlNamePool">
+    <modify-function signature="operator=(QXmlNamePool)" remove="all" />
+  </value-type>
+
+  <rejection class="QXmlNodeModelIndex" function-name="sequencedTypedValue" />
+  <rejection class="QXmlNodeModelIndex" function-name="sendNamespaces" />
+  <rejection class="QXmlNodeModelIndex" function-name="iterate" />
+  <rejection class="QXmlNodeModelIndex" function-name="type" />
+  <rejection class="QXmlNodeModelIndex" enum-name="Axis" />
+  <value-type name="QXmlNodeModelIndex">
+    <modify-function signature="name() const" remove="all" />
+    <modify-function signature="root() const" remove="all" />
+    <modify-function signature="documentUri() const" remove="all" />
+    <modify-function signature="baseUri() const" remove="all" />
+    <modify-function signature="kind() const" remove="all" />
+    <modify-function signature="isDeepEqual(QXmlNodeModelIndex) const" remove="all" />
+    <modify-function signature="compareOrder(QXmlNodeModelIndex) const" remove="all" />
+    <modify-function signature="namespaceBindings() const" remove="all" />
+    <modify-function signature="namespaceForPrefix(short) const" remove="all" />
+    <modify-function signature="stringValue() const" remove="all" />
+    <modify-function signature="is(QXmlNodeModelIndex) const" remove="all" />
+    <modify-function signature="reset()" remove="all" />
+    <modify-function signature="internalPointer()const" remove="all" />
+
+    <modify-function signature="model()const">
+      <access modifier="private"/>
+      <rename to="model_private" />
+    </modify-function>
+  </value-type>
+
+  <value-type name="QXmlSerializerPointer"/>
+
+  <object-type name="QXmlQuery">
+    <modify-function signature="evaluateTo(QAbstractXmlReceiver *)const" remove="all" />
+    <modify-function signature="evaluateTo(QStringList&lt;QString&gt;*)const" remove="all" />
+    <modify-function signature="setMessageHandler(QAbstractMessageHandler*)">
+      <modify-argument index="1">
+    <reference-count action="set" variable-name="__rcMessageHandler" />
+      </modify-argument>
+    </modify-function>
+    <modify-function signature="setQuery(QIODevice*, QUrl)">
+      <modify-argument index="1">
+    <reference-count action="ignore" /> <!-- Data from IODevice is readAll()'d immediately and the pointer is not stored -->
+      </modify-argument>
+    </modify-function>
+    <modify-function signature="setUriResolver(const QAbstractUriResolver*)">
+      <modify-argument index="1">
+    <reference-count action="set" variable-name="__rcUriResolver" />
+      </modify-argument>
+    </modify-function>
+  </object-type>
+  <object-type name="QXmlResultItems"/>
+
+  <rejection class="QXmlSerializer" function-name="item" />
+  <object-type name="QXmlSerializer">
+    <modify-function signature="atDocumentRoot()const" remove="all" />
+    <modify-function signature="startContent()" remove="all" />
+    <modify-function signature="writeEscaped(QString)" remove="all" />
+    <modify-function signature="writeEscapedAttribute(QString)" remove="all" />
+    <modify-function signature="write(QString)" remove="all" />
+    <modify-function signature="write(QXmlName)" remove="all" />
+    <modify-function signature="write(const char *)" remove="all" />
+    <modify-function signature="isBindingInScope(QXmlName)const" remove="all" />
+    <modify-function signature="setCodec(const QTextCodec *)">
+      <modify-argument index="1">
+    <reference-count action="set" variable-name="__rcCodec" />
+      </modify-argument>
+    </modify-function>
+  </object-type>
+
+
+
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: horribly broken type ''"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: template baseclass 'QExplicitlySharedDataPointer&lt;QXmlSerializer&gt;' of 'QXmlSerializerPointer' is not known" />
+
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QXmlItem::QXmlItem', unmatched parameter type 'QPatternist::Item const&amp;'" />
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QXmlNodeModelIndex::sequencedTypedValue', unmatched return type 'QExplicitlySharedDataPointer&lt;QAbstractXmlForwardIterator&lt;QPatternist::Item&gt;&gt;"/>
+
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QXmlNodeModelIndex::QXmlNodeModelIndex', unmatched parameter type 'QPatternist::NodeIndexStorage const&amp;'" />
+
+  <!-- To avoid warnings when running the generator on systems without XML patterns -->
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QSimpleXmlNodeModel' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QXmlSerializerPointer' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QSourceLocation' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QXmlFormatter' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QAbstractUriResolver' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QAbstractXmlReceiver' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.xmlpatterns.QXmlNodeModelIndex' for enum 'DocumentOrder' is not declared"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QXmlQuery' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QXmlName' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.xmlpatterns.QAbstractXmlNodeModel' for enum 'NodeCopySetting' is not declared"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QXmlSerializer' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QAbstractXmlNodeModel' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QXmlItem' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QXmlNodeModelIndex' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QXmlResultItems' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QAbstractMessageHandler' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.xmlpatterns.QXmlNodeModelIndex' for enum 'NodeKind' is not declared"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.xmlpatterns.QAbstractXmlNodeModel' for enum 'SimpleAxis' is not declared"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QXmlNamePool' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+
+</typesystem>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/typesystem_xmlpatterns-java.java	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,110 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+package generator;
+
+import qt.QtBlockedSlot;
+import qt.xmlpatterns.QAbstractXmlNodeModel;
+import qt.xmlpatterns.QXmlNodeModelIndex;
+
+class QXmlNodeModelIndex___ extends QXmlNodeModelIndex {
+    @QtBlockedSlot
+    public final QAbstractXmlNodeModel model() {
+        return QAbstractXmlNodeModel.fromNativePointer(model_private());
+    }
+}// class
+
+class QXmlName___ extends QXmlName {
+
+      /**
+       * Constructs a <code>QXmlName</code> instance that inserts <code>localName</code>,
+       * <code>namespaceURI</code> and <code>prefix</code> into <code>namePool</code> if they aren't
+       * already there. The accessor functions <code>namespaceUri()</code>, <code>prefix()</code>,
+       * <code>localName()</code>, and <code>toClarkName()</code> must be passed the <code>namePool</code>
+       * used here, so the <code>namePool</code> must remain in scope while the
+       * accessor functions might be used. However, two instances can
+       * be compared with <code>==</code> or <code>!=</code> and copied without the
+       * <code>namePool</code>.
+       *
+       * The user guarantees that the string components are valid for a
+       * <code>QName</code>. In particular, the local name, and the prefix (if present),
+       * must be valid {@link <a href="http://www.w3.org/TR/REC-xml-names/#NT-NCName">NCNames</a>}
+       * The function <code>isNCName()</code> can be used to test validity
+       * of these names. The namespace URI should be an absolute URI.
+       * <code>QUrl.isRelative()</code> can be used to test whether the namespace URI
+       * is relative or absolute. Finally, providing a prefix is not valid
+       * when no namespace URI is provided.
+       *
+       * <code>namePool</code> is not copied. Nor is the reference to it retained
+       * in this instance. This constructor inserts the three strings
+       * into <code>namePool</code>.
+       */
+      public QXmlName(QXmlNamePool namePool, String localName, String namespaceURI, String prefix) {
+          this(namePool.nativePointer(), localName, namespaceURI, prefix);
+      }
+
+      /**
+       * Equivalent to calling QXmlName(namePool, localName, namespaceURI, null);
+       */
+      public QXmlName(QXmlNamePool namePool, String localName, String namespaceURI) {
+          this(namePool, localName, namespaceURI, null);
+      }
+
+      /**
+       * Equivalent to calling QXmlName(namePool, localName, null, null)
+       */
+      public QXmlName(QXmlNamePool namePool, String localName) {
+          this(namePool, localName, null);
+      }
+
+
+}// class
+
+class QSimpleXmlNodeModel___ extends QSimpleXmlNodeModel {
+
+    /**
+     * Returns the name pool that is associated with this model. The implementation of <code>name()</code>
+     * would use this to create names.
+     */
+    public final QXmlNamePool namePool() {
+        return QXmlNamePool.fromNativePointer(namePool_private());
+    }
+}// class
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/typesystem_xmlpatterns-java.xml	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+<typesystem package="qt.xmlpatterns" default-superclass="qt.QtJambiObject">
+    <inject-code>
+    qt.Utilities.loadQtLibrary("QtNetwork");
+    qt.Utilities.loadQtLibrary("QtXmlPatterns");
+    </inject-code>
+
+    <value-type name="QXmlNodeModelIndex">
+      <inject-code>
+            <import-file name="typesystem_xmlpatterns-java.java" quote-after-line="class QXmlNodeModelIndex___" quote-before-line="}// class"/>
+      </inject-code>
+    </value-type>
+
+    <value-type name="QXmlName">
+      <inject-code>
+    <import-file name="typesystem_xmlpatterns-java.java" quote-after-line="class QXmlName___" quote-before-line="}// class" />
+      </inject-code>
+    </value-type>
+
+    <value-type name="QSimpleXmlNodeModel">
+      <modify-function signature="namePool()const" access="private" rename="namePool_private" />
+      <inject-code>
+    <import-file name="typesystem_xmlpatterns-java.java" quote-after-line="class QSimpleXmlNodeModel___" quote-before-line="}// class" />
+      </inject-code>
+    </value-type>
+</typesystem>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/typesystem_xmlpatterns.xml	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,195 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<typesystem package="qt.xmlpatterns" default-superclass="qt.QtJambiObject">
+<inject-code>
+    qt.Utilities.loadQtLibrary("QtNetwork");
+    qt.Utilities.loadQtLibrary("QtXmlPatterns");
+    </inject-code>
+
+
+  <namespace-type name="QPatternist"/>
+  <namespace-type name="QPatternistSDK"/>
+
+  <enum-type name="QXmlNodeModelIndex::NodeKind"/>
+  <enum-type name="QXmlNodeModelIndex::DocumentOrder"/>
+  <enum-type name="QAbstractXmlNodeModel::NodeCopySetting"/>
+  <enum-type name="QAbstractXmlNodeModel::SimpleAxis"/>
+
+  <object-type name="QAbstractMessageHandler">
+    <modify-function signature="QAbstractMessageHandler(QObject*)" remove="all"/>
+  </object-type>
+  <object-type name="QAbstractUriResolver"/>
+  <object-type name="QAbstractXmlForwardIterator"/>
+
+  <rejection class="QPatternist::NodeIndexStorage"/>
+  <rejection class="QAbstractXmlNodeModel" function-name="mapToItem"/>
+  <rejection class="QAbstractXmlNodeModel" function-name="mapToSequence"/>
+  <rejection class="QAbstractXmlNodeModel" function-name="sequencedTypedValue"/>
+  <rejection class="QAbstractXmlNodeModel" function-name="sendNamespaces"/>
+  <rejection class="QAbstractXmlNodeModel" function-name="iterate"/>
+  <rejection class="QAbstractXmlNodeModel" function-name="copyNodeTo"/>
+  <rejection class="QAbstractXmlNodeModel" function-name="type"/>
+  <value-type name="QAbstractXmlNodeModel">
+    <modify-function signature="QAbstractXmlNodeModel()" remove="all"/>
+    <modify-function signature="namespaceForPrefix(QXmlNodeModelIndex,short) const" remove="all"/>
+    <modify-function signature="isDeepEqual(QXmlNodeModelIndex,QXmlNodeModelIndex) const" remove="all"/>
+  </value-type>
+
+  <rejection class="QAbstractXmlReceiver" function-name="item"/>
+  <rejection class="QAbstractXmlReceiver" function-name="sendAsNode"/>
+  <value-type name="QAbstractXmlReceiver">
+  </value-type>
+
+  <value-type name="QSimpleXmlNodeModel">
+      <modify-function signature="namePool()const" access="private" rename="namePool_private"/>
+      <inject-code>
+    <import-file name="typesystem_xmlpatterns-java.java" quote-after-line="class QSimpleXmlNodeModel___" quote-before-line="}// class"/>
+      </inject-code>
+    </value-type>
+
+  <value-type name="QSourceLocation">
+    <modify-function signature="operator=(QSourceLocation)" remove="all"/>
+  </value-type>
+
+  <rejection class="QXmlFormatter" function-name="item"/>
+  <object-type name="QXmlFormatter">
+    <modify-function signature="startFormattingContent()" remove="all"/>
+  </object-type>
+
+  <value-type name="QXmlItem">
+    <modify-function signature="operator=(QXmlItem)" remove="all"/>
+  </value-type>
+
+  <value-type name="QXmlName">
+    <modify-function signature="QXmlName(QXmlNamePool&amp;,QString,QString,QString)" access="private">
+      <modify-argument index="3">
+    <remove-default-expression/>
+      </modify-argument>
+      <modify-argument index="4">
+    <remove-default-expression/>
+      </modify-argument>
+    </modify-function>
+
+    <modify-function signature="operator=(QXmlName)" remove="all"/>
+    <modify-function signature="QXmlName(short,short,short)" remove="all"/>
+    <modify-function signature="localName()const" remove="all"/>
+    <modify-function signature="prefix()const" remove="all"/>
+    <modify-function signature="hasPrefix()const" remove="all"/>
+    <modify-function signature="hasNamespace()const" remove="all"/>
+    <modify-function signature="namespaceURI()const" remove="all"/>
+    <modify-function signature="isLexicallyEqual(const QXmlName)const" remove="all"/>
+    <modify-function signature="setPrefix(const short)" remove="all"/>
+    <modify-function signature="setNamespaceURI(const short)" remove="all"/>
+    <modify-function signature="setLocalName(const short)" remove="all"/>
+    <modify-function signature="code()const" remove="all"/>
+  
+      <inject-code>
+    <import-file name="typesystem_xmlpatterns-java.java" quote-after-line="class QXmlName___" quote-before-line="}// class"/>
+      </inject-code>
+    </value-type>
+
+  <value-type name="QXmlNamePool">
+    <modify-function signature="operator=(QXmlNamePool)" remove="all"/>
+  </value-type>
+
+  <rejection class="QXmlNodeModelIndex" function-name="sequencedTypedValue"/>
+  <rejection class="QXmlNodeModelIndex" function-name="sendNamespaces"/>
+  <rejection class="QXmlNodeModelIndex" function-name="iterate"/>
+  <rejection class="QXmlNodeModelIndex" function-name="type"/>
+  <rejection class="QXmlNodeModelIndex" enum-name="Axis"/>
+  <value-type name="QXmlNodeModelIndex">
+    <modify-function signature="name() const" remove="all"/>
+    <modify-function signature="root() const" remove="all"/>
+    <modify-function signature="documentUri() const" remove="all"/>
+    <modify-function signature="baseUri() const" remove="all"/>
+    <modify-function signature="kind() const" remove="all"/>
+    <modify-function signature="isDeepEqual(QXmlNodeModelIndex) const" remove="all"/>
+    <modify-function signature="compareOrder(QXmlNodeModelIndex) const" remove="all"/>
+    <modify-function signature="namespaceBindings() const" remove="all"/>
+    <modify-function signature="namespaceForPrefix(short) const" remove="all"/>
+    <modify-function signature="stringValue() const" remove="all"/>
+    <modify-function signature="is(QXmlNodeModelIndex) const" remove="all"/>
+    <modify-function signature="reset()" remove="all"/>
+    <modify-function signature="internalPointer()const" remove="all"/>
+
+    <modify-function signature="model()const">
+      <access modifier="private"/>
+      <rename to="model_private"/>
+    </modify-function>
+  
+      <inject-code>
+            <import-file name="typesystem_xmlpatterns-java.java" quote-after-line="class QXmlNodeModelIndex___" quote-before-line="}// class"/>
+      </inject-code>
+    </value-type>
+
+  <value-type name="QXmlSerializerPointer"/>
+
+  <object-type name="QXmlQuery">
+    <modify-function signature="evaluateTo(QAbstractXmlReceiver *)const" remove="all"/>
+    <modify-function signature="evaluateTo(QStringList&lt;QString&gt;*)const" remove="all"/>
+    <modify-function signature="setMessageHandler(QAbstractMessageHandler*)">
+      <modify-argument index="1">
+    <reference-count action="set" variable-name="__rcMessageHandler"/>
+      </modify-argument>
+    </modify-function>
+    <modify-function signature="setQuery(QIODevice*, QUrl)">
+      <modify-argument index="1">
+    <reference-count action="ignore"/> <!-- Data from IODevice is readAll()'d immediately and the pointer is not stored -->
+      </modify-argument>
+    </modify-function>
+    <modify-function signature="setUriResolver(const QAbstractUriResolver*)">
+      <modify-argument index="1">
+    <reference-count action="set" variable-name="__rcUriResolver"/>
+      </modify-argument>
+    </modify-function>
+  </object-type>
+  <object-type name="QXmlResultItems"/>
+
+  <rejection class="QXmlSerializer" function-name="item"/>
+  <object-type name="QXmlSerializer">
+    <modify-function signature="atDocumentRoot()const" remove="all"/>
+    <modify-function signature="startContent()" remove="all"/>
+    <modify-function signature="writeEscaped(QString)" remove="all"/>
+    <modify-function signature="writeEscapedAttribute(QString)" remove="all"/>
+    <modify-function signature="write(QString)" remove="all"/>
+    <modify-function signature="write(QXmlName)" remove="all"/>
+    <modify-function signature="write(const char *)" remove="all"/>
+    <modify-function signature="isBindingInScope(QXmlName)const" remove="all"/>
+    <modify-function signature="setCodec(const QTextCodec *)">
+      <modify-argument index="1">
+    <reference-count action="set" variable-name="__rcCodec"/>
+      </modify-argument>
+    </modify-function>
+  </object-type>
+
+
+
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: horribly broken type ''"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: template baseclass 'QExplicitlySharedDataPointer&lt;QXmlSerializer&gt;' of 'QXmlSerializerPointer' is not known"/>
+
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QXmlItem::QXmlItem', unmatched parameter type 'QPatternist::Item const&amp;'"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QXmlNodeModelIndex::sequencedTypedValue', unmatched return type 'QExplicitlySharedDataPointer&lt;QAbstractXmlForwardIterator&lt;QPatternist::Item&gt;&gt;"/>
+
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QXmlNodeModelIndex::QXmlNodeModelIndex', unmatched parameter type 'QPatternist::NodeIndexStorage const&amp;'"/>
+
+  <!-- To avoid warnings when running the generator on systems without XML patterns -->
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QSimpleXmlNodeModel' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QXmlSerializerPointer' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QSourceLocation' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QXmlFormatter' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QAbstractUriResolver' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QAbstractXmlReceiver' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.xmlpatterns.QXmlNodeModelIndex' for enum 'DocumentOrder' is not declared"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QXmlQuery' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QXmlName' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.xmlpatterns.QAbstractXmlNodeModel' for enum 'NodeCopySetting' is not declared"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QXmlSerializer' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QAbstractXmlNodeModel' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QXmlItem' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QXmlNodeModelIndex' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QXmlResultItems' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QAbstractMessageHandler' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.xmlpatterns.QXmlNodeModelIndex' for enum 'NodeKind' is not declared"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'qt.xmlpatterns.QAbstractXmlNodeModel' for enum 'SimpleAxis' is not declared"/>
+  <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QXmlNamePool' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
+
+</typesystem>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/uiconverter.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,383 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#include "uiconverter.h"
+#include "metajava.h"
+
+#include "reporthandler.h"
+
+#include <QtCore/QFileInfo>
+#include <QtXml/QDomDocument>
+
+void UiConverter::convertToJui(const QString &uiFile, const QString &customWidgetFiles)
+{
+    ReportHandler::setContext(QLatin1String("UiConverter to .jui"));
+
+    traverseCustomWidgets(customWidgetFiles);
+
+    QFileInfo fileInfo(uiFile);
+
+    if (!fileInfo.exists()) {
+        ReportHandler::warning(QString::fromLatin1("Ui File %1 doesn't exist...\n").arg(uiFile));
+        return;
+    }
+
+    if (fileInfo.suffix() != QLatin1String("ui")) {
+        ReportHandler::warning(QString::fromLatin1("File doesn't have .ui extension: %1")
+                               .arg(uiFile));
+        return;
+    }
+
+    QString juiFile = fileInfo.absolutePath() + QLatin1Char('/') + fileInfo.baseName()
+                      + QLatin1String(".jui");
+
+    QFile inputFile(uiFile);
+
+    if (!inputFile.open(QFile::ReadOnly | QFile::Text)) {
+        ReportHandler::warning(QString::fromLatin1("Could not open '%1' for reading").arg(uiFile));
+        return;
+    }
+
+    QDomDocument dom;
+    QString error;
+    if (!dom.setContent(&inputFile, false, &error)) {
+        ReportHandler::warning(QString::fromLatin1("Xml loading %1 failed: %2")
+                               .arg(uiFile).arg(error));
+        inputFile.close();
+        return;
+    }
+    inputFile.close();
+
+    QDomNodeList customWidgets = dom.documentElement().elementsByTagName("customwidget");
+    for (int i=0; i<customWidgets.size(); ++i) {
+        QDomNode customWidget = customWidgets.at(i);
+
+        QDomElement el = customWidget.toElement();
+        fixCustomWidgetNode(el, &dom);
+    }
+
+    traverse(dom.documentElement(), &dom);
+
+    QFile outputFile(juiFile);
+    if (!outputFile.open(QFile::WriteOnly | QFile::Text)) {
+        ReportHandler::warning(QString::fromLatin1("Could not open '%1' for writing")
+                               .arg(juiFile));
+        return;
+    }
+
+    outputFile.write(dom.toByteArray());
+    outputFile.close();
+}
+
+void UiConverter::traverseCustomWidgetFile(const QString &customWidgetFile)
+{
+    if (customWidgetFile.isEmpty())
+        return;
+
+    QFile file(customWidgetFile);
+    if (!file.open(QIODevice::ReadOnly)) {
+        ReportHandler::warning("Can't read custom widget file '"
+                               + customWidgetFile
+                               + "'");
+        return;
+    }
+
+    QXmlStreamReader reader(&file);
+    while (!reader.atEnd()) {
+        reader.readNext();
+        if (reader.isStartElement() && reader.name() == "qt-jambi-custom-widget") {
+            QXmlStreamAttributes attributes = reader.attributes();
+            QString className = attributes.value("class").toString();
+
+            int pos = className.lastIndexOf(".");
+            m_custom_widgets.insertMulti(className.mid(pos+1), CustomWidget(className, 0));
+        }
+    }
+
+    if (reader.hasError()) {
+        ReportHandler::warning("Error when parsing custom widget file '"
+                               + customWidgetFile
+                               + "': "
+                               + reader.errorString());
+    }
+}
+
+void UiConverter::traverseCustomWidgets(const QString &customWidgetFiles)
+{
+#ifdef Q_OS_WIN32
+    char separator = ';';
+#else
+    char separator = ':';
+#endif
+
+    QStringList customWidgets = customWidgetFiles.split(separator);
+    foreach (QString customWidget, customWidgets)
+        traverseCustomWidgetFile(customWidget);
+}
+
+void UiConverter::traverse(QDomNode node, QDomDocument *doc)
+{
+    if (node.isNull())
+        return;
+
+    QDomElement element = node.toElement();
+    if (!element.isNull()) {
+        if (element.nodeName() == QLatin1String("ui"))
+            fixUiNode(element, doc);
+        else if (element.nodeName() == QLatin1String("set"))
+            fixSetNode(element, doc);
+        else if (element.nodeName() == QLatin1String("enum"))
+            fixEnumNode(element, doc);
+        else if (element.nodeName() == QLatin1String("connection"))
+            fixConnectionNode(element, doc);
+        else if (element.nodeName() == QLatin1String("widget"))
+            fixWidgetNode(element, doc);
+    }
+
+    QDomNodeList list = node.childNodes();
+    for (int i=0; i<list.size(); ++i)
+        traverse(list.at(i), doc);
+}
+
+
+void UiConverter::fixUiNode(QDomElement el, QDomDocument *)
+{
+    el.setAttribute("language", "jambi");
+}
+
+void UiConverter::fixCustomWidgetNode(QDomElement el, QDomDocument *)
+{
+    QDomNodeList classes = el.elementsByTagName("class");
+    if (classes.size() < 1) {
+        ReportHandler::warning("Custom widget missing 'class' child");
+        return;
+    }
+
+    QDomNodeList extendss = el.elementsByTagName("extends");
+    if (extendss.size() < 1) {
+        ReportHandler::warning("Custom widget missing 'extends' child");
+        return;
+    }
+
+    QString className = classes.at(0).toElement().text();
+    QString extends = extendss.at(0).toElement().text();
+
+    AbstractMetaClass *javaClass = m_java_classes.findClass(extends);
+    if (javaClass == 0) {
+        ReportHandler::warning("Couldn't find super class for custom widget: '" + extends + "'");
+        return;
+    }
+
+    QList<CustomWidget> fullNames = m_custom_widgets.values(className);
+    if (fullNames.size() == 0) {
+        ReportHandler::warning("Couldn't find custom widget entry for '" + className + "'."
+                               " You need to specify this class in a custom widget file and"
+                               " pass the file name on the command line using the --custom-widgets option.");
+        return;
+    }
+
+    if (fullNames.size() > 1) {
+        ReportHandler::warning("More than custom widget type matching '" + className + "'. "
+                               + "Will use first seen entry: '" + fullNames.at(0).first + "'");
+    }
+
+    QString fullName = fullNames.at(0).first;
+    classes.at(0).namedItem("#text").toText().setData(fullName);
+
+    QMap<QString, CustomWidget>::iterator it;
+    for (it=m_custom_widgets.begin(); it!=m_custom_widgets.end(); ++it) {
+        if (it.key() == className)
+            (*it).second = javaClass;
+    }
+}
+
+void UiConverter::fixSetNode(QDomElement el, QDomDocument *)
+{
+   QStringList cppSet = el.firstChild().nodeValue().split(QLatin1Char('|'));
+
+    QStringList javaSet;
+    for (int i=0; i<cppSet.size(); ++i)
+        javaSet << translateEnumValue(cppSet.at(i));
+
+    el.firstChild().setNodeValue(javaSet.join(QLatin1String("|")));
+}
+
+
+void UiConverter::fixEnumNode(QDomElement el, QDomDocument *)
+{
+    QDomNode valueNode = el.firstChild();
+    if (valueNode.isNull()) {
+        ReportHandler::warning(QString::fromLatin1("Bad enum value at '%1'").arg(el.nodeValue()));
+        return;
+    }
+
+    QString cppEnumValue = valueNode.nodeValue();
+    QString javaEnumValue = translateEnumValue(cppEnumValue);
+    valueNode.setNodeValue(javaEnumValue);
+}
+
+
+void UiConverter::fixConnectionNode(QDomElement el, QDomDocument *)
+{
+    QString senderName = el.namedItem("sender").firstChild().nodeValue();
+    AbstractMetaClass *senderClass = m_named_widgets[senderName];
+    if (!senderClass) {
+        ReportHandler::warning(QString::fromLatin1("sender unknown '%1'").arg(senderName));
+        return;
+    }
+    QDomNode signalSignatureNode = el.namedItem("signal").toElement().firstChild();
+    QString signalSignature = signalSignatureNode.nodeValue();
+    const AbstractMetaFunction *signalFunction = findFunction(senderClass,
+                                                          signalSignature,
+                                                          SignalSearch);
+    if (!signalFunction) {
+        ReportHandler::warning(QString::fromLatin1("Signal not found '%1' in '%2'")
+                               .arg(signalSignature).arg(senderClass->qualifiedCppName()));
+        return;
+    }
+    signalSignatureNode.setNodeValue(signalFunction->modifiedName());
+
+    QString receiverName = el.namedItem("receiver").firstChild().nodeValue();
+    AbstractMetaClass *receiverClass = m_named_widgets[receiverName];
+    if (!receiverClass) {
+        ReportHandler::warning(QString::fromLatin1("receiver unknown '%1'").arg(receiverName));
+        return;
+    }
+
+    QDomNode slotSignatureNode = el.namedItem("slot").firstChild();
+    QString slotSignature = slotSignatureNode.nodeValue();
+    const AbstractMetaFunction *slotFunction = findFunction(receiverClass, slotSignature, SlotSearch);
+    if (!signalFunction) {
+        ReportHandler::warning(QString::fromLatin1("Slot not found '%1' in '%2'")
+                               .arg(slotSignature).arg(receiverClass->qualifiedCppName()));
+        return;
+    }
+
+    slotSignatureNode.setNodeValue(slotFunction->targetLangSignature(true));
+}
+
+
+void UiConverter::fixWidgetNode(QDomElement el, QDomDocument *)
+{
+    QString className = el.attribute(QLatin1String("class"));
+    QList<CustomWidget> customWidgetNames = m_custom_widgets.values(className);
+    QString customWidgetName = customWidgetNames.size() > 0 ? customWidgetNames.at(0).first : QString();
+
+    AbstractMetaClass *javaClass = customWidgetName.isEmpty() ? m_java_classes.findClass(className) : customWidgetNames.at(0).second;
+    if (!javaClass) {
+        ReportHandler::warning(QString::fromLatin1("Class '%1' is unknown").arg(className));
+        return;
+    }
+
+    if (!customWidgetName.isEmpty())
+        el.setAttribute(QLatin1String("class"), customWidgetName);
+    else if (javaClass->package() != QLatin1String("qt.gui"))
+        el.setAttribute(QLatin1String("class"), javaClass->fullName());
+
+    m_named_widgets.insert(el.attribute(QLatin1String("name")), javaClass);
+}
+
+
+QString UiConverter::translateEnumValue(const QString &cppEnumValue) {
+    if (!cppEnumValue.contains(QLatin1String("::"))) {
+        ReportHandler::warning(QString::fromLatin1("Expected '::' in enum value '%1'")
+                               .arg(cppEnumValue));
+        return QString();
+    }
+
+    QStringList names = cppEnumValue.split(QLatin1String("::"));
+    AbstractMetaClass *javaClass = m_java_classes.findClass(names.at(0));
+
+    if (!javaClass) {
+        ReportHandler::warning(QString::fromLatin1("Class '%1' is unknown").arg(names.at(0)));
+        return QString();
+    }
+
+    AbstractMetaEnum *javaEnum = javaClass->findEnumForValue(names.at(1));
+    if (!javaEnum) {
+        ReportHandler::warning(QString::fromLatin1("Enum value '%1' was not found in '%2'")
+                               .arg(names.at(1)).arg(names.at(0)));
+        return QString();
+    }
+
+    AbstractMetaEnumValueList enumValues = javaEnum->values();
+    AbstractMetaEnumValue *enumValue = enumValues.find(names.at(1));
+    int value = enumValue->value();
+
+    if (javaEnum->typeEntry()->isEnumValueRejected(enumValue->name())) {
+        for (int i=0; i<enumValues.size(); ++i) {
+            AbstractMetaEnumValue *ev = enumValues.at(i);
+            if (ev->value() == value) {
+                enumValue = ev;
+                break;
+            }
+        }
+    }
+
+    return javaEnum->fullName() + QLatin1String(".") + enumValue->name();
+}
+
+const AbstractMetaFunction *UiConverter::findFunction(AbstractMetaClass *javaClass,
+                                                  const QString &signature,
+                                                  SearchType type)
+{
+    AbstractMetaFunctionList senderFunctions = javaClass->functions();
+    foreach (const AbstractMetaFunction *f, senderFunctions) {
+        if (type == SignalSearch && !f->isSignal())
+            continue;
+
+        QString fsig = f->minimalSignature();
+
+
+        int pos = 0;
+        while (pos < signature.length()
+               && fsig.constData()[pos] == signature.constData()[pos]) ++pos;
+
+        if (pos == signature.length()
+            || (type == SignalSearch
+                && pos == signature.length() - 1
+                && signature.constData()[pos] == QLatin1Char(')'))) {
+            return f;
+        }
+    }
+
+    return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/uiconverter.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,84 @@
+/****************************************************************************
+**
+** Copyright (C) 1992-2008 Nokia. All rights reserved.
+**
+** This file is part of Qt Jambi.
+**
+** * Commercial Usage
+* Licensees holding valid Qt Commercial licenses may use this file in
+* accordance with the Qt Commercial License Agreement provided with the
+* Software or, alternatively, in accordance with the terms contained in
+* a written agreement between you and Nokia.
+*
+*
+* GNU General Public License Usage
+* Alternatively, this file may be used under the terms of the GNU
+* General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+* http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+* exception, Nokia gives you certain additional rights. These rights
+* are described in the Nokia Qt GPL Exception version 1.2, included in
+* the file GPL_EXCEPTION.txt in this package.
+* 
+* Qt for Windows(R) Licensees
+* As a special exception, Nokia, as the sole copyright holder for Qt
+* Designer, grants users of the Qt/Eclipse Integration plug-in the
+* right for the Qt/Eclipse Integration to link to functionality
+* provided by Qt Designer and its related libraries.
+*
+*
+* If you are unsure which license is appropriate for your use, please
+* contact the sales department at qt-sales@nokia.com.
+
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#ifndef UICONVERTER_H
+#define UICONVERTER_H
+
+#include "metajava.h"
+
+#include <QtXml>
+
+class UiConverter
+{
+public:
+    enum SearchType {
+        SignalSearch,
+        SlotSearch
+    };
+
+    void setClasses(const AbstractMetaClassList &classes) { m_java_classes = classes; }
+    AbstractMetaClassList classes() const { return m_java_classes; }
+
+    void convertToJui(const QString &uiFile, const QString &customWidgetFiles);
+
+private:
+    typedef QPair<QString, AbstractMetaClass *> CustomWidget;
+
+    void traverse(QDomNode node, QDomDocument *doc);
+    void fixUiNode(QDomElement node, QDomDocument *doc);
+    void fixSetNode(QDomElement node, QDomDocument *doc);
+    void fixEnumNode(QDomElement node, QDomDocument *doc);
+    void fixConnectionNode(QDomElement node, QDomDocument *doc);
+    void fixWidgetNode(QDomElement, QDomDocument *doc);
+    void fixCustomWidgetNode(QDomElement, QDomDocument *doc);
+
+    void traverseCustomWidgets(const QString &customWidgetFiles);
+    void traverseCustomWidgetFile(const QString &customWidgetFile);
+    QString translateEnumValue(const QString &enumValue);
+    const AbstractMetaFunction *findFunction(AbstractMetaClass *javaClass, const QString &signature,
+                                         SearchType type);
+
+    AbstractMetaClassList m_java_classes;
+    QHash<QString, AbstractMetaClass *> m_named_widgets;
+    QMultiMap<QString, CustomWidget> m_custom_widgets;
+};
+
+#endif // UICONVERTER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/ArrayOpsPrimitive.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,79 @@
+/**
+*
+*  Copyright: Copyright QtD Team, 2008-2009
+*  License: <a href="http://www.boost.org/LICENSE_1_0.txt>Boost License 1.0</a>
+*
+*  Copyright QtD Team, 2008-2009
+*  Distributed under the Boost Software License, Version 1.0.
+*  (See accompanying file boost-license-1.0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+*
+*/
+
+#ifndef ARRAY_OPS_PRIMITIVE_H
+#define ARRAY_OPS_PRIMITIVE_H
+
+#include "qtd_core.h"
+
+// int
+QTD_EXPORT(void, qtd_allocate_int_array, (void* arr, size_t len))
+QTD_EXPORT(void, qtd_assign_int_array_element, (void* arr, size_t pos, int elem))
+QTD_EXPORT(void, qtd_get_int_from_array, (void* arr, size_t pos, int* elem))
+
+// uint
+QTD_EXPORT(void, qtd_allocate_uint_array, (void* arr, size_t len))
+QTD_EXPORT(void, qtd_assign_uint_array_element, (void* arr, size_t pos, uint elem))
+QTD_EXPORT(void, qtd_get_uint_from_array, (void* arr, size_t pos, uint* elem))
+
+// double
+QTD_EXPORT(void, qtd_allocate_double_array, (void* arr, size_t len))
+QTD_EXPORT(void, qtd_assign_double_array_element, (void* arr, size_t pos, double elem))
+QTD_EXPORT(void, qtd_get_double_from_array, (void* arr, size_t pos, double* elem))
+
+// string
+QTD_EXPORT(void, qtd_allocate_string_array, (void* arr, size_t len))
+QTD_EXPORT(void, qtd_assign_string_array_element, (void* arr, size_t pos, void* elem))
+QTD_EXPORT(void*, qtd_string_from_array, (void* arr, size_t pos))
+QTD_EXPORT(void, qtd_get_string_from_array, (void* arr, size_t pos, char** elem, size_t* elem_size))
+
+#ifdef CPP_SHARED
+
+#define qtd_allocate_int_array qtd_get_qtd_allocate_int_array()
+#define qtd_assign_int_array_element qtd_get_qtd_assign_int_array_element()
+#define qtd_get_int_from_array qtd_get_qtd_get_int_from_array()
+
+#define qtd_allocate_uint_array qtd_get_qtd_allocate_uint_array()
+#define qtd_assign_uint_array_element qtd_get_qtd_assign_uint_array_element()
+#define qtd_get_uint_from_array qtd_get_qtd_get_uint_from_array()
+
+#define qtd_allocate_double_array qtd_get_qtd_allocate_double_array()
+#define qtd_assign_double_array_element qtd_get_qtd_assign_double_array_element()
+#define qtd_get_double_from_array qtd_get_qtd_get_double_from_array()
+
+#define qtd_allocate_string_array qtd_get_qtd_allocate_string_array()
+#define qtd_assign_string_array_element qtd_get_qtd_assign_string_array_element()
+#define qtd_string_from_array qtd_get_qtd_string_from_array()
+#define qtd_get_string_from_array qtd_get_qtd_get_string_from_array()
+
+#endif
+
+/*
+// int
+extern "C" void qtd_allocate_int_array(void* arr, size_t len);
+extern "C" void qtd_assign_int_array_element(void* arr, size_t pos, int elem);
+
+// uint
+extern "C" void qtd_allocate_uint_array(void* arr, size_t len);
+extern "C" void qtd_assign_uint_array_element(void* arr, size_t pos, uint elem);
+
+// double
+extern "C" void qtd_allocate_double_array(void* arr, size_t len);
+extern "C" void qtd_assign_double_array_element(void* arr, size_t pos, double elem);
+
+// string
+extern "C" void qtd_allocate_string_array(void* arr, size_t len);
+extern "C" void qtd_assign_string_array_element(void* arr, size_t pos, void* elem);
+extern "C" void* qtd_string_from_array(void* arr, size_t pos);
+extern "C" void qtd_get_string_from_array(void* arr, size_t pos, char** elem, size_t* elem_size);
+*/
+
+#endif // ARRAY_OPS_PRIMITIVE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/QObjectEntity.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,16 @@
+#ifndef QQOBJECTENTITY_H
+#define QQOBJECTENTITY_H
+
+#include <cstdlib>
+
+class Qtd_QObjectEntity
+{
+public:
+	Qtd_QObjectEntity(void *d_ptr) { _d_ptr = d_ptr; }
+	void *d_entity() const { return _d_ptr; }
+
+private:
+	void *_d_ptr;
+};
+
+#endif // QQOBJECTENTITY_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/qtd_core.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,64 @@
+/**
+*
+*  Copyright: Copyright QtD Team, 2008-2009
+*  License: <a href="http://www.boost.org/LICENSE_1_0.txt>Boost License 1.0</a>
+*
+*  Copyright QtD Team, 2008-2009
+*  Distributed under the Boost Software License, Version 1.0.
+*  (See accompanying file boost-license-1.0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+*
+*/
+
+#ifndef QTD_CORE_H
+#define QTD_CORE_H
+
+#include <QAbstractItemModel>
+
+#if defined WIN32
+  #define DLL_PUBLIC __declspec(dllexport)
+#else
+  #define DLL_PUBLIC
+#endif
+
+#ifdef CPP_SHARED
+  #define QTD_EXPORT(TYPE, NAME, ARGS)      \
+    extern "C" typedef TYPE (*pf_##NAME)ARGS; \
+    extern "C" pf_##NAME qtd_get_##NAME();
+  #define QTD_EXPORT_VAR(NAME) \
+    pf_##NAME m_##NAME;        \
+    extern "C" DLL_PUBLIC pf_##NAME qtd_get_##NAME() { return m_##NAME; }
+  #define QTD_EXPORT_VAR_SET(NAME, VALUE) \
+    m_##NAME = (pf_##NAME) VALUE
+#else
+  #define QTD_EXPORT(TYPE, NAME, ARGS)      \
+    extern "C" TYPE NAME ARGS;
+#endif
+
+struct QModelIndexAccessor {
+	int row;
+	int col;
+	void *ptr;
+	QAbstractItemModel *model;
+};
+
+struct DArray {
+    size_t length;
+    void* ptr;
+};
+
+#ifdef CPP_SHARED
+typedef void (*pfunc_abstr)();
+#endif
+
+QTD_EXPORT(void, _d_toUtf8, (const unsigned short* arr, uint size, void* str))
+QTD_EXPORT(void, __qtd_dummy, ())
+
+#ifdef CPP_SHARED
+#define _d_toUtf8 qtd_get__d_toUtf8()
+#define __qtd_dummy qtd_get___qtd_dummy()
+#endif
+
+extern "C" QModelIndex qtd_to_QModelIndex(QModelIndexAccessor mia);
+extern "C" QModelIndexAccessor qtd_from_QModelIndex(const QModelIndex &index);
+
+#endif // QTD_CORE_H
Binary file lib/glu32.lib has changed
Binary file lib/opengl32.lib has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mini/test1/build	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,3 @@
+#! /bin/bash
+
+dmd main.d -L-L../../lib -L-lqtdcore -I../../ -L-lQtCore
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mini/test1/build.bat	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,1 @@
+dmd main.d libqtdcore.lib -I../../
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mini/test1/main.d	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,29 @@
+import qt.core.QCoreApplication;
+
+import tango.io.Stdout;
+
+int main(string[] args)
+{
+    auto app = new QCoreApplication(args);
+    
+    auto parent = new QObject();
+    parent.setObjectName("papa");
+    auto child1 = new QObject(parent);
+    child1.setObjectName("child1");
+    auto child2 = new QObject(parent);
+    child2.setObjectName("child2");
+    auto child3 = new QObject(parent);
+    child3.setObjectName("child3");
+    
+    auto cd = parent.children;
+
+    Stdout(app.arguments).newline;
+    foreach(child; cd)
+        Stdout(child.objectName).newline;
+    
+    app.setLibraryPaths(["freakin", "bloody", "awesome!"]);
+    Stdout(app.libraryPaths).newline;
+    
+    return 5;
+//    return app.exec();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qt/CMakeLists.txt	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,23 @@
+project (qt_d D)
+
+set(QT_SRCS_D
+QtDObject.d
+QGlobal.d
+
+core/QChildEvent.d
+core/QCoreApplication.d
+core/QEvent.d
+core/QEventLoop.d
+core/QObject.d
+core/QTimerEvent.d
+core/QTranslator.d
+core/Qt.d
+
+qtd/Str.d
+)
+
+#add_subdirectory(core)
+#add_subdirectory(qtd)
+
+#add_library(qt_d STATIC ${QT_CORE_SRCS_D} ${QT_QTD_SRCS_D} ${QT_SRCS_D})
+add_library(qt_d STATIC ${QT_SRCS_D})
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qt/QGlobal.d	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,575 @@
+module qt.QGlobal;
+
+public import qt.qtd.Str;
+
+version (Tango)
+{
+    import tango.io.Stdout;
+    void writeln(string s)
+    {
+        Stdout(s).newline;
+    }
+}
+else
+    import std.stdio;
+
+template QT_BEGIN_NAMESPACE() {
+}
+
+template QT_END_NAMESPACE() {
+}
+
+template QT_BEGIN_HEADER() {
+}
+
+template QT_END_HEADER() {
+}
+
+mixin QT_BEGIN_HEADER;
+mixin QT_BEGIN_NAMESPACE;
+
+version(Windows)
+{
+    export extern(C) void d_dummy() {}
+    extern (C) void __qtd_qtd_core_initCallBacks(void* toUtf8, void* dummy);
+    static this() {
+        __qtd_qtd_core_initCallBacks(&_d_toUtf8, &d_dummy);
+    }
+}
+
+char[] tr(char[] arg) {
+    return arg;
+}
+
+// TODO(katrina) get this from the C++ side
+const char[] QT_VERSION_STR = "4.5.0";
+/*
+   QT_VERSION is (major << 16) + (minor << 8) + patch.
+   //TODO(katrina) get this from the C++ side
+*/
+const int QT_VERSION = 0x040403;
+/*
+   can be used like #if (QT_VERSION >= QT_VERSION_CHECK(4, 4, 0))
+*/
+bool QT_VERSION_CHECK( ushort major, ushort minor, ushort patch )
+{
+	return cast(bool)((major<<16)|(minor<<8)|(patch));
+}
+//TODO(katrina) get this from the C++ side
+const char[] QT_PACKAGEDATE_STR = "2008-09-27";
+//TODO(katrina) get this from the C++ side
+const char[] QT_PACKAGE_TAG = "gc9953de622c6a0f655322e0d9f5bd6dc2803b470";
+
+/*
+   Size-dependent types (architechture-dependent byte order)
+
+   Make sure to update QMetaType when changing these typedefs
+*/
+
+alias char qint8;         /* 8 bit signed */
+alias char quint8;      /* 8 bit unsigned */
+alias short qint16;              /* 16 bit signed */
+alias ushort quint16;    /* 16 bit unsigned */
+alias int qint32;                /* 32 bit signed */
+alias uint quint32;      /* 32 bit unsigned */
+alias long qint64;            /* 64 bit signed */
+alias ulong quint64;  /* 64 bit unsigned */
+
+const byte QT_POINTER_SIZE = 8;
+
+alias int QNoImplicitBoolCast;
+
+alias double qreal;
+
+
+/*
+   Utility macros and inline functions
+   TODO(katrina) see if we need to do anything to make these
+   able to be evaluated at compile time
+*/
+
+T qAbs(T)(T t) { return t >= 0 ? t : -t; }
+
+int qRound(qreal d)
+{ return d >= 0.0 ? cast(int)(d + 0.5) : cast(int)(d - cast(int)(d-1) + 0.5) + cast(int)(d-1); }
+
+qint64 qRound64(qreal d)
+{ return d >= 0.0 ? cast(qint64)(d + 0.5) : cast(qint64)(d - cast(qint64)(d-1) + 0.5) + cast(qint64)(d-1); }
+
+T qMin(T)(T a,T b) { if (a < b) return a; return b; }
+T qMax(T)(T a, T b) { if (a < b) return b; return a; }
+T qBound(T)(T min, T val,T max) { return qMax(min, qMin(max, val)); }
+
+/*
+   Data stream functions are provided by many classes (defined in qdatastream.h)
+*/
+
+//class QDataStream;
+
+/*
+   System information
+*/
+
+class QSysInfo {
+public:
+    enum Sizes {
+        WordSize = ((void *).sizeof<<3)
+    };
+
+    enum Endian {
+        BigEndian,
+        LittleEndian,
+        ByteOrder = BigEndian
+    };
+    /* needed to bootstrap qmake */
+    static const int ByteOrder;
+
+    enum WinVersion {
+        WV_32s      = 0x0001,
+        WV_95       = 0x0002,
+        WV_98       = 0x0003,
+        WV_Me       = 0x0004,
+        WV_DOS_based= 0x000f,
+
+        WV_NT       = 0x0010,
+        WV_2000     = 0x0020,
+        WV_XP       = 0x0030,
+        WV_2003     = 0x0040,
+        WV_VISTA    = 0x0080,
+        WV_NT_based = 0x00f0,
+
+        WV_CE       = 0x0100,
+        WV_CENET    = 0x0200,
+        WV_CE_5     = 0x0300,
+        WV_CE_6     = 0x0400,
+        WV_CE_based = 0x0f00
+    };
+    static const WinVersion WindowsVersion;
+    static WinVersion windowsVersion();
+
+    enum MacVersion {
+        MV_Unknown = 0x0000,
+
+        /* version */
+        MV_9 = 0x0001,
+        MV_10_0 = 0x0002,
+        MV_10_1 = 0x0003,
+        MV_10_2 = 0x0004,
+        MV_10_3 = 0x0005,
+        MV_10_4 = 0x0006,
+        MV_10_5 = 0x0007,
+
+        /* codenames */
+        MV_CHEETAH = MV_10_0,
+        MV_PUMA = MV_10_1,
+        MV_JAGUAR = MV_10_2,
+        MV_PANTHER = MV_10_3,
+        MV_TIGER = MV_10_4,
+        MV_LEOPARD = MV_10_5
+    };
+    static const MacVersion MacintoshVersion;
+};
+
+char[] qVersion();
+bool qSharedBuild();
+
+int qMacVersion() { return QSysInfo.MacintoshVersion; }
+
+void qUnused(T)(T x) { cast(void) x; }
+void Q_UNUSED(T)(T x) { qUnused(x); }
+
+/*
+   Debugging and error handling
+*/
+
+//class QString;
+//char[] qPrintable(QString string) { string.toLocal8Bit().constData(); }
+//TODO(katrina) These should probably actually call into the c++ functions
+void qDebug( char[] str ) /* print debug message */
+{ writeln(str); }
+
+extern (C) void Qt_qWarning( char * );
+
+void qWarning(char[] str) /* print warning message */
+{ writeln(str); }
+
+//QString qt_error_string(int errorCode = -1);
+void qCritical(char[] str) /* print critical message */
+{ writeln(str); }
+
+/*
+  Forward declarations only.
+
+  In order to use the qDebug() stream, you must #include<QDebug>
+*/
+//class QDebug;
+//class QNoDebug;
+//QDebug qDebug();
+//QDebug qWarning();
+//QDebug qCritical();
+
+void qt_noop() {}
+//TODO(katrina) Implement these
+void qt_assert(char[] assertion, char[] file, int line);
+
+void qt_assert_x(char[] where, char[] what, char[] file, int line);
+
+void qt_check_pointer(char[], int);
+
+enum QtMsgType { QtDebugMsg, QtWarningMsg, QtCriticalMsg, QtFatalMsg, QtSystemMsg = QtCriticalMsg };
+
+void qt_message_output(QtMsgType, char[] buf);
+//class QtMsgHandler;
+//QtMsgHandler qInstallMsgHandler(QtMsgHandler);
+
+// forward declaration, since qatomic.h needs qglobal.h
+class QBasicAtomicPointer(T);
+
+// POD for Q_GLOBAL_STATIC
+class QGlobalStatic(T)
+{
+public:
+    QBasicAtomicPointer!(T) pointer;
+    bool destroyed;
+};
+
+// Created as a function-local static to delete a QGlobalStatic<T>
+class QGlobalStaticDeleter(T)
+{
+public:
+    QGlobalStatic!(T) globalStatic;
+    this(QGlobalStatic!(T) _globalStatic) {
+        globalStatic(_globalStatic);
+    }
+
+    ~this()
+    {
+        delete globalStatic.pointer;
+        globalStatic.pointer = 0;
+        globalStatic.destroyed = true;
+    }
+};
+
+class QBool
+{
+    bool b;
+
+public:
+    this(bool B) { b = B; }
+//    void *() const
+//    { return b ? static_cast<const void *>(this) : static_cast<const void *>(0); }
+}
+
+bool qFuzzyCompare(double p1, double p2)
+{
+    return (qAbs(p1 - p2) <= 0.000000000001 * qMin(qAbs(p1), qAbs(p2)));
+}
+
+bool qFuzzyCompare(float p1, float p2)
+{
+    return (qAbs(p1 - p2) <= 0.00001f * qMin(qAbs(p1), qAbs(p2)));
+}
+
+/*
+   This function tests a double for a null value. It doesn't
+   check whether the actual value is 0 or close to 0, but whether
+   it is binary 0.
+*/
+bool qIsNull(double d)
+{
+    union U {
+        double d;
+        quint64 u;
+    };
+    U val;
+    val.d = d;
+    return val.u == cast(quint64)(0);
+}
+
+/*
+   This function tests a float for a null value. It doesn't
+   check whether the actual value is 0 or close to 0, but whether
+   it is binary 0.
+*/
+bool qIsNull(float f)
+{
+    union U {
+        float f;
+        quint32 u;
+    };
+    U val;
+    val.f = f;
+    return val.u == 0u;
+}
+
+/*
+   Compilers which follow outdated template instantiation rules
+   require a class to have a comparison operator to exist when
+   a QList of this type is instantiated. It's not actually
+   used in the list, though. Hence the dummy implementation.
+   Just in case other code relies on it we better trigger a warning
+   mandating a real implementation.
+*/
+
+
+/*
+   QTypeInfo     - type trait functionality
+   qIsDetached   - data sharing functionality
+*/
+
+/*
+  The catch-all template.
+*/
+
+bool qIsDetached(T)(T) { return true; }
+
+class QTypeInfossss(T)
+{
+public:
+    enum {
+        isPointer = false,
+        isComplex = true,
+        isStatic = true,
+        isLarge = ((T).sizeof>(void*).sizeof),
+        isDummy = false
+    };
+};
+
+class QTypeInfo(T)
+{
+public:
+    enum {
+        isPointer = true,
+        isComplex = false,
+        isStatic = false,
+        isLarge = false,
+        isDummy = false
+    };
+};
+
+
+/*
+   Specialize a specific type with:
+
+     Q_DECLARE_TYPEINFO(type, flags);
+
+   where 'type' is the name of the type to specialize and 'flags' is
+   logically-OR'ed combination of the flags below.
+*/
+enum { /* TYPEINFO flags */
+    Q_COMPLEX_TYPE = 0,
+    Q_PRIMITIVE_TYPE = 0x1,
+    Q_STATIC_TYPE = 0,
+    Q_MOVABLE_TYPE = 0x2,
+    Q_DUMMY_TYPE = 0x4
+};
+
+/*
+   Specialize a shared type with:
+
+     Q_DECLARE_SHARED(type);
+
+   where 'type' is the name of the type to specialize.  NOTE: shared
+   types must declare a 'bool isDetached(void) const;' member for this
+   to work.
+*/
+void qSwap_helper(T)(ref T value1, ref T value2, T*)
+{
+    T t = value1;
+    value1 = value2;
+    value2 = t;
+}
+bool qIsDetached(T)(ref T t) { return t.isDetached(); }
+void qSwap_helper(T)(ref T value1, ref T value2, T*)
+{
+    const T.DataPtr t = value1.data_ptr();
+    value1.data_ptr() = value2.data_ptr();
+    value2.data_ptr() = t;
+}
+void qSwap(T)(ref T value1, ref T value2)
+{
+    const T.DataPtr t = value1.data_ptr();
+    value1.data_ptr() = value2.data_ptr();
+    value2.data_ptr() = t;
+}
+
+/*
+   QTypeInfo primitive specializations
+   TODO(katrina) Find out what we need to do here
+*/
+/*
+Q_DECLARE_TYPEINFO(bool, Q_PRIMITIVE_TYPE);
+Q_DECLARE_TYPEINFO(char, Q_PRIMITIVE_TYPE);
+Q_DECLARE_TYPEINFO(signed char, Q_PRIMITIVE_TYPE);
+Q_DECLARE_TYPEINFO(uchar, Q_PRIMITIVE_TYPE);
+Q_DECLARE_TYPEINFO(short, Q_PRIMITIVE_TYPE);
+Q_DECLARE_TYPEINFO(ushort, Q_PRIMITIVE_TYPE);
+Q_DECLARE_TYPEINFO(int, Q_PRIMITIVE_TYPE);
+Q_DECLARE_TYPEINFO(uint, Q_PRIMITIVE_TYPE);
+Q_DECLARE_TYPEINFO(long, Q_PRIMITIVE_TYPE);
+Q_DECLARE_TYPEINFO(ulong, Q_PRIMITIVE_TYPE);
+Q_DECLARE_TYPEINFO(qint64, Q_PRIMITIVE_TYPE);
+Q_DECLARE_TYPEINFO(quint64, Q_PRIMITIVE_TYPE);
+Q_DECLARE_TYPEINFO(float, Q_PRIMITIVE_TYPE);
+Q_DECLARE_TYPEINFO(double, Q_PRIMITIVE_TYPE);
+#ifndef Q_OS_DARWIN
+Q_DECLARE_TYPEINFO(long double, Q_PRIMITIVE_TYPE);
+#endif
+*/
+/*
+   These functions make it possible to use standard C++ functions with
+   a similar name from Qt header files (especially template classes).
+   TODO(katrina) Implement these
+*/
+void * qMalloc(size_t size);
+void qFree(void * ptr);
+void * qRealloc(void * ptr, size_t size);
+void * qMemCopy(void * dest, void * src, size_t n);
+void * qMemSet(void * dest, int c, size_t n);
+
+struct QFlags(Enum)
+{
+private:
+    alias void **Zero;
+    int i;
+
+public:
+    alias Enum enum_type;
+
+    public static QFlags!(Enum) opCall(Enum)(QFlags f) {
+        QFlags!(Enum) res;
+        res.i = f.i;
+        return res;
+	}
+
+    public static QFlags opCall(Enum)(Enum f) {
+	    QFlags!(Enum) res;
+	    res.i = f;
+		return res;
+	}
+
+    public static QFlags opCall(Enum)(int f) {
+	    QFlags!(Enum) res;
+	    res.i = cast(Enum) f;
+		return res;
+	}
+
+//    this(Zero = 0) : i(0) {}
+//    this(QFlag f) : i(f) {}
+
+//    QFlags!(Enum) opAssign(QFlags f) { i = f.i; return *this; }
+    QFlags!(Enum) opAssign(int f) { i = f; return *this; }
+    QFlags!(Enum) opAndAssign(int mask) { i &= mask; return *this; }
+    QFlags!(Enum) opAndAssign(uint mask) { i &= mask; return *this; }
+    QFlags!(Enum) opOrAssign(QFlags f) { i |= f.i; return *this; }
+    QFlags!(Enum) opOrAssign(Enum f) { i |= f; return *this; }
+    QFlags!(Enum) opXorAssign(QFlags f) { i ^= f.i; return *this; }
+    QFlags!(Enum) opXorAssign(Enum f) { i ^= f; return *this; }
+
+    int toInt() { return i; }
+
+    QFlags!(Enum) opOr(QFlags f) { QFlags g; g.i = i | f.i; return g; }
+    QFlags!(Enum) opOr(Enum f) { QFlags g; g.i = i | f; return g; }
+    QFlags!(Enum) opXor(QFlags f) { QFlags g; g.i = i ^ f.i; return g; }
+    QFlags!(Enum) opXor(Enum f) { QFlags g; g.i = i ^ f; return g; }
+    QFlags!(Enum) opAnd(int mask) { QFlags g; g.i = i & mask; return g; }
+    QFlags!(Enum) opAnd(uint mask) { QFlags g; g.i = i & mask; return g; }
+    QFlags!(Enum) opAnd(Enum f) { QFlags g; g.i = i & f; return g; }
+    QFlags!(Enum) opCom() { QFlags g; g.i = ~i; return g; }
+
+//    bool operator!() { return !i; }
+
+//    bool testFlag(Enum f) { return i & f; }
+}
+
+/* TODO typesafety
+#define Q_DECLARE_FLAGS(Flags, Enum)\
+typedef QFlags<Enum> Flags;
+#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags) \
+QFlags<Flags::enum_type> operator|(Flags::enum_type f1, Flags::enum_type f2) \
+{ return QFlags<Flags::enum_type>(f1) | f2; } \
+QFlags<Flags::enum_type> operator|(Flags::enum_type f1, QFlags<Flags::enum_type> f2) \
+{ return f2 | f1; }
+*/
+
+char[] QT_TR_NOOP(char[] x) { return x; }
+char[] QT_TRANSLATE_NOOP(char[] s, char[] x) { return x; }
+char[] QT_TRANSLATE_NOOP3(char[] s, char[] x, char[] comment) { return x; }
+
+//class QByteArray;
+//QByteArray qgetenv(char[] varName);
+//bool qputenv(char[] varName, QByteArray value);
+
+int qIntCast(double f) { return cast(int)(f); }
+int qIntCast(float f) { return cast(int)(f); }
+
+/*
+  Reentrant versions of basic rand() functions for random number generation
+*/
+void qsrand(uint seed);
+int qrand();
+
+
+/*
+   This gives us the possibility to check which modules the user can
+   use. These are purely compile time checks and will generate no code.
+*/
+
+/* Qt modules */
+
+const ushort QT_MODULE_CORE =                 0x0001;
+const ushort QT_MODULE_GUI =                  0x0002;
+const ushort QT_MODULE_NETWORK =              0x0004;
+const ushort QT_MODULE_OPENGL =               0x0008;
+const ushort QT_MODULE_SQL =                  0x0010;
+const ushort QT_MODULE_XML =                  0x0020;
+const ushort QT_MODULE_QT3SUPPORTLIGHT =      0x0040;
+const ushort QT_MODULE_QT3SUPPORT =           0x0080;
+const ushort QT_MODULE_SVG =                  0x0100;
+const ushort QT_MODULE_ACTIVEQT =             0x0200;
+const ushort QT_MODULE_GRAPHICSVIEW =         0x0400;
+const ushort QT_MODULE_SCRIPT =               0x0800;
+const ushort QT_MODULE_XMLPATTERNS =          0x1000;
+const ushort QT_MODULE_HELP =                 0x2000;
+const ushort QT_MODULE_TEST =                 0x4000;
+const ushort QT_MODULE_DBUS =                 0x8000;
+
+/* Qt editions */
+
+const ushort QT_EDITION_CONSOLE = (QT_MODULE_CORE
+                                 | QT_MODULE_NETWORK
+                                 | QT_MODULE_SQL
+                                 | QT_MODULE_SCRIPT
+                                 | QT_MODULE_XML
+                                 | QT_MODULE_XMLPATTERNS
+                                 | QT_MODULE_TEST
+                                 | QT_MODULE_DBUS);
+const ushort QT_EDITION_DESKTOPLIGHT = (QT_MODULE_CORE
+                                 | QT_MODULE_GUI
+                                 | QT_MODULE_QT3SUPPORTLIGHT
+                                 | QT_MODULE_TEST
+                                 | QT_MODULE_DBUS);
+const ushort QT_EDITION_OPENSOURCE = (QT_MODULE_CORE
+                                 | QT_MODULE_GUI
+                                 | QT_MODULE_NETWORK
+                                 | QT_MODULE_OPENGL
+                                 | QT_MODULE_SQL
+                                 | QT_MODULE_XML
+                                 | QT_MODULE_XMLPATTERNS
+                                 | QT_MODULE_SCRIPT
+                                 | QT_MODULE_QT3SUPPORTLIGHT
+                                 | QT_MODULE_QT3SUPPORT
+                                 | QT_MODULE_SVG
+                                 | QT_MODULE_GRAPHICSVIEW
+                                 | QT_MODULE_HELP
+                                 | QT_MODULE_TEST
+                                 | QT_MODULE_DBUS);
+const ushort QT_EDITION_DESKTOP = (QT_EDITION_OPENSOURCE
+                                 | QT_MODULE_ACTIVEQT);
+const ushort QT_EDITION_UNIVERSAL =   QT_EDITION_DESKTOP;
+const ushort QT_EDITION_ACADEMIC =    QT_EDITION_DESKTOP;
+const ushort QT_EDITION_EDUCATIONAL = QT_EDITION_DESKTOP;
+const ushort QT_EDITION_EVALUATION =  QT_EDITION_DESKTOP;
+
+mixin QT_END_NAMESPACE;
+mixin QT_END_HEADER;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qt/QObjectDefs.d	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,262 @@
+module qt.QObjectDefs;
+
+//import qt.core.QGlobal;
+//import qt.core.Qt;
+import QGlobal;
+
+const byte Q_MOC_OUTPUT_REVISION = 59;
+
+template QT_TR_FUNCTIONS_NOUTF8()
+{
+	static QString tr(char[] s, char[] c = null)
+	{ return staticMetaObject.tr(s, c); }
+	static QString tr(char[] s, char[] c, int n)
+	{ return staticMetaObject.tr(s, c, n); }
+}
+
+template QT_TR_FUNCTIONS_UTF8()
+{
+	static QString trUtf8(char[] s, char[] c = null)
+	{ return staticMetaObject.trUtf8(s, c); }
+	static QString trUtf8(char[] s, char[] c, int n)
+	{ return staticMetaObject.trUtf8(s, c, n); }
+}
+
+template QT_TR_FUNCTIONS()
+{
+	mixin QT_TR_FUNCTIONS_NOUTF8;
+	mixin QT_TR_FUNCTIONS_UTF8;
+}
+
+template Q_OBJECT_CHECK()
+{
+	void qt_check_for_QOBJECT_macro(T)(T _q_argument) const
+	{ int i = qYouForgotTheQ_OBJECT_Macro(this, _q_argument); i = i; }
+}
+
+int qYouForgotTheQ_OBJECT_Macro(T)(T, T) { return 0; }
+
+void qYouForgotTheQ_OBJECT_Macro(T1,T2)(T1, T2) {}
+
+template Q_OBJECT()
+{
+	public mixin Q_OBJECT_CHECK;
+	public static const QMetaObject staticMetaObject;
+	public const QMetaObject *metaObject() const{}
+	public void *qt_metacast(const char *){}
+	public mixin QT_TR_FUNCTIONS;
+	public int qt_metacall(QMetaObject.Call, int, void **){}
+}
+
+template Q_OBJECT_FAKE()
+{
+	mixin Q_OBJECT;
+}
+
+template Q_GADGET()
+{
+    public static const QMetaObject staticMetaObject;
+}
+
+char[] METHOD( char[] a ) { return "0"~a; }
+char[] SLOT( char[] a ) { return "1"~a; }
+char[] SIGNAL( char[] a ) { return "2"~a; }
+
+version(QT3_SUPPORT) {
+	const byte METHOD_CODE = 0;                        // member type codes
+	const byte SLOT_CODE = 1;
+	const byte SIGNAL_CODE = 2;
+}
+
+const byte QMETHOD_CODE = 0;                        // member type codes
+const byte QSLOT_CODE = 1;
+const byte QSIGNAL_CODE = 2;
+
+QArgument!(T) Q_ARG(T)(char [] type, T data)
+	{ return QArgument!(T)(type, data); }
+
+QReturnArgument!(T) Q_RETURN_ARG(T)(char [] type, T data)
+	{ return QReturnArgument!(T)(type, data); }
+
+class QGenericArgument
+{
+public:
+    this(char[] aName = null, const void *aData = null)
+        { _data = aData; _name = aName; }
+    void *data() const { return cast(void *)(_data); }
+    char[] name() { return _name; }
+
+private:
+    const void *_data;
+    char[] _name;
+};
+
+class QGenericReturnArgument : QGenericArgument
+{
+};
+
+class QArgument(T) : QGenericArgument
+{
+public:
+    this(char[] aName, T aData)
+    { this(aName, cast(void *)aData); }
+};
+
+class QReturnArgument(T) : QGenericReturnArgument
+{
+public:
+    this(char[] aName, T aData)
+    { this(aName, cast(void *)aData); }
+};
+
+//TODO(katrina) enable this when all the classes it uses are available
+/*struct QMetaObject
+{
+    char[] className() const;
+    const QMetaObject *superClass() const;
+
+    //TODO(katrina) enable QObject cast(QObject obj) const;
+
+    // ### Qt 4: Merge overloads
+    QString tr(const char *s, const char *c) const;
+    QString trUtf8(const char *s, const char *c) const;
+    QString tr(const char *s, const char *c, int n) const;
+    QString trUtf8(const char *s, const char *c, int n) const;
+
+    int methodOffset() const;
+    int enumeratorOffset() const;
+    int propertyOffset() const;
+    int classInfoOffset() const;
+
+    int methodCount() const;
+    int enumeratorCount() const;
+    int propertyCount() const;
+    int classInfoCount() const;
+
+    int indexOfMethod(const char *method) const;
+    int indexOfSignal(const char *signal) const;
+    int indexOfSlot(const char *slot) const;
+    int indexOfEnumerator(const char *name) const;
+    int indexOfProperty(const char *name) const;
+    int indexOfClassInfo(const char *name) const;
+
+    QMetaMethod method(int index) const;
+    QMetaEnum enumerator(int index) const;
+    QMetaProperty property(int index) const;
+    QMetaClassInfo classInfo(int index) const;
+    QMetaProperty userProperty() const;
+
+    static bool checkConnectArgs(const char *signal, const char *method);
+    static QByteArray normalizedSignature(const char *method);
+    static QByteArray normalizedType(const char *type);
+
+    // internal index-based connect
+    static bool connect(const QObject *sender, int signal_index,
+                        const QObject *receiver, int method_index,
+                        int type = 0, int *types = 0);
+    // internal index-based disconnect
+    static bool disconnect(const QObject *sender, int signal_index,
+                           const QObject *receiver, int method_index);
+    // internal slot-name based connect
+    static void connectSlotsByName(QObject *o);
+
+    // internal index-based signal activation
+    static void activate(QObject *sender, int signal_index, void **argv);
+    static void activate(QObject *sender, int from_signal_index, int to_signal_index, void **argv);
+    static void activate(QObject *sender, const QMetaObject *, int local_signal_index, void **argv);
+    static void activate(QObject *sender, const QMetaObject *, int from_local_signal_index, int to_local_signal_index, void **argv);
+    // internal guarded pointers
+    static void addGuard(QObject **ptr);
+    static void removeGuard(QObject **ptr);
+    static void changeGuard(QObject **ptr, QObject *o);
+
+    static bool invokeMethod(QObject *obj, const char *member,
+                             qt.core.Qt.ConnectionType,
+                             QGenericReturnArgument ret,
+                             QGenericArgument val0 = QGenericArgument(0),
+                             QGenericArgument val1 = QGenericArgument(),
+                             QGenericArgument val2 = QGenericArgument(),
+                             QGenericArgument val3 = QGenericArgument(),
+                             QGenericArgument val4 = QGenericArgument(),
+                             QGenericArgument val5 = QGenericArgument(),
+                             QGenericArgument val6 = QGenericArgument(),
+                             QGenericArgument val7 = QGenericArgument(),
+                             QGenericArgument val8 = QGenericArgument(),
+                             QGenericArgument val9 = QGenericArgument());
+
+    static bool invokeMethod(QObject *obj, const char *member,
+                             QGenericReturnArgument ret,
+                             QGenericArgument val0 = QGenericArgument(0),
+                             QGenericArgument val1 = QGenericArgument(),
+                             QGenericArgument val2 = QGenericArgument(),
+                             QGenericArgument val3 = QGenericArgument(),
+                             QGenericArgument val4 = QGenericArgument(),
+                             QGenericArgument val5 = QGenericArgument(),
+                             QGenericArgument val6 = QGenericArgument(),
+                             QGenericArgument val7 = QGenericArgument(),
+                             QGenericArgument val8 = QGenericArgument(),
+                             QGenericArgument val9 = QGenericArgument())
+    {
+        return invokeMethod(obj, member, qt.core.Qt.AutoConnection, ret, val0, val1, val2, val3,
+                val4, val5, val6, val7, val8, val9);
+    }
+
+    static bool invokeMethod(QObject *obj, const char *member,
+                             qt.core.Qt.ConnectionType type,
+                             QGenericArgument val0 = QGenericArgument(0),
+                             QGenericArgument val1 = QGenericArgument(),
+                             QGenericArgument val2 = QGenericArgument(),
+                             QGenericArgument val3 = QGenericArgument(),
+                             QGenericArgument val4 = QGenericArgument(),
+                             QGenericArgument val5 = QGenericArgument(),
+                             QGenericArgument val6 = QGenericArgument(),
+                             QGenericArgument val7 = QGenericArgument(),
+                             QGenericArgument val8 = QGenericArgument(),
+                             QGenericArgument val9 = QGenericArgument())
+    {
+        return invokeMethod(obj, member, type, QGenericReturnArgument(), val0, val1, val2,
+                                 val3, val4, val5, val6, val7, val8, val9);
+    }
+
+
+    static bool invokeMethod(QObject *obj, const char *member,
+                             QGenericArgument val0 = QGenericArgument(0),
+                             QGenericArgument val1 = QGenericArgument(),
+                             QGenericArgument val2 = QGenericArgument(),
+                             QGenericArgument val3 = QGenericArgument(),
+                             QGenericArgument val4 = QGenericArgument(),
+                             QGenericArgument val5 = QGenericArgument(),
+                             QGenericArgument val6 = QGenericArgument(),
+                             QGenericArgument val7 = QGenericArgument(),
+                             QGenericArgument val8 = QGenericArgument(),
+                             QGenericArgument val9 = QGenericArgument())
+    {
+        return invokeMethod(obj, member, qt.core.Qt.AutoConnection, QGenericReturnArgument(), val0,
+                val1, val2, val3, val4, val5, val6, val7, val8, val9);
+    }
+
+    enum Call {
+        InvokeMetaMethod,
+        ReadProperty,
+        WriteProperty,
+        ResetProperty,
+        QueryPropertyDesignable,
+        QueryPropertyScriptable,
+        QueryPropertyStored,
+        QueryPropertyEditable,
+        QueryPropertyUser
+    };
+
+version(QT3_SUPPORT) {
+    const char *superClassName() const;
+}
+
+    struct d_struct{ // private data
+        const QMetaObject *superdata;
+        const char *stringdata;
+        const uint *data;
+        const QMetaObject **extradata;
+    };
+    d_struct d;
+};
+*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qt/QtDObject.d	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,70 @@
+/**
+*
+*  Copyright: Copyright QtD Team, 2008-2009
+*  License: <a href="http://www.boost.org/LICENSE_1_0.txt>Boost License 1.0</a>
+*
+*  Copyright QtD Team, 2008-2009
+*  Distributed under the Boost Software License, Version 1.0.
+*  (See accompanying file boost-license-1.0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+*
+*/
+
+module qt.QtDObject;
+
+//import tango.util.container.HashMap;
+import qt.Signal;
+
+package class QtDObject
+{
+    public final void* nativeId() { return native__id; }
+
+	public final void nativeId(void *native_id) { native__id = native_id; }
+
+	private void* native__id = null;
+
+    mixin SignalHandlerOps;
+
+    public this()
+    {
+        /* intentionally empty */
+    }
+
+    package this(void* native_id, bool no_real_delete = false)
+    {
+        native__id = native_id;
+/*		auto qObj = cast(QObject) this;
+		if (qObj is null)
+		    register(native__id);*/
+        __no_real_delete = no_real_delete;
+    }
+/*
+	~this() {
+	    unregister(native__id);
+	}
+*/
+    // this flag controls if D object when destroying should or shouldn't delete real C++ object
+	public bool __no_real_delete = false;
+
+    package void __free_native_resources();
+
+
+	/*          hash table of Object instances            */
+/*    private static HashMap!(void*, Object) _map;
+
+	static this() {
+        _map = new HashMap!(void*, Object);
+	}
+
+	package static void register(void* qt_object, Object d_object) {
+	    _map.add(qt_object, d_object);
+	}
+
+	package static void unregister(void* qt_object) {
+	    _map.removeKey(qt_object);
+	}
+
+	package static Object lookup(void* qt_object) {
+	    return _map[qt_object];
+	}
+	*/
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qt/Signal.d	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,17 @@
+/**
+ *
+ *  Copyright: Copyright QtD Team, 2008-2009
+ *  Authors: Max Samukha, Eldar Insafutdinov
+ *  License: <a href="http://www.boost.org/LICENSE_1_0.txt>Boost License 1.0</a>
+ *
+ *  Copyright QtD Team, 2008-2009
+ *  Distributed under the Boost Software License, Version 1.0.
+ *  (See accompanying file boost-license-1.0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ */
+module qt.Signal;
+
+version (D_Version2)
+    public import qt.d2.Signal;
+else
+    public import qt.d1.Signal;
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qt/boost-license-1.0.txt	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,23 @@
+Boost Software License - Version 1.0 - August 17th, 2003
+
+Permission is hereby granted, free of charge, to any person or organization
+obtaining a copy of the software and accompanying documentation covered by
+this license (the "Software") to use, reproduce, display, distribute,
+execute, and transmit the Software, and to prepare derivative works of the
+Software, and to permit third-parties to whom the Software is furnished to
+do so, all subject to the following:
+
+The copyright notices in the Software and this entire statement, including
+the above license grant, this restriction and the following disclaimer,
+must be included in all copies of the Software, in whole or in part, and
+all derivative works of the Software, unless such copies or derivative
+works are solely in the form of machine-executable object code generated by
+a source language processor.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
+SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
+FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qt/core/CMakeLists.txt	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,10 @@
+set(QT_CORE_SRCS_D
+Qt.d
+QChildEvent.d
+QCoreApplication.d
+QEvent.d
+QEventLoop.d
+QObject.d
+QTimerEvent.d
+QTranslator.d
+)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qt/core/QModelIndex.d	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,127 @@
+module qt.core.QModelIndex;
+
+public import qt.QGlobal;
+private import qt.QtDObject;
+
+// automatic imports-------------
+private import qt.core.QVariant;
+private import qt.core.QAbstractItemModel;
+public import qt.core.Qt;
+
+version (Tango)
+{
+    import tango.core.Array;
+    import tango.stdc.stringz;
+    import tango.text.convert.Utf;
+}
+
+
+public struct QModelIndex
+{
+
+    public static QModelIndex opCall() {
+         QModelIndex mi;
+	     mi.r = mi.c = -1;
+         mi.p = mi.m = null;
+         return mi;
+    }
+    public final QModelIndex child(int row, int column) {
+        return __qtd_QModelIndex_child_int_int(this, row, column);
+    }
+
+    public final int column() {
+        return __qtd_QModelIndex_column(this);
+    }
+
+    public final QVariant data(int role = 0) {
+        void* __qt_return_value = __qtd_QModelIndex_data_int(this, role);
+        return new QVariant(__qt_return_value, false);
+    }
+
+    public final int flags() {
+        return __qtd_QModelIndex_flags(this);
+    }
+
+    public final long internalId() {
+        return __qtd_QModelIndex_internalId(this);
+    }
+
+    public final void* internalPointer() {
+        //return __qtd_QModelIndex_internalPointer(this);
+		return p;
+    }
+
+	public final Object object() {
+	    return cast(Object) p;
+	}
+
+    public final bool isValid() {
+        return __qtd_QModelIndex_isValid(this);
+    }
+
+    public final QAbstractItemModel model() {
+//        void* __qt_return_value = __qtd_QModelIndex_model(this);
+        void* __qt_return_value = m;
+        if (__qt_return_value is null)
+            return null;
+        void* d_obj = __QObject_entity(__qt_return_value);
+        return cast(QAbstractItemModel) d_obj;
+    }
+
+    private final bool operator_less(QModelIndex other) {
+        return __qtd_QModelIndex_operator_less_QModelIndex(this, other);
+    }
+
+    private final bool operator_equal(QModelIndex other) {
+        return __qtd_QModelIndex_operator_equal_QModelIndex(this, other);
+    }
+
+    public final QModelIndex parent() {
+        return __qtd_QModelIndex_parent(this);
+    }
+
+    public final int row() {
+        return __qtd_QModelIndex_row(this);
+    }
+
+    public final QModelIndex sibling(int row, int column) {
+        return __qtd_QModelIndex_sibling_int_int(this, row, column);
+    }
+
+private:
+    int r;
+	int c;
+	void *p;
+    void *m;
+}
+
+alias QModelIndex QModelIndexAccessor;
+
+
+// C wrappers
+private extern(C) void* __qtd_QModelIndex_QModelIndex_QModelIndex(QModelIndex other0);
+private extern(C) QModelIndex  __qtd_QModelIndex_child_int_int(void* __this_nativeId,
+ int row0,
+ int column1);
+private extern(C) int  __qtd_QModelIndex_column(void* __this_nativeId);
+private extern(C) void*  __qtd_QModelIndex_data_int(void* __this_nativeId,
+ int role0);
+private extern(C) int  __qtd_QModelIndex_flags(void* __this_nativeId);
+private extern(C) long  __qtd_QModelIndex_internalId(void* __this_nativeId);
+private extern(C) void*  __qtd_QModelIndex_internalPointer(void* __this_nativeId);
+private extern(C) bool  __qtd_QModelIndex_isValid(void* __this_nativeId);
+private extern(C) void*  __qtd_QModelIndex_model(void* __this_nativeId);
+private extern(C) bool  __qtd_QModelIndex_operator_less_QModelIndex(void* __this_nativeId,
+ QModelIndex other0);
+private extern(C) bool  __qtd_QModelIndex_operator_equal_QModelIndex(void* __this_nativeId,
+ QModelIndex other0);
+private extern(C) QModelIndex  __qtd_QModelIndex_parent(void* __this_nativeId);
+private extern(C) int  __qtd_QModelIndex_row(void* __this_nativeId);
+private extern(C) QModelIndex  __qtd_QModelIndex_sibling_int_int(void* __this_nativeId,
+ int row0,
+ int column1);
+// Just the private functions for abstract functions implemeneted in superclasses
+
+
+
+// Virtual Dispatch functions
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qt/core/QPoint.d	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,228 @@
+module qt.core.QPoint;
+
+public import qt.QGlobal;
+public import qt.core.Qt;
+public import qt.core.QDataStream;
+
+public struct QPoint
+{
+
+// Functions
+    public static QPoint opCall() {
+        QPoint pt;
+        pt.xp = pt.yp = 0;
+        return pt;
+    }
+
+    public static QPoint opCall(int xpos, int ypos) {
+        QPoint pt;
+        pt.xp = xpos;
+        pt.yp = ypos;
+        return pt;
+    }
+
+    bool isNull() // const
+    { return xp == 0 && yp == 0; }
+
+    int x() // const
+    { return xp; }
+
+    int y() // const
+    { return yp; }
+
+    void x(int xpos)
+    { xp = xpos; }
+
+    void y(int ypos)
+    { yp = ypos; }
+    
+    public final int manhattanLength() {
+        return qtd_QPoint_manhattanLength(this);
+    }
+/*
+inline int &rx()
+{ return xp; }
+
+inline int &ry()
+{ return yp; }
+*/
+
+    QPoint opAddAssign(ref QPoint p)
+    { xp+=p.xp; yp+=p.yp; return *this; }
+
+    QPoint opSubAssign(ref QPoint p)
+    { xp-=p.xp; yp-=p.yp; return *this; }
+
+    QPoint opMulAssign(qreal c)
+    { xp = qRound(xp*c); yp = qRound(yp*c); return *this; }
+    
+    bool opEquals(ref QPoint p1, ref QPoint p2)
+    { return p1.xp == p2.xp && p1.yp == p2.yp; }
+
+    QPoint opAdd(ref QPoint p)
+    { return QPoint(this.xp+p.xp, this.yp+p.yp); }
+
+    QPoint opSub(ref QPoint p)
+    { return QPoint(this.xp-p.xp, this.yp-p.yp); }
+    
+    QPoint opMul(qreal c)
+    { return QPoint(qRound(this.xp*c), qRound(this.yp*c)); }
+
+    QPoint opDivAssign(qreal c)
+    {
+        xp = qRound(xp/c);
+        yp = qRound(yp/c);
+        return *this;
+    }
+
+    QPoint opDiv(qreal c)
+    {
+        return QPoint(qRound(this.xp/c), qRound(this.yp/c));
+    }
+
+    public final void writeTo(QDataStream arg__1) {
+        qtd_QPoint_writeTo_QDataStream(this, arg__1 is null ? null : arg__1.nativeId);
+    }
+
+    public final void readFrom(QDataStream arg__1) {
+        qtd_QPoint_readFrom_QDataStream(this, arg__1 is null ? null : arg__1.nativeId);
+    }
+
+private:
+    // ### Qt 5;  remove the ifdef and just have the same order on all platforms.
+    version(OSX)
+    {
+        int yp;
+        int xp;
+    }
+    else
+    {
+        int xp;
+        int yp;
+    }
+}
+
+
+public struct QPointF
+{
+    public static QPointF opCall() {
+        QPointF pt;
+        pt.xp = pt.yp = 0;
+        return pt;
+    }
+    
+    public static QPointF opCall(qreal xpos, qreal ypos) {
+        QPointF pt;
+        pt.xp = xpos;
+        pt.yp = ypos;
+        return pt;
+    }
+    
+    public static QPointF opCall(ref QPoint p) {
+        QPointF pt;
+        pt.xp = p.x();
+        pt.yp = p.y();
+        return pt;
+    }
+    
+    bool isNull() //const
+    {
+        return qIsNull(xp) && qIsNull(yp);
+    }
+    
+    qreal x() //const
+    {
+        return xp;
+    }
+    
+    qreal y() //const
+    {
+        return yp;
+    }
+    
+    void x(qreal xpos)
+    {
+        xp = xpos;
+    }
+    
+    void y(qreal ypos)
+    {
+        yp = ypos;
+    }
+/*    
+inline qreal &QPointF::rx()
+{
+        return xp;
+}
+
+inline qreal &QPointF::ry()
+{
+    return yp;
+}
+*/
+    
+    QPointF opAddAssign(ref QPointF p)
+    { xp+=p.xp; yp+=p.yp; return *this; }
+    
+    QPointF opSubAssign(ref QPointF p)
+    { xp-=p.xp; yp-=p.yp; return *this; }
+    
+    QPointF opMulAssign(qreal c)
+    { xp*=c; yp*=c; return *this; }
+    
+    bool opEquals(ref QPointF p1, ref QPointF p2)
+    { return qFuzzyCompare(p1.xp, p2.xp) && qFuzzyCompare(p1.yp, p2.yp); }
+    
+    QPointF opAdd(ref QPointF p)
+    { return QPointF(this.xp+p.xp, this.yp+p.yp); }
+    
+    QPointF opSub(ref QPointF p)
+    { return QPointF(this.xp-p.xp, this.yp-p.yp); }
+    
+    QPointF opMul(qreal c)
+    { return QPointF(this.xp*c, this.yp*c); }
+    
+    QPointF opDivAssign(qreal c)
+    {
+        xp/=c;
+        yp/=c;
+        return *this;
+    }
+    
+    QPointF opDiv(qreal c)
+    {
+        return QPointF(xp/c, yp/c);
+    }
+    
+    QPoint toPoint() //const
+    {
+        return QPoint(qRound(xp), qRound(yp));
+    }
+    
+    public final void writeTo(QDataStream arg__1) {
+        qtd_QPointF_writeTo_QDataStream(this, arg__1 is null ? null : arg__1.nativeId);
+    }
+    
+    public final void readFrom(QDataStream arg__1) {
+        qtd_QPointF_readFrom_QDataStream(this, arg__1 is null ? null : arg__1.nativeId);
+    }
+    
+private:
+    qreal xp;
+    qreal yp;
+}
+
+
+// C wrappers
+// QPoint
+private extern(C) int  qtd_QPoint_manhattanLength(void* __this_nativeId);
+private extern(C) void  qtd_QPoint_writeTo_QDataStream(void* __this_nativeId,
+ void* arg__1);
+private extern(C) void  qtd_QPoint_readFrom_QDataStream(void* __this_nativeId,
+ void* arg__1);
+
+// QPointF
+private extern(C) void  qtd_QPointF_writeTo_QDataStream(void* __this_nativeId,
+ void* arg__1);
+private extern(C) void  qtd_QPointF_readFrom_QDataStream(void* __this_nativeId,
+ void* arg__1);
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qt/core/QPointF.d	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,4 @@
+module qt.core.QPointF;
+/* dummy */
+
+public import qt.core.QPoint;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qt/core/QSize.d	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,276 @@
+module qt.core.QSize;
+
+public import qt.QGlobal;
+public import qt.core.Qt;
+
+
+public struct QSize
+{
+/* ctors, reserved for D2
+    public this()
+    { wd = ht = -1; }
+
+    public this(int w, int h)
+    { wd = w; ht = h; }
+*/
+
+    public static QSize opCall() {
+    	QSize sz;
+    	sz.wd = sz.ht = -1;
+    	return sz;
+    }
+
+    public static QSize opCall(int w, int h) {
+    	QSize sz;
+    	sz.wd = w;
+    	sz.ht = h;
+    	return sz;
+    }
+
+    final bool isNull()
+    { return wd==0 && ht==0; }
+    
+    final bool isEmpty()
+    { return wd<1 || ht<1; }
+    
+    final bool isValid()
+    { return wd>=0 && ht>=0; }
+
+    final int width()
+    { return wd; }
+    
+    final int height()
+    { return ht; }
+    
+    final void width(int w)
+    { wd = w; }
+    
+    final void height(int h)
+    { ht = h; }
+
+    final void setWidth(int w)
+    { wd = w; }
+    
+    void setHeight(int h)
+    { ht = h; }
+    
+    void transpose() {
+		int tmp = wd;
+		wd = ht;
+		ht = tmp;
+	}
+
+    void scale(int w, int h, Qt.AspectRatioMode mode) {
+    	scale(QSize(w, h), mode);
+    }
+    
+    void scale(ref QSize s, Qt.AspectRatioMode mode) {
+    	__qtd_QSize_scale_QSize_AspectRatioMode(this, &s, mode);
+    }
+
+    QSize expandedTo(ref QSize otherSize) {
+        return QSize(qMax(wd,otherSize.wd), qMax(ht,otherSize.ht));
+	}
+
+    QSize boundedTo(ref QSize otherSize) {
+    	return QSize(qMin(wd,otherSize.wd), qMin(ht,otherSize.ht));
+	}
+/*
+    public final void writeTo(QDataStream arg__1)    {
+        __qtd_QSize_writeTo_QDataStream(this, arg__1 is null ? null : arg__1.nativeId);
+    }
+
+    public final void readFrom(QDataStream arg__1)    {
+        __qtd_QSize_readFrom_QDataStream(this, arg__1 is null ? null : arg__1.nativeId);
+    }
+*/
+	QSize opAddAssign(ref QSize s)
+	{ wd+=s.wd; ht+=s.ht; return *this; }
+
+	QSize opSubAssign(ref QSize s)
+	{ wd-=s.wd; ht-=s.ht; return *this; }
+
+	QSize opMulAssign(qreal c)
+	{ wd = qRound(wd*c); ht = qRound(ht*c); return *this; }
+
+	bool opEquals(ref QSize s1, ref QSize s2)
+	{ return s1.wd == s2.wd && s1.ht == s2.ht; }
+
+	QSize opAdd(ref QSize s)
+	{ return QSize(this.wd+s.wd, this.ht+s.ht); }
+
+	QSize opSub(ref QSize s)
+	{ return QSize(this.wd-s.wd, this.ht-s.ht); }
+
+	QSize opMul(qreal c)
+	{ return QSize(qRound(this.wd*c), qRound(this.ht*c)); }
+
+	QSize opDivAssign(qreal c) {
+    	assert(!qFuzzyCompare(c + 1, 1.));
+    	wd = qRound(wd/c); ht = qRound(ht/c);
+    	return *this;
+	}
+
+	QSize opDiv(qreal c) {
+    	assert(!qFuzzyCompare(c + 1, 1.));
+    	return QSize(qRound(this.wd/c), qRound(this.ht/c));
+	}
+
+private:
+    int wd;
+    int ht;
+}
+
+
+public struct QSizeF
+{
+/* ctors, reserved for D2
+	this()
+	{ wd = ht = -1.; }
+
+	this(ref QSize sz)
+	{ wd = sz.width(); ht = sz.height(); }
+
+	this(qreal w, qreal h)
+	{ wd = w; ht = h; }
+*/
+	public static QSizeF opCall() {
+    	QSizeF sz;
+		sz.wd = sz.ht = -1.;
+		return sz;
+	}
+
+	public static QSizeF opCall(ref QSizeF s) {
+		QSizeF sz;
+		sz.wd = s.width(); sz.ht = s.height();
+		return sz;
+	}
+
+	public static QSizeF opCall(qreal w, qreal h) {
+		QSizeF sz;
+		sz.wd = w; sz.ht = h;
+		return sz;
+	}
+
+	bool isNull()
+	{ return qIsNull(wd) && qIsNull(ht); }
+
+	bool isEmpty()
+	{ return wd <= 0. || ht <= 0.; }
+
+	bool isValid()
+	{ return wd >= 0. && ht >= 0.; }
+
+	qreal width()
+	{ return wd; }
+
+	qreal height()
+	{ return ht; }
+
+	void width(qreal w)
+	{ wd = w; }
+
+	void height(qreal h)
+	{ ht = h; }
+
+	void setWidth(qreal w)
+	{ wd = w; }
+
+	void setHeight(qreal h)
+	{ ht = h; }
+
+	void scale(qreal w, qreal h, Qt.AspectRatioMode mode)
+	{ scale(QSizeF(w, h), mode); }
+
+    public final void scale(QSizeF s, Qt.AspectRatioMode mode)
+    { __qtd_QSizeF_scale_QSizeF_AspectRatioMode(this, &s, mode); }
+
+	void transpose() {
+    	qreal tmp = wd;
+    	wd = ht;
+    	ht = tmp;
+	}
+
+	QSizeF expandedTo(ref QSizeF otherSize)
+	{ return QSizeF(qMax(wd,otherSize.wd), qMax(ht,otherSize.ht)); }
+
+	QSizeF boundedTo(ref QSizeF otherSize)
+	{ return QSizeF(qMin(wd,otherSize.wd), qMin(ht,otherSize.ht)); }
+
+	QSize toSize()
+	{ return QSize(qRound(wd), qRound(ht));	}
+/*
+    public final void writeTo(QDataStream arg__1) {
+        __qtd_QSizeF_writeTo_QDataStream(this, arg__1 is null ? null : arg__1.nativeId);
+    }
+
+    public final void readFrom(QDataStream arg__1) {
+        __qtd_QSizeF_readFrom_QDataStream(this, arg__1 is null ? null : arg__1.nativeId);
+*/
+	QSizeF opAddAssign(ref QSizeF s)
+	{ wd += s.wd; ht += s.ht; return *this; }
+
+	QSizeF opSubAssign(ref QSizeF s)
+	{ wd -= s.wd; ht -= s.ht; return *this; }
+
+	QSizeF opMulAssign(qreal c)
+	{ wd *= c; ht *= c; return *this; }
+
+	bool opEquals(ref QSizeF s1, ref QSizeF s2)
+	{ return qFuzzyCompare(s1.wd, s2.wd) && qFuzzyCompare(s1.ht, s2.ht); }
+
+	QSizeF opAdd(ref QSizeF s)
+	{ return QSizeF(this.wd+s.wd, this.ht+s.ht); }
+
+	QSizeF opSub(ref QSizeF s)
+	{ return QSizeF(this.wd-s.wd, this.ht-s.ht); }
+
+	QSizeF opMul(qreal c)
+	{ return QSizeF(this.wd*c, this.ht*c); }
+
+	QSizeF opDivAssign(qreal c)
+	{
+	    assert(!qFuzzyCompare(c + 1, 1.));
+	    wd = wd/c; ht = ht/c;
+	    return *this;
+	}
+
+	QSizeF opDiv(qreal c)
+	{
+	    assert(!qFuzzyCompare(c + 1, 1.));
+	    return QSizeF(this.wd/c, this.ht/c);
+	}
+
+private:
+    qreal wd;
+    qreal ht;
+}
+
+extern (C) void qtd_append_array_QSize(QSize[]* arr, QSize arg)
+{
+    *arr ~= arg;
+}
+
+extern (C) void qtd_append_array_QSizeF(QSizeF[]* arr, QSizeF arg)
+{
+    *arr ~= arg;
+}
+
+// C wrappers
+// QSize
+private extern(C) void  __qtd_QSize_scale_QSize_AspectRatioMode(void* __this_nativeId,
+ void* s0,
+ int mode1);
+private extern(C) void  __qtd_QSize_writeTo_QDataStream(void* __this_nativeId,
+ void* arg__1);
+private extern(C) void  __qtd_QSize_readFrom_QDataStream(void* __this_nativeId,
+ void* arg__1);
+
+// QSizeF
+private extern(C) void  __qtd_QSizeF_writeTo_QDataStream(void* __this_nativeId,
+ void* arg__1);
+private extern(C) void  __qtd_QSizeF_readFrom_QDataStream(void* __this_nativeId,
+ void* arg__1);
+private extern(C) void  __qtd_QSizeF_scale_QSizeF_AspectRatioMode(void* __this_nativeId,
+ void* s0,
+ int mode1);
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qt/core/QSizeF.d	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,4 @@
+module qt.core.QSizeF;
+/* dummy */
+
+public import qt.core.QSize;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qt/core/QString.d	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,37 @@
+module qt.core.QString;
+
+version (Tango)
+{
+    import tango.text.convert.Utf : toString;
+}
+else
+{
+    import std.utf : toString = toUTF8;
+}
+
+class QString
+{
+    private void* native_id;
+    
+    public static final char[] toNativeString(void* qstring) {
+        wchar* arr = __qtd_QString_utf16(qstring);
+        int size = __qtd_QString_size(qstring);
+        return .toString(arr[0..size]);
+    }
+    
+    public final char[] toNativeString() {
+        return toNativeString(native_id);
+    }
+    
+    public this(void* ptr, bool proxy) {
+        native_id = ptr;
+    }
+    
+    public void assign(char[] text) {
+        __qtd_QString_operatorAssign(native_id, text.ptr, text.length);
+    }
+}
+
+private extern (C) wchar* __qtd_QString_utf16(void* __this_nativeId);
+private extern (C) int __qtd_QString_size(void* __this_nativeId);
+private extern (C) void __qtd_QString_operatorAssign(void* __this_nativeId, char* text, uint text_size);
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qt/core/QVariant.d	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,541 @@
+module qt.core.QVariant;
+
+public import qt.QGlobal;
+private import qt.QtDObject;
+
+// automatic imports-------------
+private import qt.core.QSizeF;
+private import qt.core.QPoint;
+private import qt.core.QRectF;
+public import qt.core.Qt;
+private import qt.core.QDateTime;
+private import qt.core.QDataStream;
+private import qt.core.QTime;
+private import qt.core.QUrl;
+private import qt.core.QRegExp;
+private import qt.core.QBitArray;
+private import qt.core.QLine;
+private import qt.core.QByteArray;
+private import qt.core.QSize;
+private import qt.core.QDate;
+private import qt.core.QPointF;
+private import qt.core.QLineF;
+private import qt.core.QRect;
+private import qt.core.QLocale;
+
+version (Tango)
+{
+    import tango.core.Array;
+    import tango.stdc.stringz;
+    import tango.text.convert.Utf;
+}
+
+
+public class QVariant : QtDObject
+{
+    enum Type {
+        Invalid = 0,
+
+        Bool = 1,
+        Int = 2,
+        UInt = 3,
+        LongLong = 4,
+        ULongLong = 5,
+        Double = 6,
+        Char = 7,
+        Map = 8,
+        List = 9,
+        String = 10,
+        StringList = 11,
+        ByteArray = 12,
+        BitArray = 13,
+        Date = 14,
+        Time = 15,
+        DateTime = 16,
+        Url = 17,
+        Locale = 18,
+        Rect = 19,
+        RectF = 20,
+        Size = 21,
+        SizeF = 22,
+        Line = 23,
+        LineF = 24,
+        Point = 25,
+        PointF = 26,
+        RegExp = 27,
+        LastCoreType = RegExp,
+
+        // value 62 is internally reserved
+
+        Font = 64,
+        Pixmap = 65,
+        Brush = 66,
+        Color = 67,
+        Palette = 68,
+        Icon = 69,
+        Image = 70,
+        Polygon = 71,
+        Region = 72,
+        Bitmap = 73,
+        Cursor = 74,
+        SizePolicy = 75,
+        KeySequence = 76,
+        Pen = 77,
+        TextLength = 78,
+        TextFormat = 79,
+        Matrix = 80,
+        Transform = 81,
+        LastGuiType = Transform,
+
+        UserType = 127,
+
+        LastType = 0xffffffff // need this so that gcc >= 3.4 allocates 32 bits for Type
+    }
+
+// Functions
+
+    public this() {
+        void* __qt_return_value = qtd_QVariant_QVariant();
+        super(__qt_return_value);
+    }
+
+
+    public this(QDataStream s) {
+        void* __qt_return_value = qtd_QVariant_QVariant_QDataStream(s is null ? null : s.nativeId);
+        super(__qt_return_value);
+    }
+
+
+    public this(Qt.GlobalColor color) {
+        void* __qt_return_value = qtd_QVariant_QVariant_GlobalColor(color);
+        super(__qt_return_value);
+    }
+
+
+    public this(bool b) {
+        void* __qt_return_value = qtd_QVariant_QVariant_bool(b);
+        super(__qt_return_value);
+    }
+
+
+    public this(QBitArray bitarray) {
+        void* __qt_return_value = qtd_QVariant_QVariant_QBitArray(bitarray is null ? null : bitarray.nativeId);
+        super(__qt_return_value);
+    }
+
+
+    public this(QByteArray bytearray) {
+        void* __qt_return_value = qtd_QVariant_QVariant_QByteArray(bytearray is null ? null : bytearray.nativeId);
+        super(__qt_return_value);
+    }
+
+
+    public this(QDate date) {
+        void* __qt_return_value = qtd_QVariant_QVariant_QDate(date is null ? null : date.nativeId);
+        super(__qt_return_value);
+    }
+
+
+    public this(QDateTime datetime) {
+        void* __qt_return_value = qtd_QVariant_QVariant_QDateTime(datetime is null ? null : datetime.nativeId);
+        super(__qt_return_value);
+    }
+
+
+    public this(char[] str) {
+        void* __qt_return_value = qtd_QVariant_QVariant_String(str.ptr, str.length);
+        super(__qt_return_value);
+    }
+
+
+    public this(QLine line) {
+        void* __qt_return_value = qtd_QVariant_QVariant_QLine(line is null ? null : line.nativeId);
+        super(__qt_return_value);
+    }
+
+
+    public this(QLineF line) {
+        void* __qt_return_value = qtd_QVariant_QVariant_QLineF(line is null ? null : line.nativeId);
+        super(__qt_return_value);
+    }
+
+
+    public this(QLocale locale) {
+        void* __qt_return_value = qtd_QVariant_QVariant_QLocale(locale is null ? null : locale.nativeId);
+        super(__qt_return_value);
+    }
+
+
+    public this(QPoint pt) {
+        void* __qt_return_value = qtd_QVariant_QVariant_QPoint(&pt);
+        super(__qt_return_value);
+    }
+
+
+    public this(QPointF pt) {
+        void* __qt_return_value = qtd_QVariant_QVariant_QPointF(&pt);
+        super(__qt_return_value);
+    }
+
+
+    public this(QRect rect) {
+        void* __qt_return_value = qtd_QVariant_QVariant_QRect(rect is null ? null : rect.nativeId);
+        super(__qt_return_value);
+    }
+
+
+    public this(QRectF rect) {
+        void* __qt_return_value = qtd_QVariant_QVariant_QRectF(rect is null ? null : rect.nativeId);
+        super(__qt_return_value);
+    }
+
+
+    public this(QRegExp regExp) {
+        void* __qt_return_value = qtd_QVariant_QVariant_QRegExp(regExp is null ? null : regExp.nativeId);
+        super(__qt_return_value);
+    }
+
+
+    public this(QSize size) {
+        void* __qt_return_value = qtd_QVariant_QVariant_QSize(&size);
+        super(__qt_return_value);
+    }
+
+
+    public this(QSizeF size) {
+        void* __qt_return_value = qtd_QVariant_QVariant_QSizeF(&size);
+        super(__qt_return_value);
+    }
+
+
+    public this(QTime time) {
+        void* __qt_return_value = qtd_QVariant_QVariant_QTime(time is null ? null : time.nativeId);
+        super(__qt_return_value);
+    }
+
+
+    public this(QUrl url) {
+        void* __qt_return_value = qtd_QVariant_QVariant_QUrl(url is null ? null : url.nativeId);
+        super(__qt_return_value);
+    }
+
+
+    public this(QVariant other) {
+        void* __qt_return_value = qtd_QVariant_QVariant_QVariant(other is null ? null : other.nativeId);
+        super(__qt_return_value);
+    }
+
+
+    public this(char* str) {
+        void* __qt_return_value = qtd_QVariant_QVariant_nativepointerchar(str);
+        super(__qt_return_value);
+    }
+
+
+    public this(double d) {
+        void* __qt_return_value = qtd_QVariant_QVariant_double(d);
+        super(__qt_return_value);
+    }
+
+
+    public this(int i) {
+        void* __qt_return_value = qtd_QVariant_QVariant_int(i);
+        super(__qt_return_value);
+    }
+
+
+    public this(int typeOrUserType, void* copy) {
+        void* __qt_return_value = qtd_QVariant_QVariant_int_nativepointervoid(typeOrUserType, copy);
+        super(__qt_return_value);
+    }
+
+
+    public this(long ll) {
+        void* __qt_return_value = qtd_QVariant_QVariant_long(ll);
+        super(__qt_return_value);
+    }
+
+
+    public this(uint ui) {
+        void* __qt_return_value = qtd_QVariant_QVariant_uint(ui);
+        super(__qt_return_value);
+    }
+
+
+    public this(ulong ull) {
+        void* __qt_return_value = qtd_QVariant_QVariant_ulong(ull);
+        super(__qt_return_value);
+    }
+
+
+    public final bool canConvert(Type type) {
+        return qtd_QVariant_canConvert(nativeId, type);
+    }
+
+    public final void clear() {
+        qtd_QVariant_clear(nativeId);
+    }
+
+    protected final bool cmp(QVariant other) {
+        return qtd_QVariant_cmp_QVariant(nativeId, other is null ? null : other.nativeId);
+    }
+
+    protected final void create(int type, void* copy) {
+        qtd_QVariant_create_int_nativepointervoid(nativeId, type, copy);
+    }
+
+    public final bool isNull() {
+        return qtd_QVariant_isNull(nativeId);
+    }
+
+    public final bool isValid() {
+        return qtd_QVariant_isValid(nativeId);
+    }
+
+    public final void load(QDataStream ds) {
+        qtd_QVariant_load_QDataStream(nativeId, ds is null ? null : ds.nativeId);
+    }
+
+    public final void writeTo(QDataStream s) {
+        qtd_QVariant_writeTo_QDataStream(nativeId, s is null ? null : s.nativeId);
+    }
+
+    public final QVariant operator_assign(QVariant other) {
+        void* __qt_return_value = qtd_QVariant_operator_assign_QVariant(nativeId, other is null ? null : other.nativeId);
+        return new QVariant(__qt_return_value, true);
+    }
+
+    private final bool operator_equal(QVariant v) {
+        return qtd_QVariant_operator_equal_QVariant(nativeId, v is null ? null : v.nativeId);
+    }
+
+    public final void readFrom(QDataStream s) {
+        qtd_QVariant_readFrom_QDataStream(nativeId, s is null ? null : s.nativeId);
+    }
+
+    public final void save(QDataStream ds) {
+        qtd_QVariant_save_QDataStream(nativeId, ds is null ? null : ds.nativeId);
+    }
+
+    public final QBitArray toBitArray() {
+        void* __qt_return_value = qtd_QVariant_toBitArray(nativeId);
+        return new QBitArray(__qt_return_value, false);
+    }
+
+    public final bool toBool() {
+        return qtd_QVariant_toBool(nativeId);
+    }
+
+    public final QByteArray toByteArray() {
+        void* __qt_return_value = qtd_QVariant_toByteArray(nativeId);
+        return new QByteArray(__qt_return_value, false);
+    }
+
+    public final QDate toDate() {
+        void* __qt_return_value = qtd_QVariant_toDate(nativeId);
+        return new QDate(__qt_return_value, false);
+    }
+
+    public final QDateTime toDateTime() {
+        void* __qt_return_value = qtd_QVariant_toDateTime(nativeId);
+        return new QDateTime(__qt_return_value, false);
+    }
+
+    public final double toDouble(bool* ok = null) {
+        return qtd_QVariant_toDouble_nativepointerbool(nativeId, ok);
+    }
+
+    public final int toInt(bool* ok = null) {
+        return qtd_QVariant_toInt_nativepointerbool(nativeId, ok);
+    }
+
+    public final QLine toLine() {
+        void* __qt_return_value = qtd_QVariant_toLine(nativeId);
+        return new QLine(__qt_return_value, false);
+    }
+
+    public final QLineF toLineF() {
+        void* __qt_return_value = qtd_QVariant_toLineF(nativeId);
+        return new QLineF(__qt_return_value, false);
+    }
+
+    public final QLocale toLocale() {
+        void* __qt_return_value = qtd_QVariant_toLocale(nativeId);
+        return new QLocale(__qt_return_value, false);
+    }
+
+    public final long toLongLong(bool* ok = null) {
+        return qtd_QVariant_toLongLong_nativepointerbool(nativeId, ok);
+    }
+
+    public final QPoint toPoint() {
+        return qtd_QVariant_toPoint(nativeId);
+    }
+
+    public final QPointF toPointF() {
+        return qtd_QVariant_toPointF(nativeId);
+    }
+
+    public final QRect toRect() {
+        void* __qt_return_value = qtd_QVariant_toRect(nativeId);
+        return new QRect(__qt_return_value, false);
+    }
+
+    public final QRectF toRectF() {
+        void* __qt_return_value = qtd_QVariant_toRectF(nativeId);
+        return new QRectF(__qt_return_value, false);
+    }
+
+    public final QRegExp toRegExp() {
+        void* __qt_return_value = qtd_QVariant_toRegExp(nativeId);
+        return new QRegExp(__qt_return_value, false);
+    }
+
+    public final QSize toSize() {
+        return qtd_QVariant_toSize(nativeId);
+    }
+
+    public final QSizeF toSizeF() {
+        return qtd_QVariant_toSizeF(nativeId);
+    }
+
+    public final string toString() {
+        char[] res;
+        qtd_QVariant_toString(nativeId, &res);
+        return cast(string)res;
+    }
+
+    public final QTime toTime() {
+        void* __qt_return_value = qtd_QVariant_toTime(nativeId);
+        return new QTime(__qt_return_value, false);
+    }
+
+    public final uint toUInt(bool* ok = null) {
+        return qtd_QVariant_toUInt_nativepointerbool(nativeId, ok);
+    }
+
+    public final ulong toULongLong(bool* ok = null) {
+        return qtd_QVariant_toULongLong_nativepointerbool(nativeId, ok);
+    }
+
+    public final QUrl toUrl() {
+        void* __qt_return_value = qtd_QVariant_toUrl(nativeId);
+        return new QUrl(__qt_return_value, false);
+    }
+
+    public final char* typeName() {
+        return qtd_QVariant_typeName(nativeId);
+    }
+
+    public final int userType() {
+        return qtd_QVariant_userType(nativeId);
+    }
+// Field accessors
+
+    public this(void* native_id, bool no_real_delete = false) {
+        super(native_id, no_real_delete);
+    }
+
+
+    ~this() {
+        if(!__no_real_delete)
+            __free_native_resources();
+    }
+
+    protected void __free_native_resources() {
+        qtd_QVariant_destructor(nativeId());
+    }
+
+// Injected code in class
+}
+extern (C) void qtd_QVariant_destructor(void *ptr);
+
+
+// C wrappers
+private extern(C) void* qtd_QVariant_QVariant();
+private extern(C) void* qtd_QVariant_QVariant_QDataStream(void* s0);
+private extern(C) void* qtd_QVariant_QVariant_GlobalColor(int color0);
+private extern(C) void* qtd_QVariant_QVariant_bool(bool b0);
+private extern(C) void* qtd_QVariant_QVariant_QBitArray(void* bitarray0);
+private extern(C) void* qtd_QVariant_QVariant_QByteArray(void* bytearray0);
+private extern(C) void* qtd_QVariant_QVariant_QDate(void* date0);
+private extern(C) void* qtd_QVariant_QVariant_QDateTime(void* datetime0);
+private extern(C) void* qtd_QVariant_QVariant_String(char* string0, uint string0_size);
+private extern(C) void* qtd_QVariant_QVariant_QLine(void* line0);
+private extern(C) void* qtd_QVariant_QVariant_QLineF(void* line0);
+private extern(C) void* qtd_QVariant_QVariant_QLocale(void* locale0);
+private extern(C) void* qtd_QVariant_QVariant_QPoint(void* pt0);
+private extern(C) void* qtd_QVariant_QVariant_QPointF(void* pt0);
+private extern(C) void* qtd_QVariant_QVariant_QRect(void* rect0);
+private extern(C) void* qtd_QVariant_QVariant_QRectF(void* rect0);
+private extern(C) void* qtd_QVariant_QVariant_QRegExp(void* regExp0);
+private extern(C) void* qtd_QVariant_QVariant_QSize(void* size0);
+private extern(C) void* qtd_QVariant_QVariant_QSizeF(void* size0);
+private extern(C) void* qtd_QVariant_QVariant_QTime(void* time0);
+private extern(C) void* qtd_QVariant_QVariant_QUrl(void* url0);
+private extern(C) void* qtd_QVariant_QVariant_QVariant(void* other0);
+private extern(C) void* qtd_QVariant_QVariant_nativepointerchar(char* str0);
+private extern(C) void* qtd_QVariant_QVariant_double(double d0);
+private extern(C) void* qtd_QVariant_QVariant_int(int i0);
+private extern(C) void* qtd_QVariant_QVariant_int_nativepointervoid(int typeOrUserType0,
+ void* copy1);
+private extern(C) void* qtd_QVariant_QVariant_long(long ll0);
+private extern(C) void* qtd_QVariant_QVariant_uint(uint ui0);
+private extern(C) void* qtd_QVariant_QVariant_ulong(ulong ull0);
+private extern(C) bool  qtd_QVariant_canConvert(void* __this_nativeId, int);
+private extern(C) void  qtd_QVariant_clear(void* __this_nativeId);
+private extern(C) bool  qtd_QVariant_cmp_QVariant(void* __this_nativeId,
+ void* other0);
+private extern(C) void  qtd_QVariant_create_int_nativepointervoid(void* __this_nativeId,
+ int type0,
+ void* copy1);
+private extern(C) bool  qtd_QVariant_isNull(void* __this_nativeId);
+private extern(C) bool  qtd_QVariant_isValid(void* __this_nativeId);
+private extern(C) void  qtd_QVariant_load_QDataStream(void* __this_nativeId,
+ void* ds0);
+private extern(C) void  qtd_QVariant_writeTo_QDataStream(void* __this_nativeId,
+ void* s0);
+private extern(C) void*  qtd_QVariant_operator_assign_QVariant(void* __this_nativeId,
+ void* other0);
+private extern(C) bool  qtd_QVariant_operator_equal_QVariant(void* __this_nativeId,
+ void* v0);
+private extern(C) void  qtd_QVariant_readFrom_QDataStream(void* __this_nativeId,
+ void* s0);
+private extern(C) void  qtd_QVariant_save_QDataStream(void* __this_nativeId,
+ void* ds0);
+private extern(C) void*  qtd_QVariant_toBitArray(void* __this_nativeId);
+private extern(C) bool  qtd_QVariant_toBool(void* __this_nativeId);
+private extern(C) void*  qtd_QVariant_toByteArray(void* __this_nativeId);
+private extern(C) void*  qtd_QVariant_toDate(void* __this_nativeId);
+private extern(C) void*  qtd_QVariant_toDateTime(void* __this_nativeId);
+private extern(C) double  qtd_QVariant_toDouble_nativepointerbool(void* __this_nativeId,
+ bool* ok0);
+private extern(C) int  qtd_QVariant_toInt_nativepointerbool(void* __this_nativeId,
+ bool* ok0);
+private extern(C) void*  qtd_QVariant_toLine(void* __this_nativeId);
+private extern(C) void*  qtd_QVariant_toLineF(void* __this_nativeId);
+private extern(C) void*  qtd_QVariant_toLocale(void* __this_nativeId);
+private extern(C) long  qtd_QVariant_toLongLong_nativepointerbool(void* __this_nativeId,
+ bool* ok0);
+private extern(C) QPoint  qtd_QVariant_toPoint(void* __this_nativeId);
+private extern(C) QPointF  qtd_QVariant_toPointF(void* __this_nativeId);
+private extern(C) void*  qtd_QVariant_toRect(void* __this_nativeId);
+private extern(C) void*  qtd_QVariant_toRectF(void* __this_nativeId);
+private extern(C) void*  qtd_QVariant_toRegExp(void* __this_nativeId);
+private extern(C) QSize  qtd_QVariant_toSize(void* __this_nativeId);
+private extern(C) QSizeF  qtd_QVariant_toSizeF(void* __this_nativeId);
+private extern(C) void  qtd_QVariant_toString(void* __this_nativeId,
+ void* __java_return_value);
+private extern(C) void*  qtd_QVariant_toTime(void* __this_nativeId);
+private extern(C) uint  qtd_QVariant_toUInt_nativepointerbool(void* __this_nativeId,
+ bool* ok0);
+private extern(C) ulong  qtd_QVariant_toULongLong_nativepointerbool(void* __this_nativeId,
+ bool* ok0);
+private extern(C) void*  qtd_QVariant_toUrl(void* __this_nativeId);
+private extern(C) char*  qtd_QVariant_typeName(void* __this_nativeId);
+private extern(C) int  qtd_QVariant_userType(void* __this_nativeId);
+// Just the private functions for abstract functions implemeneted in superclasses
+
+
+
+// Virtual Dispatch functions
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qt/d1/Signal.d	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,1033 @@
+/**
+ *
+ *  Copyright: Copyright QtD Team, 2008-2009
+ *  Authors: Max Samukha, Eldar Insafutdinov
+ *  License: <a href="http://www.boost.org/LICENSE_1_0.txt>Boost License 1.0</a>
+ *
+ *  Copyright QtD Team, 2008-2009
+ *  Distributed under the Boost Software License, Version 1.0.
+ *  (See accompanying file boost-license-1.0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ */
+module qt.d1.Signal;
+
+public import qt.QGlobal;
+import tango.core.Exception;
+import tango.core.Traits;
+import tango.core.Thread;
+import tango.stdc.stdlib : crealloc = realloc, cfree = free;
+import tango.stdc.string : memmove;
+
+debug import tango.io.Stdout;
+
+private: // private by default
+
+alias void delegate(Object) DEvent;
+
+extern(C) void rt_attachDisposeEvent(Object o, DEvent e);
+extern(C) void rt_detachDisposeEvent(Object o, DEvent e);
+extern(C) Object _d_toObject(void* p);
+
+void realloc(T)(ref T[] a, size_t length)
+{
+    a = (cast(T*)crealloc(a.ptr, length * T.sizeof))[0..length];
+    if (!a.ptr)
+        new OutOfMemoryException(__FILE__, __LINE__);
+}
+
+unittest
+{
+    int[] a;
+    realloc(a, 16);
+    assert(a.length == 16);
+    foreach (i, ref e; a)
+        e = i;
+    realloc(a, 4096);
+    assert(a.length == 4096);
+    foreach (i, e; a[0..16])
+        assert(e == i);
+    cfree(a.ptr);
+}
+
+// TODO: This one should be replaced with an appropriate library function
+char[] __toString(long v)
+{
+    if (v == 0)
+        return "0";
+
+    char[] ret;
+
+    bool neg;
+    if (v < 0)
+    {
+        neg = true;
+        v = -v;
+    }
+
+    while (v != 0)
+    {
+        ret = cast(char)(v % 10 + '0') ~ ret;
+        v = cast(long)(v / 10);
+    }
+
+    if (neg)
+        ret = "-" ~ ret;
+
+    return ret;
+}
+
+template ToString(long i)
+{
+    const string ToString = __toString(i);
+}
+
+//TODO: should be in the standard library
+struct STuple(A...)
+{
+    static string genSTuple()
+    {
+        string r = "";
+        foreach (i, e; A)
+            r ~= A[i].stringof ~ " _" ~ ToString!(i) ~ ";";
+        return r;
+    }
+
+    mixin (genSTuple);
+    template at(size_t i) { mixin("alias _" ~ ToString!(i) ~ " at;"); };
+}
+
+void move(T)(ref T[] a, size_t src, size_t dest, size_t length)
+{
+    if (a.length > 1)
+        memmove(a.ptr + dest, a.ptr + src, length * T.sizeof);
+}
+
+
+public class SignalException : Exception
+{
+    this(char[] msg)
+    {
+        super(msg);
+    }
+}
+
+struct Fn
+{
+    void* funcptr;
+
+    static typeof(*this) opCall(R, A...)(R function(A) fn)
+    {
+        typeof(*this) r;
+        r.funcptr = fn;
+        return r;
+    }
+
+    template call(R)
+    {
+        R call(A...)(A args)
+        {
+            alias R function(A) Fn;
+            return (cast(Fn)funcptr)(args);
+        }
+    }
+
+    S get(S)()
+    {
+        static assert (is(typeof(*S.init) == function));
+        return cast(S)funcptr;
+    }
+
+    debug string toString()
+    {
+        return Stdout.layout.convert("funcptr: {}", funcptr);
+    }
+}
+
+struct Dg
+{
+    void* context;
+    void* funcptr;
+
+    static typeof(*this) opCall(R, A...)(R delegate(A) dg)
+    {
+        typeof(*this) r;
+        r.context = dg.ptr;
+        r.funcptr = dg.funcptr;
+        return r;
+    }
+
+    template call(R)
+    {
+        R call(A...)(A args)
+        {
+            R delegate(A) dg; // BUG: parameter storage classes are ignored
+            dg.ptr = context;
+            dg.funcptr = cast(typeof(dg.funcptr))funcptr;
+            return dg(args);
+        }
+    }
+
+    S get(S)()
+    {
+        static assert (is(S == delegate));
+        S r;
+        r.ptr = context;
+        r.funcptr = cast(typeof(r.funcptr))funcptr;
+        return r;
+    }
+
+    debug string toString()
+    {
+        return Stdout.layout.convert("context: {}, funcptr: {}", context, funcptr);
+    }
+}
+
+struct Slot(R)
+{
+    alias R Receiver;
+
+    Receiver receiver;
+    Dg invoker;
+
+    static if (is(Receiver == Dg))
+    {
+        static const isDelegate = true;
+
+        void onReceiverDisposed(Object o)
+        {
+            assert (lock !is null);
+            synchronized(lock)
+            {
+                receiver.context = null;
+                receiver.funcptr = null;
+            }
+        }
+
+        // null if receiver doesn't point to a disposable object
+        Object lock;
+
+        bool isDisposed()
+        {
+            return !receiver.funcptr;
+        }
+
+        Object getObject()
+        {
+            return lock ? _d_toObject(receiver.context) : null;
+        }
+    }
+    else
+        static const isDelegate = false;
+
+    static typeof(*this) opCall(Receiver r, Dg c)
+    {
+        typeof(*this) ret;
+        ret.receiver = r;
+        ret.invoker = c;
+        return ret;
+    }
+
+    debug string toString()
+    {
+        return Stdout.layout.convert("receiver: {}, invoker {}: ", receiver, invoker);
+    }
+}
+
+enum SlotListId
+{
+    Func, // function pointers
+    Weak, // object delegates stored in C heap
+    Strong // delegates stored in GC heap
+}
+
+/**
+    Used to specify the type of a signal-to-slot connection.
+
+    Examples:
+----
+class Sender
+{
+    mixin Signal!("changed");
+    void change()
+    {
+        changed.emit;
+    }
+}
+
+
+class Receiver
+{
+    void alarm() {}
+}
+
+void main()
+{
+    auto s = new Sender;
+    auto r = new Receiver;
+    s.changed.connect(&r.alarm); // now s weakly references r
+
+    r = null;
+    // collect garbage (assume there is no more reachable pointers
+    // to the receiver and it gets finalized)
+    ...
+
+    s.change;
+    // weak reference to the receiving object
+    // has been removed from the sender's connection lists.
+
+    r = new Receiver;
+    s.changed.connect(&r.alarm, ConnectionFlags.Strong);
+
+    r = null;
+    // collect garbage
+    ...
+    // the receiving object has not been finalized because s strongly references it.
+
+    s.change; // the receiver is called.
+    delete r;
+    s.change; // the receiver is disconnected from the sender.
+
+    static void foo()
+    {
+    }
+
+    s.changed.connect(&foo);
+    s.changed.emit; // foo is called.
+    s.changed.disconnect(&foo); // must be explicitly disconnected.
+
+    void bar()
+    {
+    }
+
+    // ConnectionFlags.NoObject must be specified for delegates
+    // to non-static local functions or struct member functions.
+    s.changed.connect(&bar, ConnectionFlags.NoObject);
+    s.changed.emit; // bar is called.
+    s.changed.disconnect(&bar); // must be explicitly disconnected.
+}
+----
+*/
+public enum ConnectionFlags
+{
+    ///
+    None,
+    /**
+        The receiver will be stored as weak reference (implied if ConnectionFlags.NoObject is not specified).
+        If the signal receiver is not a function pointer or a delegate referencing a D class instance.
+        the sender will not be notified when the receiving object is deleted and emitting the signal
+        connected to that receiving object will result in undefined behavior.
+    */
+    Weak                = 0x0001,
+    /**
+        The receiver is stored as strong reference (implied if ConnectionFlags.NoObject is specified).
+    */
+    Strong              = 0x0002,
+    /**
+        Must be specified if the receiver is not a function pointer or a delegate referencing a D class instance.
+    */
+    NoObject            = 0x0004
+
+    // Queued           = 0x0004,
+    // BlockingQueued   = 0x0008
+}
+
+
+struct SlotList(SlotT, bool strong = false)
+{
+    alias SlotT SlotType;
+    SlotType[] data;
+
+    void length(size_t length)
+    {
+        static if (strong)
+            data.length = length;
+        else
+            realloc(data, length);
+    }
+
+    SlotType* add(SlotType slot)
+    {
+        auto oldLen = data.length;
+        length = oldLen + 1;
+        auto p = &data[oldLen];
+        *p = slot;
+        return p;
+    }
+
+    SlotType* get(int slotId)
+    {
+        return &data[slotId];
+    }
+
+    void remove(int slotId)
+    {
+        move(data, slotId, slotId + 1, data.length - slotId - 1);
+        data = data[0..$ - 1];
+    }
+
+    size_t length()
+    {
+        return data.length;
+    }
+
+    void free()
+    {
+        static if (SlotType.isDelegate)
+        {
+            foreach (ref slot; data)
+            {
+                if (auto obj = slot.getObject)
+                    rt_detachDisposeEvent(obj, &slot.onReceiverDisposed);
+            }
+        }
+        static if (!strong)
+            cfree(data.ptr);
+    }
+
+    debug string toString()
+    {
+        string r;
+        foreach(e; data)
+            r ~= e.toString ~ "\n";
+        return r;
+    }
+}
+
+public alias void delegate(int signalId) SignalEvent;
+
+struct SignalConnections
+{
+    bool isInUse;
+
+    STuple!(
+        SlotList!(Slot!(Fn)),
+        SlotList!(Slot!(Dg)),
+        SlotList!(Slot!(Dg), true)
+    ) slotLists;
+
+    STuple!(
+        Fn[],
+        Dg[]
+    ) delayedDisconnects;
+
+    void addDelayedDisconnect(Fn r)
+    {
+        delayedDisconnects.at!(0) ~= r;
+    }
+
+    void addDelayedDisconnect(Dg r)
+    {
+        delayedDisconnects.at!(1) ~= r;
+    }
+
+    SlotListType!(slotListId)* getSlotList(int slotListId)()
+    {
+        return &slotLists.tupleof[slotListId];
+    }
+
+    bool hasSlots()
+    {
+        foreach(i, e; slotLists.tupleof)
+        {
+            if (slotLists.tupleof[i].length)
+                return true;
+        }
+        return false;
+    }
+
+    int slotCount()
+    {
+        int count;
+        foreach(i, e; slotLists.tupleof)
+            count += slotLists.at!(i).length;
+        return count;
+    }
+
+    void slotListLengths(int[] lengths)
+    {
+        foreach(i, e; slotLists.tupleof)
+             lengths[i] = slotLists.at!(i).length;
+    }
+
+    SlotType!(slotListId)* addSlot(int slotListId)(SlotType!(slotListId) slot)
+    {
+        return getSlotList!(slotListId).add(slot);
+    }
+
+    void removeSlot(int slotListId)(int slotId)
+    {
+        slotLists.at!(slotListId).remove(slotId);
+    }
+
+    void free()
+    {
+        foreach(i, e; slotLists.tupleof)
+        {
+            static if (is(typeof(slotLists.at!(i).free)))
+                slotLists.at!(i).free;
+        }
+    }
+
+    template SlotListType(int slotListId)
+    {
+        alias typeof(slotLists.tupleof)[slotListId] SlotListType;
+    }
+
+    template SlotType(int slotListId)
+    {
+        alias SlotListType!(slotListId).SlotType SlotType;
+    }
+
+    template ReceiverType(int slotListId)
+    {
+        alias SlotType!(slotListId).Receiver ReceiverType;
+    }
+
+    debug string toString()
+    {
+        string r;
+        foreach(i, e; slotLists.tupleof)
+        {
+            r ~= Stdout.layout.convert("Slot list {}:", i);
+            r ~= slotLists.at!(i).toString;
+        }
+        return r;
+    }
+
+    static const slotListCount = slotLists.tupleof.length;
+}
+
+
+private ThreadLocal!(Object) signalSender_;
+static this()
+{
+    signalSender_ = new ThreadLocal!(Object);
+}
+
+/**
+    If called from a slot, returns the object
+    that is emitting the signal. Otherwise, returns null.
+*/
+public Object signalSender() {
+    return signalSender_.val;
+}
+
+public class SignalHandler
+{
+    SignalConnections[] connections;
+    Object owner;
+    int blocked;
+
+    // Called after a slot has been connected to an empty signal
+    SignalEvent firstSlotConnected;
+    // Called after the last slot has been disconnected from a signal
+    SignalEvent lastSlotDisconnected;
+
+    alias SignalConnections.SlotType SlotType;
+    alias SignalConnections.ReceiverType ReceiverType;
+
+    public this(Object owner_) {
+        owner = owner_;
+    }
+
+    private SignalConnections* getConnections(int signalId)
+    {
+        if (signalId < connections.length)
+            return &connections[signalId];
+        return null;
+    }
+
+    private SlotType!(slotListId)* addSlot(int slotListId)(int signalId, ReceiverType!(slotListId) receiver,
+        Dg invoker)
+    {
+        if (signalId >= connections.length)
+            connections.length = signalId + 1;
+        auto slot = connections[signalId].addSlot!(slotListId)(SlotType!(slotListId)(receiver, invoker));
+
+        if (firstSlotConnected && connections[signalId].slotCount == 1)
+            firstSlotConnected(signalId);
+
+        return slot;
+    }
+
+    private void removeSlot(int slotListId)(int signalId, int slotId)
+    {
+        connections[signalId].removeSlot!(slotListId)(slotId);
+
+        if (lastSlotDisconnected && !connections[signalId].slotCount)
+            lastSlotDisconnected(signalId);
+    }
+
+    private SlotType!(slotListId)* addObjectSlot(int slotListId)(size_t signalId, Object obj, Dg receiver,
+        Dg invoker)
+    {
+        auto slot = addSlot!(slotListId)(signalId, receiver, invoker);
+        slot.lock = this;
+        rt_attachDisposeEvent(obj, &slot.onReceiverDisposed);
+        return slot;
+    }
+
+    size_t slotCount(int signalId)
+    {
+        synchronized(this)
+        {
+            auto con = getConnections(signalId);
+            if (con)
+                return con.slotCount;
+            return 0;
+        }
+    }
+
+    void connect(Receiver)(size_t signalId, Receiver receiver,
+        Dg invoker, ConnectionFlags flags)
+    {
+        synchronized(this)
+        {
+            static if (is(typeof(receiver.context)))
+            {
+                Object obj;
+                if ((flags & ConnectionFlags.NoObject) || (obj = _d_toObject(receiver.context)) is null)
+                {
+                    // strong by default
+                    if (flags & ConnectionFlags.Weak)
+                        addSlot!(SlotListId.Weak)(signalId, receiver, invoker);
+                    else
+                        addSlot!(SlotListId.Strong)(signalId, receiver, invoker);
+                }
+                else
+                {
+                    // weak by default
+                    if (flags & ConnectionFlags.Strong)
+                        addObjectSlot!(SlotListId.Strong)(signalId, obj, receiver, invoker);
+                    else
+                        addObjectSlot!(SlotListId.Weak)(signalId, obj, receiver, invoker);
+                }
+            }
+            else
+                addSlot!(SlotListId.Func)(signalId, receiver, invoker);
+        }
+    }
+
+    void disconnect(Receiver)(int signalId, Receiver receiver)
+    {
+        synchronized(this)
+        {
+            auto cons = getConnections(signalId);
+            if (!cons)
+                return;
+
+            // if called from a slot being executed by this signal, delay disconnection
+            // until all slots has been called.
+            if (cons.isInUse)
+            {
+                cons.addDelayedDisconnect(receiver);
+                return;
+            }
+
+        TOP:
+            foreach (slotListId, e; cons.slotLists.tupleof)
+            {
+                /// COMPILER BUG: ReceiverType is evaluated to expression instead of type.
+                static if (is(typeof(cons.ReceiverType!(slotListId)) == Receiver))
+                {
+                    auto slotList = cons.getSlotList!(slotListId);
+                    for (int slotId; slotId < slotList.length;)
+                    {
+                        auto slot = slotList.get(slotId);
+                        static if (slot.isDelegate)
+                        {
+                            if (slot.isDisposed)
+                            {
+                                removeSlot!(slotListId)(signalId, slotId);
+                                continue;
+                            }
+                        }
+
+                        if (slot.receiver == receiver)
+                        {
+                            static if (slot.isDelegate)
+                            {
+                                if (auto obj = slot.getObject)
+                                    rt_detachDisposeEvent(obj, &slot.onReceiverDisposed);
+                            }
+                            removeSlot!(slotListId)(signalId, slotId);
+                            break TOP;
+                        }
+
+                        slotId++;
+                    }
+                }
+            }
+        }
+    }
+
+    void emit(A...)(size_t signalId, A args)
+    {
+        synchronized(this)
+        {
+            if (signalId >= connections.length || blocked)
+                return;
+            auto cons = &connections[signalId];
+
+            if (cons.hasSlots)
+            {
+                {
+                    cons.isInUse = true;
+                    signalSender_.val = owner;
+                    scope(exit)
+                    {
+                        cons.isInUse = false;
+                        signalSender_.val = null;
+                    }
+
+                    // Store the lengths to avoid calling new slots
+                    // connected in the slots being called.
+                    // dmd bug: int[cons.slotListCount] fails
+                    static const c = cons.slotListCount;
+                    int[c] lengths = void;
+                    cons.slotListLengths(lengths);
+
+                    foreach (slotListId, e; cons.slotLists.tupleof)
+                    {
+                        auto slotList = cons.getSlotList!(slotListId);
+                        for (size_t slotId; slotId < lengths[slotListId];)
+                        {
+                            auto slot = slotList.get(slotId);
+                            static if (slot.isDelegate)
+                            {
+                                if (slot.isDisposed)
+                                {
+                                    removeSlot!(slotListId)(signalId, slotId);
+                                    lengths[slotListId]--;
+                                    continue;
+                                }
+                            }
+
+                            slot.invoker.call!(void)(slot.receiver, args);
+                            ++slotId;
+                        }
+                    }
+                }
+
+
+                // process delayed disconnects if any
+                foreach(i, e; cons.delayedDisconnects.tupleof)
+                {
+                    if (cons.delayedDisconnects.at!(i).length)
+                    {
+                        foreach (d; cons.delayedDisconnects.at!(i))
+                            disconnect(signalId, d);
+                        cons.delayedDisconnects.at!(i).length = 0;
+                    }
+                }
+            }
+        }
+    }
+
+    // Adjusts signal arguments and calls the slot. S - slot signature, A - signal arguments
+    private void invokeSlot(S, Receiver, A...)(Receiver r, A args)
+    {
+        r.get!(S)()(args[0..ParameterTupleOf!(S).length]);
+    }
+
+    void blockSignals()
+    {
+        synchronized(this)
+            blocked++;
+    }
+
+    void unblockSignals()
+    {
+        synchronized(this)
+        {
+            if(!blocked)
+                throw new SignalException("Signals are not blocked");
+            blocked--;
+        }
+    }
+
+    ~this()
+    {
+        foreach(ref c; connections)
+            c.free;
+    }
+
+    debug string toString()
+    {
+        string r;
+        foreach (i, c; connections)
+            r ~= Stdout.layout.convert("Signal {}:\n{}", i, c.toString);
+        return r;
+    }
+}
+
+//TODO: this could be avoided if named mixins didn't suck.
+public struct SignalOps(int sigId, A...)
+{
+    private SignalHandler sh;
+    enum { signalId = sigId }
+
+    void connect(R, B...)(R function(B) fn, ConnectionFlags flags = ConnectionFlags.None)
+    {
+        alias CheckSlot!(typeof(fn), A) check;
+        auto invoker = Dg(&sh.invokeSlot!(typeof(fn), Fn, A));
+        sh.connect(signalId, Fn(fn), invoker, flags);
+    }
+
+    void connect(R, B...)(R delegate(B) dg, ConnectionFlags flags = ConnectionFlags.None)
+    {
+        alias CheckSlot!(typeof(dg), A) check;
+        auto invoker = Dg(&sh.invokeSlot!(typeof(dg), Dg, A));
+        sh.connect(signalId, Dg(dg), invoker, flags);
+    }
+
+    void disconnect(R, B...)(R function(B) fn)
+    {
+        sh.disconnect(signalId, Fn(fn));
+    }
+
+    void disconnect(R, B...)(R delegate(B) dg)
+    {
+        sh.disconnect(signalId, Dg(dg));
+    }
+
+    void emit(A args)
+    {
+        sh.emit(signalId, args);
+    }
+
+    debug size_t slotCount()
+    {
+        return sh.slotCount(signalId);
+    }
+}
+
+template CheckSlot(Slot, A...)
+{
+    static assert(ParameterTupleOf!(Slot).length <= A.length, "Slot " ~ ParameterTypeTuple!(Slot).stringof ~
+        " has more prameters than signal " ~ A.stringof);
+    alias CheckSlotImpl!(Slot, 0, A) check;
+}
+
+template CheckSlotImpl(Slot, int i, A...)
+{
+    alias ParameterTupleOf!(Slot) SlotArgs;
+    static if (i < SlotArgs.length)
+    {
+        static assert (is(SlotArgs[i] : A[i]), "Argument " ~ __toString(i) ~
+            ":" ~ A[i].stringof ~ " of signal " ~ A.stringof ~ " is not implicitly convertible to parameter "
+            ~ SlotArgs[i].stringof ~ " of slot " ~ SlotArgs.stringof);
+        alias CheckSlotImpl!(Slot, i + 1, A) next;
+    }
+}
+
+public template SignalHandlerOps()
+{
+    static assert (is(typeof(this.signalHandler)),
+        "SignalHandlerOps is already instantiated in " ~ typeof(this).stringof ~ " or one of its base classes");
+
+protected:
+    SignalHandler signalHandler_; // manages signal-to-slot connections
+
+    final SignalHandler signalHandler()
+    {
+        if (!signalHandler_)
+        {
+            signalHandler_ = new SignalHandler(this);
+            onSignalHandlerCreated(signalHandler_);
+        }
+        return signalHandler_;
+    }
+
+    void onSignalHandlerCreated(ref SignalHandler sh)
+    {
+    }
+
+public:
+    final void blockSignals()
+    {
+        signalHandler.blockSignals();
+    }
+
+    final void unblockSignals()
+    {
+        signalHandler.unblockSignals();
+    }
+}
+
+/**
+    Examples:
+----
+struct Args
+{
+    bool cancel;
+}
+
+class C
+{
+    private int _x;
+    // reference parameters are not supported yet,
+    // so we pass arguments by pointer.
+    mixin Signal!("xChanging", int, Args*);
+    mixin Signal!("xChanged");
+
+    void x(int v)
+    {
+        if (v != _x)
+        {
+            Args args;
+            xChanging.emit(v, &args);
+            if (!args.cancel)
+            {
+                _x = v;
+                xChanged.emit;
+            }
+        }
+    }
+}
+----
+*/
+template Signal(string name, A...)
+{
+    mixin SignalImpl!(0, name, A);
+}
+
+template SignalImpl(int index, string name, A...)
+{
+    static if (is(typeof(mixin(typeof(this).stringof ~ ".__sig" ~ ToString!(index)))))
+        mixin SignalImpl!(index + 1, name, A);
+    else
+    {
+        // mixed-in once
+        static if (!is(typeof(this.signalHandler)))
+        {
+            mixin SignalHandlerOps;
+        }
+        mixin("private static const int __sig" ~ ToString!(index) ~ " = " ~ ToString!(index) ~ ";");
+        mixin("SignalOps!(" ~ ToString!(index) ~ ", A) " ~ name ~ "(){ return SignalOps!("
+            ~ ToString!(index) ~ ", A)(signalHandler); }");
+    }
+}
+
+extern(C) alias void function(void*) SlotConnector;
+
+debug (UnitTest)
+{
+    class A
+    {
+        mixin Signal!("scorched", int);
+
+        int signalId1 = -1;
+        int signalId2 = -1;
+
+        void onFirstConnect(int sId)
+        {
+            signalId1 = sId;
+        }
+
+        void onLastDisconnect(int sId)
+        {
+            signalId2 = sId;
+        }
+
+        this()
+        {
+            signalHandler.firstSlotConnected = &onFirstConnect;
+            signalHandler.lastSlotDisconnected = &onLastDisconnect;
+        }
+    }
+
+    class B : A
+    {
+        mixin Signal!("booed", int);
+
+        int bazSum;
+        void baz(int i)
+        {
+            bazSum += i;
+        }
+    }
+
+    class C : A
+    {
+        mixin Signal!("cooked");
+    }
+}
+
+unittest
+{
+    static int fooSum;
+    static int barSum;
+
+    static void foo(int i)
+    {
+        fooSum += i;
+    }
+
+    void bar(long i)
+    {
+        barSum += i;
+    }
+
+    auto a = new A;
+    auto b = new B;
+    auto c = new C;
+    assert(b.scorched.signalId == 0);
+    assert(b.booed.signalId == 1);
+    assert(c.cooked.signalId == 1);
+
+    auto sh = b.signalHandler;
+
+    b.scorched.connect(&foo);
+    assert(sh.connections.length == 1);
+    assert(b.signalId1 == 0);
+    auto scCons = &sh.connections[0];
+
+    assert(scCons.getSlotList!(SlotListId.Func).length == 1);
+    b.scorched.emit(1);
+    assert(fooSum == 1);
+
+    b.scorched.connect(&bar, ConnectionFlags.NoObject);
+    assert(sh.connections.length == 1);
+    assert(scCons.getSlotList!(SlotListId.Strong).length == 1);
+    b.scorched.emit(1);
+    assert (fooSum == 2 && barSum == 1);
+
+    b.scorched.connect(&b.baz);
+    assert(scCons.getSlotList!(SlotListId.Weak).length == 1);
+    b.scorched.emit(1);
+    assert (fooSum == 3 && barSum == 2 && b.bazSum == 1);
+
+    b.scorched.disconnect(&bar);
+    assert(scCons.slotCount == 2);
+    b.scorched.disconnect(&b.baz);
+    assert(scCons.slotCount == 1);
+    b.scorched.disconnect(&foo);
+    assert(scCons.slotCount == 0);
+    assert(b.signalId2 == 0);
+
+    fooSum = 0;
+    void connectFoo()
+    {
+        b.scorched.connect(&foo);
+        b.scorched.disconnect(&connectFoo);
+    }
+
+    b.scorched.connect(&connectFoo, ConnectionFlags.NoObject);
+    b.scorched.emit(1);
+    assert(scCons.getSlotList!(SlotListId.Func).length == 1);
+    assert(scCons.getSlotList!(SlotListId.Strong).length == 0);
+    assert(!fooSum);
+
+    auto r = new B();
+    b.scorched.connect(&r.baz);
+    assert(scCons.getSlotList!(SlotListId.Weak).length == 1);
+    b.scorched.emit(1);
+    assert(r.bazSum == 1);
+    assert(fooSum == 1);
+
+    delete(r);
+    assert(scCons.getSlotList!(SlotListId.Weak).length == 1);
+    b.scorched.emit(1);
+    assert(scCons.getSlotList!(SlotListId.Weak).length == 0);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qt/d2/Signal.d	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,1001 @@
+/**
+ *
+ *  Copyright: Copyright QtD Team, 2008-2009
+ *  Authors: Max Samukha, Eldar Insafutdinov
+ *  License: <a href="http://www.boost.org/LICENSE_1_0.txt>Boost License 1.0</a>
+ *
+ *  Copyright QtD Team, 2008-2009
+ *  Distributed under the Boost Software License, Version 1.0.
+ *  (See accompanying file boost-license-1.0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ */
+module qt.d2.Signal;
+
+public import qt.QGlobal;
+public import std.metastrings;
+import core.stdc.stdlib : crealloc = realloc, cfree = free;
+import core.stdc.string : memmove;
+import
+    std.traits,
+    core.thread;
+
+
+
+debug import std.stdio;
+
+private: // private by default
+
+alias void delegate(Object) DEvent;
+
+extern(C) void rt_attachDisposeEvent(Object o, DEvent e);
+extern(C) void rt_detachDisposeEvent(Object o, DEvent e);
+extern(C) Object _d_toObject(void* p);
+
+void realloc(T)(ref T[] a, size_t length)
+{
+    a = (cast(T*)crealloc(a.ptr, length * T.sizeof))[0..length];
+    if (!a.ptr)
+        new OutOfMemoryException(__FILE__, __LINE__);
+}
+
+unittest
+{
+    int[] a;
+    realloc(a, 16);
+    assert(a.length == 16);
+    foreach (i, ref e; a)
+        e = i;
+    realloc(a, 4096);
+    assert(a.length == 4096);
+    foreach (i, e; a[0..16])
+        assert(e == i);
+    cfree(a.ptr);
+}
+
+
+//TODO: should be in the standard library
+struct STuple(A...)
+{
+    static string genSTuple()
+    {
+        string r = "";
+        foreach (i, e; A)
+            r ~= A[i].stringof ~ " _" ~ ToString!(i) ~ ";";
+        return r;
+    }
+
+    mixin (genSTuple);
+    template at(size_t i) { mixin("alias _" ~ ToString!(i) ~ " at;"); };
+}
+
+void move(T)(ref T[] a, size_t src, size_t dest, size_t length)
+{
+    if (a.length > 1)
+        memmove(a.ptr + dest, a.ptr + src, length * T.sizeof);
+}
+
+
+public class SignalException : Exception
+{
+    this(string msg)
+    {
+        super(msg);
+    }
+}
+
+struct Fn
+{
+    void* funcptr;
+
+    static typeof(*this) opCall(R, A...)(R function(A) fn)
+    {
+        typeof(*this) r;
+        r.funcptr = fn;
+        return r;
+    }
+
+    template call(R)
+    {
+        R call(A...)(A args)
+        {
+            alias R function(A) Fn;
+            return (cast(Fn)funcptr)(args);
+        }
+    }
+
+    S get(S)()
+    {
+        static assert (is(typeof(*S.init) == function));
+        return cast(S)funcptr;
+    }
+
+    debug string toString()
+    {
+        return Stdout.layout.convert("funcptr: {}", funcptr);
+    }
+}
+
+struct Dg
+{
+    void* context;
+    void* funcptr;
+
+    static typeof(*this) opCall(R, A...)(R delegate(A) dg)
+    {
+        typeof(*this) r;
+        r.context = dg.ptr;
+        r.funcptr = dg.funcptr;
+        return r;
+    }
+
+    template call(R)
+    {
+        R call(A...)(A args)
+        {
+            R delegate(A) dg; // BUG: parameter storage classes are ignored
+            dg.ptr = context;
+            dg.funcptr = cast(typeof(dg.funcptr))funcptr;
+            return dg(args);
+        }
+    }
+
+    S get(S)()
+    {
+        static assert (is(S == delegate));
+        S r;
+        r.ptr = context;
+        r.funcptr = cast(typeof(r.funcptr))funcptr;
+        return r;
+    }
+
+    debug string toString()
+    {
+        return Stdout.layout.convert("context: {}, funcptr: {}", context, funcptr);
+    }
+}
+
+struct Slot(R)
+{
+    alias R Receiver;
+
+    Receiver receiver;
+    Dg invoker;
+
+    static if (is(Receiver == Dg))
+    {
+        static const isDelegate = true;
+
+        void onReceiverDisposed(Object o)
+        {
+            assert (lock !is null);
+            synchronized(lock)
+            {
+                receiver.context = null;
+                receiver.funcptr = null;
+            }
+        }
+
+        // null if receiver doesn't point to a disposable object
+        Object lock;
+
+        bool isDisposed()
+        {
+            return !receiver.funcptr;
+        }
+
+        Object getObject()
+        {
+            return lock ? _d_toObject(receiver.context) : null;
+        }
+    }
+    else
+        static const isDelegate = false;
+
+    debug string toString()
+    {
+        return Stdout.layout.convert("receiver: {}, invoker {}: ", receiver, invoker);
+    }
+}
+
+enum SlotListId
+{
+    Func, // function pointers
+    Weak, // object delegates stored in C heap
+    Strong // delegates stored in GC heap
+}
+
+/**
+    Used to specify the type of a signal-to-slot connection.
+
+    Examples:
+----
+class Sender
+{
+    mixin Signal!("changed");
+    void change()
+    {
+        changed.emit;
+    }
+}
+
+
+class Receiver
+{
+    void alarm() {}
+}
+
+void main()
+{
+    auto s = new Sender;
+    auto r = new Receiver;
+    s.changed.connect(&r.alarm); // now s weakly references r
+
+    r = null;
+    // collect garbage (assume there is no more reachable pointers
+    // to the receiver and it gets finalized)
+    ...
+
+    s.change;
+    // weak reference to the receiving object
+    // has been removed from the sender's connection lists.
+
+    r = new Receiver;
+    s.changed.connect(&r.alarm, ConnectionFlags.Strong);
+
+    r = null;
+    // collect garbage
+    ...
+    // the receiving object has not been finalized because s strongly references it.
+
+    s.change; // the receiver is called.
+    delete r;
+    s.change; // the receiver is disconnected from the sender.
+
+    static void foo()
+    {
+    }
+
+    s.changed.connect(&foo);
+    s.changed.emit; // foo is called.
+    s.changed.disconnect(&foo); // must be explicitly disconnected.
+
+    void bar()
+    {
+    }
+
+    // ConnectionFlags.NoObject must be specified for delegates
+    // to non-static local functions or struct member functions.
+    s.changed.connect(&bar, ConnectionFlags.NoObject);
+    s.changed.emit; // bar is called.
+    s.changed.disconnect(&bar); // must be explicitly disconnected.
+}
+----
+*/
+public enum ConnectionFlags
+{
+    ///
+    None,
+    /**
+        The receiver will be stored as weak reference (implied if ConnectionFlags.NoObject is not specified).
+        If the signal receiver is not a function pointer or a delegate referencing a D class instance.
+        the sender will not be notified when the receiving object is deleted and emitting the signal
+        connected to that receiving object will result in undefined behavior.
+    */
+    Weak                = 0x0001,
+    /**
+        The receiver is stored as strong reference (implied if ConnectionFlags.NoObject is specified).
+    */
+    Strong              = 0x0002,
+    /**
+        Must be specified if the receiver is not a function pointer or a delegate referencing a D class instance.
+    */
+    NoObject            = 0x0004
+
+    // Queued           = 0x0004,
+    // BlockingQueued   = 0x0008
+}
+
+
+struct SlotList(SlotT, bool strong = false)
+{
+    alias SlotT SlotType;
+    SlotType[] data;
+
+    void length(size_t length)
+    {
+        static if (strong)
+            data.length = length;
+        else
+            realloc(data, length);
+    }
+
+    SlotType* add(SlotType slot)
+    {
+        auto oldLen = data.length;
+        length = oldLen + 1;
+        auto p = &data[oldLen];
+        *p = slot;
+        return p;
+    }
+
+    SlotType* get(int slotId)
+    {
+        return &data[slotId];
+    }
+
+    void remove(int slotId)
+    {
+        move(data, slotId, slotId + 1, data.length - slotId - 1);
+        data = data[0..$ - 1];
+    }
+
+    size_t length()
+    {
+        return data.length;
+    }
+
+    void free()
+    {
+        static if (SlotType.isDelegate)
+        {
+            foreach (ref slot; data)
+            {
+                if (auto obj = slot.getObject)
+                    rt_detachDisposeEvent(obj, &slot.onReceiverDisposed);
+            }
+        }
+        static if (!strong)
+            cfree(data.ptr);
+    }
+
+    debug string toString()
+    {
+        string r;
+        foreach(e; data)
+            r ~= e.toString ~ "\n";
+        return r;
+    }
+}
+
+public alias void delegate(int signalId) SignalEvent;
+
+struct SignalConnections
+{
+    bool isInUse;
+
+    STuple!(
+        SlotList!(Slot!(Fn)),
+        SlotList!(Slot!(Dg)),
+        SlotList!(Slot!(Dg), true)
+    ) slotLists;
+
+    STuple!(
+        Fn[],
+        Dg[]
+    ) delayedDisconnects;
+
+    void addDelayedDisconnect(Fn r)
+    {
+        delayedDisconnects.at!(0) ~= r;
+    }
+
+    void addDelayedDisconnect(Dg r)
+    {
+        delayedDisconnects.at!(1) ~= r;
+    }
+
+    SlotListType!(slotListId)* getSlotList(int slotListId)()
+    {
+        return &slotLists.tupleof[slotListId];
+    }
+
+    bool hasSlots()
+    {
+        foreach(i, e; slotLists.tupleof)
+        {
+            if (slotLists.tupleof[i].length)
+                return true;
+        }
+        return false;
+    }
+
+    int slotCount()
+    {
+        int count;
+        foreach(i, e; slotLists.tupleof)
+            count += slotLists.at!(i).length;
+        return count;
+    }
+
+    void slotListLengths(int[] lengths)
+    {
+        foreach(i, e; slotLists.tupleof)
+             lengths[i] = slotLists.at!(i).length;
+    }
+
+    SlotType!(slotListId)* addSlot(int slotListId)(SlotType!(slotListId) slot)
+    {
+        return getSlotList!(slotListId).add(slot);
+    }
+
+    void removeSlot(int slotListId)(int slotId)
+    {
+        slotLists.at!(slotListId).remove(slotId);
+    }
+
+    void free()
+    {
+        foreach(i, e; slotLists.tupleof)
+        {
+            static if (is(typeof(slotLists.at!(i).free)))
+                slotLists.at!(i).free;
+        }
+    }
+
+    template SlotListType(int slotListId)
+    {
+        alias typeof(slotLists.tupleof)[slotListId] SlotListType;
+    }
+
+    template SlotType(int slotListId)
+    {
+        alias SlotListType!(slotListId).SlotType SlotType;
+    }
+
+    template ReceiverType(int slotListId)
+    {
+        alias SlotType!(slotListId).Receiver ReceiverType;
+    }
+
+    debug string toString()
+    {
+        string r;
+        foreach(i, e; slotLists.tupleof)
+        {
+            r ~= Stdout.layout.convert("Slot list {}:", i);
+            r ~= slotLists.at!(i).toString;
+        }
+        return r;
+    }
+
+    static const slotListCount = slotLists.tupleof.length;
+}
+
+
+private ThreadLocal!(Object) signalSender_;
+static this()
+{
+    signalSender_ = new ThreadLocal!(Object);
+}
+
+/**
+    If called from a slot, returns the object
+    that is emitting the signal. Otherwise, returns null.
+*/
+public Object signalSender() {
+    return signalSender_.val;
+}
+
+public class SignalHandler
+{
+    SignalConnections[] connections;
+    Object owner;
+    int blocked;
+
+    // Called after a slot has been connected to an empty signal
+    SignalEvent firstSlotConnected;
+    // Called after the last slot has been disconnected from a signal
+    SignalEvent lastSlotDisconnected;
+
+    alias SignalConnections.SlotType SlotType;
+    alias SignalConnections.ReceiverType ReceiverType;
+
+    public this(Object owner_) {
+        owner = owner_;
+    }
+
+    private SignalConnections* getConnections(int signalId)
+    {
+        if (signalId < connections.length)
+            return &connections[signalId];
+        return null;
+    }
+
+    private SlotType!(slotListId)* addSlot(int slotListId)(int signalId, ReceiverType!(slotListId) receiver,
+        Dg invoker)
+    {
+        if (signalId >= connections.length)
+            connections.length = signalId + 1;
+        auto slot = connections[signalId].addSlot!(slotListId)(SlotType!(slotListId)(receiver, invoker));
+
+        if (firstSlotConnected && connections[signalId].slotCount == 1)
+            firstSlotConnected(signalId);
+
+        return slot;
+    }
+
+    private void removeSlot(int slotListId)(int signalId, int slotId)
+    {
+        connections[signalId].removeSlot!(slotListId)(slotId);
+
+        if (lastSlotDisconnected && !connections[signalId].slotCount)
+            lastSlotDisconnected(signalId);
+    }
+
+    private SlotType!(slotListId)* addObjectSlot(int slotListId)(size_t signalId, Object obj, Dg receiver,
+        Dg invoker)
+    {
+        auto slot = addSlot!(slotListId)(signalId, receiver, invoker);
+        slot.lock = this;
+        rt_attachDisposeEvent(obj, &slot.onReceiverDisposed);
+        return slot;
+    }
+
+    size_t slotCount(int signalId)
+    {
+        synchronized(this)
+        {
+            auto con = getConnections(signalId);
+            if (con)
+                return con.slotCount;
+            return 0;
+        }
+    }
+
+    void connect(Receiver)(size_t signalId, Receiver receiver,
+        Dg invoker, ConnectionFlags flags)
+    {
+        synchronized(this)
+        {
+            static if (is(typeof(receiver.context)))
+            {
+                Object obj;
+                if ((flags & ConnectionFlags.NoObject) || (obj = _d_toObject(receiver.context)) is null)
+                {
+                    // strong by default
+                    if (flags & ConnectionFlags.Weak)
+                        addSlot!(SlotListId.Weak)(signalId, receiver, invoker);
+                    else
+                        addSlot!(SlotListId.Strong)(signalId, receiver, invoker);
+                }
+                else
+                {
+                    // weak by default
+                    if (flags & ConnectionFlags.Strong)
+                        addObjectSlot!(SlotListId.Strong)(signalId, obj, receiver, invoker);
+                    else
+                        addObjectSlot!(SlotListId.Weak)(signalId, obj, receiver, invoker);
+                }
+            }
+            else
+                addSlot!(SlotListId.Func)(signalId, receiver, invoker);
+        }
+    }
+
+    void disconnect(Receiver)(int signalId, Receiver receiver)
+    {
+        synchronized(this)
+        {
+            auto cons = getConnections(signalId);
+            if (!cons)
+                return;
+
+            // if called from a slot being executed by this signal, delay disconnection
+            // until all slots has been called.
+            if (cons.isInUse)
+            {
+                cons.addDelayedDisconnect(receiver);
+                return;
+            }
+
+        TOP:
+            foreach (slotListId, e; cons.slotLists.tupleof)
+            {
+                /// COMPILER BUG: ReceiverType is evaluated to expression instead of type.
+                static if (is(typeof(cons.ReceiverType!(slotListId)) == Receiver))
+                {
+                    auto slotList = cons.getSlotList!(slotListId);
+                    for (int slotId; slotId < slotList.length;)
+                    {
+                        auto slot = slotList.get(slotId);
+                        static if (slot.isDelegate)
+                        {
+                            if (slot.isDisposed)
+                            {
+                                removeSlot!(slotListId)(signalId, slotId);
+                                continue;
+                            }
+                        }
+
+                        if (slot.receiver == receiver)
+                        {
+                            static if (slot.isDelegate)
+                            {
+                                if (auto obj = slot.getObject)
+                                    rt_detachDisposeEvent(obj, &slot.onReceiverDisposed);
+                            }
+                            removeSlot!(slotListId)(signalId, slotId);
+                            break TOP;
+                        }
+
+                        slotId++;
+                    }
+                }
+            }
+        }
+    }
+
+    void emit(A...)(size_t signalId, A args)
+    {
+        synchronized(this)
+        {
+            if (signalId >= connections.length || blocked)
+                return;
+            auto cons = &connections[signalId];
+
+            if (cons.hasSlots)
+            {
+                {
+                    cons.isInUse = true;
+                    signalSender_.val = owner;
+                    scope(exit)
+                    {
+                        cons.isInUse = false;
+                        signalSender_.val = null;
+                    }
+
+                    // Store the lengths to avoid calling new slots
+                    // connected in the slots being called.
+                    // dmd bug: int[cons.slotListCount] fails
+                    static const c = cons.slotListCount;
+                    int[c] lengths = void;
+                    cons.slotListLengths(lengths);
+
+                    foreach (slotListId, e; cons.slotLists.tupleof)
+                    {
+                        auto slotList = cons.getSlotList!(slotListId);
+                        for (size_t slotId; slotId < lengths[slotListId];)
+                        {
+                            auto slot = slotList.get(slotId);
+                            static if (slot.isDelegate)
+                            {
+                                if (slot.isDisposed)
+                                {
+                                    removeSlot!(slotListId)(signalId, slotId);
+                                    lengths[slotListId]--;
+                                    continue;
+                                }
+                            }
+
+                            slot.invoker.call!(void)(slot.receiver, args);
+                            ++slotId;
+                        }
+                    }
+                }
+
+
+                // process delayed disconnects if any
+                foreach(i, e; cons.delayedDisconnects.tupleof)
+                {
+                    if (cons.delayedDisconnects.at!(i).length)
+                    {
+                        foreach (d; cons.delayedDisconnects.at!(i))
+                            disconnect(signalId, d);
+                        cons.delayedDisconnects.at!(i).length = 0;
+                    }
+                }
+            }
+        }
+    }
+
+    // Adjusts signal arguments and calls the slot. S - slot signature, A - signal arguments
+    private void invokeSlot(S, Receiver, A...)(Receiver r, A args)
+    {
+        r.get!(S)()(args[0..ParameterTupleOf!(S).length]);
+    }
+
+    void blockSignals()
+    {
+        synchronized(this)
+            blocked++;
+    }
+
+    void unblockSignals()
+    {
+        synchronized(this)
+        {
+            if(!blocked)
+                throw new SignalException("Signals are not blocked");
+            blocked--;
+        }
+    }
+
+    ~this()
+    {
+        foreach(ref c; connections)
+            c.free;
+    }
+
+    debug string toString()
+    {
+        string r;
+        foreach (i, c; connections)
+            r ~= Stdout.layout.convert("Signal {}:\n{}", i, c.toString);
+        return r;
+    }
+}
+
+//TODO: this could be avoided if named mixins didn't suck.
+public struct SignalOps(int sigId, A...)
+{
+    private SignalHandler sh;
+    enum { signalId = sigId }
+
+    void connect(R, B...)(R function(B) fn, ConnectionFlags flags = ConnectionFlags.None)
+    {
+        alias CheckSlot!(typeof(fn), A) check;
+        auto invoker = Dg(&sh.invokeSlot!(typeof(fn), Fn, A));
+        sh.connect(signalId, Fn(fn), invoker, flags);
+    }
+
+    void connect(R, B...)(R delegate(B) dg, ConnectionFlags flags = ConnectionFlags.None)
+    {
+        alias CheckSlot!(typeof(dg), A) check;
+        auto invoker = Dg(&sh.invokeSlot!(typeof(dg), Dg, A));
+        sh.connect(signalId, Dg(dg), invoker, flags);
+    }
+
+    void disconnect(R, B...)(R function(B) fn)
+    {
+        sh.disconnect(signalId, Fn(fn));
+    }
+
+    void disconnect(R, B...)(R delegate(B) dg)
+    {
+        sh.disconnect(signalId, Dg(dg));
+    }
+
+    void emit(A args)
+    {
+        sh.emit(signalId, args);
+    }
+
+    debug size_t slotCount()
+    {
+        return sh.slotCount(signalId);
+    }
+}
+
+template CheckSlot(Slot, A...)
+{
+    static assert(ParameterTupleOf!(Slot).length <= A.length, "Slot " ~ ParameterTypeTuple!(Slot).stringof ~
+        " has more prameters than signal " ~ A.stringof);
+    alias CheckSlotImpl!(Slot, 0, A) check;
+}
+
+template CheckSlotImpl(Slot, int i, A...)
+{
+    alias ParameterTupleOf!(Slot) SlotArgs;
+    static if (i < SlotArgs.length)
+    {
+        static assert (is(SlotArgs[i] : A[i]), "Argument " ~ ToString!(i) ~
+            ":" ~ A[i].stringof ~ " of signal " ~ A.stringof ~ " is not implicitly convertible to parameter "
+
+
+
+
+                       ~ SlotArgs[i].stringof ~ " of slot " ~ SlotArgs.stringof);
+        alias CheckSlotImpl!(Slot, i + 1, A) next;
+    }
+}
+
+public template SignalHandlerOps()
+{
+    static assert (is(typeof(this.signalHandler)),
+        "SignalHandlerOps is already instantiated in " ~ typeof(this).stringof ~ " or one of its base classes");
+
+protected:
+    SignalHandler signalHandler_; // manages signal-to-slot connections
+
+    final SignalHandler signalHandler()
+    {
+        if (!signalHandler_)
+        {
+            signalHandler_ = new SignalHandler(this);
+            onSignalHandlerCreated(signalHandler_);
+        }
+        return signalHandler_;
+    }
+
+    void onSignalHandlerCreated(ref SignalHandler sh)
+    {
+    }
+
+public:
+    final void blockSignals()
+    {
+        signalHandler.blockSignals();
+    }
+
+    final void unblockSignals()
+    {
+        signalHandler.unblockSignals();
+    }
+}
+
+/**
+    Examples:
+----
+struct Args
+{
+    bool cancel;
+}
+
+class C
+{
+    private int _x;
+    // reference parameters are not supported yet,
+    // so we pass arguments by pointer.
+    mixin Signal!("xChanging", int, Args*);
+    mixin Signal!("xChanged");
+
+    void x(int v)
+    {
+        if (v != _x)
+        {
+            Args args;
+            xChanging.emit(v, &args);
+            if (!args.cancel)
+            {
+                _x = v;
+                xChanged.emit;
+            }
+        }
+    }
+}
+----
+*/
+template Signal(string name, A...)
+{
+    mixin SignalImpl!(0, name, A);
+}
+
+template SignalImpl(int index, string name, A...)
+{
+    static if (is(typeof(mixin(typeof(this).stringof ~ ".__sig" ~ ToString!(index)))))
+        mixin SignalImpl!(index + 1, name, A);
+    else
+    {
+        // mixed-in once
+        static if (!is(typeof(this.signalHandler)))
+        {
+            mixin SignalHandlerOps;
+        }
+        mixin("private static const int __sig" ~ ToString!(index) ~ " = " ~ ToString!(index) ~ ";");
+        mixin("SignalOps!(" ~ ToString!(index) ~ ", A) " ~ name ~ "(){ return SignalOps!("
+            ~ ToString!(index) ~ ", A)(signalHandler); }");
+    }
+}
+
+extern(C) alias void function(void*) SlotConnector;
+
+debug (UnitTest)
+{
+    class A
+    {
+        mixin Signal!("scorched", int);
+
+        int signalId1 = -1;
+        int signalId2 = -1;
+
+        void onFirstConnect(int sId)
+        {
+            signalId1 = sId;
+        }
+
+        void onLastDisconnect(int sId)
+        {
+            signalId2 = sId;
+        }
+
+        this()
+        {
+            signalHandler.firstSlotConnected = &onFirstConnect;
+            signalHandler.lastSlotDisconnected = &onLastDisconnect;
+        }
+    }
+
+    class B : A
+    {
+        mixin Signal!("booed", int);
+
+        int bazSum;
+        void baz(int i)
+        {
+            bazSum += i;
+        }
+    }
+
+    class C : A
+    {
+        mixin Signal!("cooked");
+    }
+}
+
+unittest
+{
+    static int fooSum;
+    static int barSum;
+
+    static void foo(int i)
+    {
+        fooSum += i;
+    }
+
+    void bar(long i)
+    {
+        barSum += i;
+    }
+
+    auto a = new A;
+    auto b = new B;
+    auto c = new C;
+    assert(b.scorched.signalId == 0);
+    assert(b.booed.signalId == 1);
+    assert(c.cooked.signalId == 1);
+
+    auto sh = b.signalHandler;
+
+    b.scorched.connect(&foo);
+    assert(sh.connections.length == 1);
+    assert(b.signalId1 == 0);
+    auto scCons = &sh.connections[0];
+
+    assert(scCons.getSlotList!(SlotListId.Func).length == 1);
+    b.scorched.emit(1);
+    assert(fooSum == 1);
+
+    b.scorched.connect(&bar, ConnectionFlags.NoObject);
+    assert(sh.connections.length == 1);
+    assert(scCons.getSlotList!(SlotListId.Strong).length == 1);
+    b.scorched.emit(1);
+    assert (fooSum == 2 && barSum == 1);
+
+    b.scorched.connect(&b.baz);
+    assert(scCons.getSlotList!(SlotListId.Weak).length == 1);
+    b.scorched.emit(1);
+    assert (fooSum == 3 && barSum == 2 && b.bazSum == 1);
+
+    b.scorched.disconnect(&bar);
+    assert(scCons.slotCount == 2);
+    b.scorched.disconnect(&b.baz);
+    assert(scCons.slotCount == 1);
+    b.scorched.disconnect(&foo);
+    assert(scCons.slotCount == 0);
+    assert(b.signalId2 == 0);
+
+    fooSum = 0;
+    void connectFoo()
+    {
+        b.scorched.connect(&foo);
+        b.scorched.disconnect(&connectFoo);
+    }
+
+    b.scorched.connect(&connectFoo, ConnectionFlags.NoObject);
+    b.scorched.emit(1);
+    assert(scCons.getSlotList!(SlotListId.Func).length == 1);
+    assert(scCons.getSlotList!(SlotListId.Strong).length == 0);
+    assert(!fooSum);
+
+    auto r = new B();
+    b.scorched.connect(&r.baz);
+    assert(scCons.getSlotList!(SlotListId.Weak).length == 1);
+    b.scorched.emit(1);
+    assert(r.bazSum == 1);
+    assert(fooSum == 1);
+
+    delete(r);
+    assert(scCons.getSlotList!(SlotListId.Weak).length == 1);
+    b.scorched.emit(1);
+    assert(scCons.getSlotList!(SlotListId.Weak).length == 0);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qt/opengl/gl.d	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,7 @@
+module qt.opengl.gl;
+
+public
+{
+    import qt.opengl.gltypes;
+    import qt.opengl.glfuncs;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qt/opengl/glfuncs.d	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,375 @@
+module qt.opengl.glfuncs;
+
+private import qt.opengl.gltypes;
+
+/*
+extern (C)
+{
+	void glEnable(GLenum);
+	void glEnableClientState(GLenum);
+	void glDisableClientState(GLenum);
+	void glClear(GLbitfield);
+	void glLoadIdentity();
+	void glBegin(GLenum);
+	void glColor3f(GLfloat,GLfloat,GLfloat);
+	void glVertex3f(GLfloat,GLfloat,GLfloat);
+	void glEnd();
+	void glViewport(GLint,GLint,GLsizei,GLsizei);
+	void glMatrixMode(GLenum);
+	void glGetDoublev(GLenum,GLdouble*);
+	void glGetFloatv(GLenum,GLfloat*);
+	void glGetIntegerv(GLenum,GLint*);
+	void glScalef(GLfloat,GLfloat,GLfloat);
+	void glDeleteLists(GLuint, GLsizei);
+	void glShadeModel(GLenum);
+	void glTranslated(GLdouble, GLdouble, GLdouble);
+	void glTranslatef(GLfloat, GLfloat, GLfloat);
+	void glRotated(GLdouble, GLdouble, GLdouble, GLdouble);
+	void glCallList(GLuint);
+	void glOrtho (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
+	GLuint glGenLists (GLsizei range);
+}
+alias ptrdiff_t GLintptrARB;
+alias ptrdiff_t GLsizeiptrARB;
+
+*/
+
+extern (System)
+{
+	void glAccum (GLenum op, GLfloat value);
+	void glAlphaFunc (GLenum func, GLclampf ref_);
+	GLboolean glAreTexturesResident (GLsizei n, GLuint *textures, GLboolean *residences);
+	void glArrayElement (GLint i);
+	void glBegin (GLenum mode);
+	void glBindTexture (GLenum target, GLuint texture);
+	void glBitmap (GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, GLubyte *bitmap);
+	void glBlendFunc (GLenum sfactor, GLenum dfactor);
+	void glCallList (GLuint list);
+	void glCallLists (GLsizei n, GLenum type, GLvoid *lists);
+	void glClear (GLbitfield mask);
+	void glClearAccum (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+	void glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+	void glClearDepth (GLclampd depth);
+	void glClearIndex (GLfloat c);
+	void glClearStencil (GLint s);
+	void glClipPlane (GLenum plane, GLdouble *equation);
+	void glColor3b (GLbyte red, GLbyte green, GLbyte blue);
+	void glColor3bv (GLbyte *v);
+	void glColor3d (GLdouble red, GLdouble green, GLdouble blue);
+	void glColor3dv (GLdouble *v);
+	void glColor3f (GLfloat red, GLfloat green, GLfloat blue);
+	void glColor3fv (GLfloat *v);
+	void glColor3i (GLint red, GLint green, GLint blue);
+	void glColor3iv (GLint *v);
+	void glColor3s (GLshort red, GLshort green, GLshort blue);
+	void glColor3sv (GLshort *v);
+	void glColor3ub (GLubyte red, GLubyte green, GLubyte blue);
+	void glColor3ubv (GLubyte *v);
+	void glColor3ui (GLuint red, GLuint green, GLuint blue);
+	void glColor3uiv (GLuint *v);
+	void glColor3us (GLushort red, GLushort green, GLushort blue);
+	void glColor3usv (GLushort *v);
+	void glColor4b (GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha);
+	void glColor4bv (GLbyte *v);
+	void glColor4d (GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha);
+	void glColor4dv (GLdouble *v);
+	void glColor4f (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+	void glColor4fv (GLfloat *v);
+	void glColor4i (GLint red, GLint green, GLint blue, GLint alpha);
+	void glColor4iv (GLint *v);
+	void glColor4s (GLshort red, GLshort green, GLshort blue, GLshort alpha);
+	void glColor4sv (GLshort *v);
+	void glColor4ub (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);
+	void glColor4ubv (GLubyte *v);
+	void glColor4ui (GLuint red, GLuint green, GLuint blue, GLuint alpha);
+	void glColor4uiv (GLuint *v);
+	void glColor4us (GLushort red, GLushort green, GLushort blue, GLushort alpha);
+	void glColor4usv (GLushort *v);
+	void glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
+	void glColorMaterial (GLenum face, GLenum mode);
+	void glColorPointer (GLint size, GLenum type, GLsizei stride, GLvoid *pointer);
+	void glCopyPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum type);
+	void glCopyTexImage1D (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border);
+	void glCopyTexImage2D (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+	void glCopyTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
+	void glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+	void glCullFace (GLenum mode);
+	void glDeleteLists (GLuint list, GLsizei range);
+	void glDeleteTextures (GLsizei n, GLuint *textures);
+	void glDepthFunc (GLenum func);
+	void glDepthMask (GLboolean flag);
+	void glDepthRange (GLclampd zNear, GLclampd zFar);
+	void glDisable (GLenum cap);
+	void glDisableClientState (GLenum array);
+	void glDrawArrays (GLenum mode, GLint first, GLsizei count);
+	void glDrawBuffer (GLenum mode);
+	void glDrawElements (GLenum mode, GLsizei count, GLenum type, GLvoid *indices);
+	void glDrawPixels (GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels);
+	void glEdgeFlag (GLboolean flag);
+	void glEdgeFlagPointer (GLsizei stride, GLvoid *pointer);
+	void glEdgeFlagv (GLboolean *flag);
+	void glEnable (GLenum cap);
+	void glEnableClientState (GLenum array);
+	void glEnd ();
+	void glEndList ();
+	void glEvalCoord1d (GLdouble u);
+	void glEvalCoord1dv (GLdouble *u);
+	void glEvalCoord1f (GLfloat u);
+	void glEvalCoord1fv (GLfloat *u);
+	void glEvalCoord2d (GLdouble u, GLdouble v);
+	void glEvalCoord2dv (GLdouble *u);
+	void glEvalCoord2f (GLfloat u, GLfloat v);
+	void glEvalCoord2fv (GLfloat *u);
+	void glEvalMesh1 (GLenum mode, GLint i1, GLint i2);
+	void glEvalMesh2 (GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2);
+	void glEvalPoint1 (GLint i);
+	void glEvalPoint2 (GLint i, GLint j);
+	void glFeedbackBuffer (GLsizei size, GLenum type, GLfloat *buffer);
+	void glFinish ();
+	void glFlush ();
+	void glFogf (GLenum pname, GLfloat param);
+	void glFogfv (GLenum pname, GLfloat *params);
+	void glFogi (GLenum pname, GLint param);
+	void glFogiv (GLenum pname, GLint *params);
+	void glFrontFace (GLenum mode);
+	void glFrustum (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
+	GLuint glGenLists (GLsizei range);
+	void glGenTextures (GLsizei n, GLuint *textures);
+	void glGetBooleanv (GLenum pname, GLboolean *params);
+	void glGetClipPlane (GLenum plane, GLdouble *equation);
+	void glGetDoublev (GLenum pname, GLdouble *params);
+	GLenum glGetError ();
+	void glGetFloatv (GLenum pname, GLfloat *params);
+	void glGetIntegerv (GLenum pname, GLint *params);
+	void glGetLightfv (GLenum light, GLenum pname, GLfloat *params);
+	void glGetLightiv (GLenum light, GLenum pname, GLint *params);
+	void glGetMapdv (GLenum target, GLenum query, GLdouble *v);
+	void glGetMapfv (GLenum target, GLenum query, GLfloat *v);
+	void glGetMapiv (GLenum target, GLenum query, GLint *v);
+	void glGetMaterialfv (GLenum face, GLenum pname, GLfloat *params);
+	void glGetMaterialiv (GLenum face, GLenum pname, GLint *params);
+	void glGetPixelMapfv (GLenum map, GLfloat *values);
+	void glGetPixelMapuiv (GLenum map, GLuint *values);
+	void glGetPixelMapusv (GLenum map, GLushort *values);
+	void glGetPointerv (GLenum pname, GLvoid* *params);
+	void glGetPolygonStipple (GLubyte *mask);
+	GLubyte * glGetString (GLenum name);
+	void glGetTexEnvfv (GLenum target, GLenum pname, GLfloat *params);
+	void glGetTexEnviv (GLenum target, GLenum pname, GLint *params);
+	void glGetTexGendv (GLenum coord, GLenum pname, GLdouble *params);
+	void glGetTexGenfv (GLenum coord, GLenum pname, GLfloat *params);
+	void glGetTexGeniv (GLenum coord, GLenum pname, GLint *params);
+	void glGetTexImage (GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels);
+	void glGetTexLevelParameterfv (GLenum target, GLint level, GLenum pname, GLfloat *params);
+	void glGetTexLevelParameteriv (GLenum target, GLint level, GLenum pname, GLint *params);
+	void glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params);
+	void glGetTexParameteriv (GLenum target, GLenum pname, GLint *params);
+	void glHint (GLenum target, GLenum mode);
+	void glIndexMask (GLuint mask);
+	void glIndexPointer (GLenum type, GLsizei stride, GLvoid *pointer);
+	void glIndexd (GLdouble c);
+	void glIndexdv (GLdouble *c);
+	void glIndexf (GLfloat c);
+	void glIndexfv (GLfloat *c);
+	void glIndexi (GLint c);
+	void glIndexiv (GLint *c);
+	void glIndexs (GLshort c);
+	void glIndexsv (GLshort *c);
+	void glIndexub (GLubyte c);
+	void glIndexubv (GLubyte *c);
+	void glInitNames ();
+	void glInterleavedArrays (GLenum format, GLsizei stride, GLvoid *pointer);
+	GLboolean glIsEnabled (GLenum cap);
+	GLboolean glIsList (GLuint list);
+	GLboolean glIsTexture (GLuint texture);
+	void glLightModelf (GLenum pname, GLfloat param);
+	void glLightModelfv (GLenum pname, GLfloat *params);
+	void glLightModeli (GLenum pname, GLint param);
+	void glLightModeliv (GLenum pname, GLint *params);
+	void glLightf (GLenum light, GLenum pname, GLfloat param);
+	void glLightfv (GLenum light, GLenum pname, GLfloat *params);
+	void glLighti (GLenum light, GLenum pname, GLint param);
+	void glLightiv (GLenum light, GLenum pname, GLint *params);
+	void glLineStipple (GLint factor, GLushort pattern);
+	void glLineWidth (GLfloat width);
+	void glListBase (GLuint base);
+	void glLoadIdentity ();
+	void glLoadMatrixd (GLdouble *m);
+	void glLoadMatrixf (GLfloat *m);
+	void glLoadName (GLuint name);
+	void glLogicOp (GLenum opcode);
+	void glMap1d (GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, GLdouble *points);
+	void glMap1f (GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, GLfloat *points);
+	void glMap2d (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble *points);
+	void glMap2f (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat *points);
+	void glMapGrid1d (GLint un, GLdouble u1, GLdouble u2);
+	void glMapGrid1f (GLint un, GLfloat u1, GLfloat u2);
+	void glMapGrid2d (GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2);
+	void glMapGrid2f (GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2);
+	void glMaterialf (GLenum face, GLenum pname, GLfloat param);
+	void glMaterialfv (GLenum face, GLenum pname, GLfloat *params);
+	void glMateriali (GLenum face, GLenum pname, GLint param);
+	void glMaterialiv (GLenum face, GLenum pname, GLint *params);
+	void glMatrixMode (GLenum mode);
+	void glMultMatrixd (GLdouble *m);
+	void glMultMatrixf (GLfloat *m);
+	void glNewList (GLuint list, GLenum mode);
+	void glNormal3b (GLbyte nx, GLbyte ny, GLbyte nz);
+	void glNormal3bv (GLbyte *v);
+	void glNormal3d (GLdouble nx, GLdouble ny, GLdouble nz);
+	void glNormal3dv (GLdouble *v);
+	void glNormal3f (GLfloat nx, GLfloat ny, GLfloat nz);
+	void glNormal3fv (GLfloat *v);
+	void glNormal3i (GLint nx, GLint ny, GLint nz);
+	void glNormal3iv (GLint *v);
+	void glNormal3s (GLshort nx, GLshort ny, GLshort nz);
+	void glNormal3sv (GLshort *v);
+	void glNormalPointer (GLenum type, GLsizei stride, GLvoid *pointer);
+	void glOrtho (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
+	void glPassThrough (GLfloat token);
+	void glPixelMapfv (GLenum map, GLsizei mapsize, GLfloat *values);
+	void glPixelMapuiv (GLenum map, GLsizei mapsize, GLuint *values);
+	void glPixelMapusv (GLenum map, GLsizei mapsize, GLushort *values);
+	void glPixelStoref (GLenum pname, GLfloat param);
+	void glPixelStorei (GLenum pname, GLint param);
+	void glPixelTransferf (GLenum pname, GLfloat param);
+	void glPixelTransferi (GLenum pname, GLint param);
+	void glPixelZoom (GLfloat xfactor, GLfloat yfactor);
+	void glPointSize (GLfloat size);
+	void glPolygonMode (GLenum face, GLenum mode);
+	void glPolygonOffset (GLfloat factor, GLfloat units);
+	void glPolygonStipple (GLubyte *mask);
+	void glPopAttrib ();
+	void glPopClientAttrib ();
+	void glPopMatrix ();
+	void glPopName ();
+	void glPrioritizeTextures (GLsizei n, GLuint *textures, GLclampf *priorities);
+	void glPushAttrib (GLbitfield mask);
+	void glPushClientAttrib (GLbitfield mask);
+	void glPushMatrix ();
+	void glPushName (GLuint name);
+	void glRasterPos2d (GLdouble x, GLdouble y);
+	void glRasterPos2dv (GLdouble *v);
+	void glRasterPos2f (GLfloat x, GLfloat y);
+	void glRasterPos2fv (GLfloat *v);
+	void glRasterPos2i (GLint x, GLint y);
+	void glRasterPos2iv (GLint *v);
+	void glRasterPos2s (GLshort x, GLshort y);
+	void glRasterPos2sv (GLshort *v);
+	void glRasterPos3d (GLdouble x, GLdouble y, GLdouble z);
+	void glRasterPos3dv (GLdouble *v);
+	void glRasterPos3f (GLfloat x, GLfloat y, GLfloat z);
+	void glRasterPos3fv (GLfloat *v);
+	void glRasterPos3i (GLint x, GLint y, GLint z);
+	void glRasterPos3iv (GLint *v);
+	void glRasterPos3s (GLshort x, GLshort y, GLshort z);
+	void glRasterPos3sv (GLshort *v);
+	void glRasterPos4d (GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+	void glRasterPos4dv (GLdouble *v);
+	void glRasterPos4f (GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+	void glRasterPos4fv (GLfloat *v);
+	void glRasterPos4i (GLint x, GLint y, GLint z, GLint w);
+	void glRasterPos4iv (GLint *v);
+	void glRasterPos4s (GLshort x, GLshort y, GLshort z, GLshort w);
+	void glRasterPos4sv (GLshort *v);
+	void glReadBuffer (GLenum mode);
+	void glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels);
+	void glRectd (GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2);
+	void glRectdv (GLdouble *v1, GLdouble *v2);
+	void glRectf (GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2);
+	void glRectfv (GLfloat *v1, GLfloat *v2);
+	void glRecti (GLint x1, GLint y1, GLint x2, GLint y2);
+	void glRectiv (GLint *v1, GLint *v2);
+	void glRects (GLshort x1, GLshort y1, GLshort x2, GLshort y2);
+	void glRectsv (GLshort *v1, GLshort *v2);
+	GLint glRenderMode (GLenum mode);
+	void glRotated (GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
+	void glRotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
+	void glScaled (GLdouble x, GLdouble y, GLdouble z);
+	void glScalef (GLfloat x, GLfloat y, GLfloat z);
+	void glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
+	void glSelectBuffer (GLsizei size, GLuint *buffer);
+	void glShadeModel (GLenum mode);
+	void glStencilFunc (GLenum func, GLint ref_, GLuint mask);
+	void glStencilMask (GLuint mask);
+	void glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
+	void glTexCoord1d (GLdouble s);
+	void glTexCoord1dv (GLdouble *v);
+	void glTexCoord1f (GLfloat s);
+	void glTexCoord1fv (GLfloat *v);
+	void glTexCoord1i (GLint s);
+	void glTexCoord1iv (GLint *v);
+	void glTexCoord1s (GLshort s);
+	void glTexCoord1sv (GLshort *v);
+	void glTexCoord2d (GLdouble s, GLdouble t);
+	void glTexCoord2dv (GLdouble *v);
+	void glTexCoord2f (GLfloat s, GLfloat t);
+	void glTexCoord2fv (GLfloat *v);
+	void glTexCoord2i (GLint s, GLint t);
+	void glTexCoord2iv (GLint *v);
+	void glTexCoord2s (GLshort s, GLshort t);
+	void glTexCoord2sv (GLshort *v);
+	void glTexCoord3d (GLdouble s, GLdouble t, GLdouble r);
+	void glTexCoord3dv (GLdouble *v);
+	void glTexCoord3f (GLfloat s, GLfloat t, GLfloat r);
+	void glTexCoord3fv (GLfloat *v);
+	void glTexCoord3i (GLint s, GLint t, GLint r);
+	void glTexCoord3iv (GLint *v);
+	void glTexCoord3s (GLshort s, GLshort t, GLshort r);
+	void glTexCoord3sv (GLshort *v);
+	void glTexCoord4d (GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+	void glTexCoord4dv (GLdouble *v);
+	void glTexCoord4f (GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+	void glTexCoord4fv (GLfloat *v);
+	void glTexCoord4i (GLint s, GLint t, GLint r, GLint q);
+	void glTexCoord4iv (GLint *v);
+	void glTexCoord4s (GLshort s, GLshort t, GLshort r, GLshort q);
+	void glTexCoord4sv (GLshort *v);
+	void glTexCoordPointer (GLint size, GLenum type, GLsizei stride, GLvoid *pointer);
+	void glTexEnvf (GLenum target, GLenum pname, GLfloat param);
+	void glTexEnvfv (GLenum target, GLenum pname, GLfloat *params);
+	void glTexEnvi (GLenum target, GLenum pname, GLint param);
+	void glTexEnviv (GLenum target, GLenum pname, GLint *params);
+	void glTexGend (GLenum coord, GLenum pname, GLdouble param);
+	void glTexGendv (GLenum coord, GLenum pname, GLdouble *params);
+	void glTexGenf (GLenum coord, GLenum pname, GLfloat param);
+	void glTexGenfv (GLenum coord, GLenum pname, GLfloat *params);
+	void glTexGeni (GLenum coord, GLenum pname, GLint param);
+	void glTexGeniv (GLenum coord, GLenum pname, GLint *params);
+	void glTexImage1D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, GLvoid *pixels);
+	void glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, GLvoid *pixels);
+	void glTexParameterf (GLenum target, GLenum pname, GLfloat param);
+	void glTexParameterfv (GLenum target, GLenum pname, GLfloat *params);
+	void glTexParameteri (GLenum target, GLenum pname, GLint param);
+	void glTexParameteriv (GLenum target, GLenum pname, GLint *params);
+	void glTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, GLvoid *pixels);
+	void glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels);
+	void glTranslated (GLdouble x, GLdouble y, GLdouble z);
+	void glTranslatef (GLfloat x, GLfloat y, GLfloat z);
+	void glVertex2d (GLdouble x, GLdouble y);
+	void glVertex2dv (GLdouble *v);
+	void glVertex2f (GLfloat x, GLfloat y);
+	void glVertex2fv (GLfloat *v);
+	void glVertex2i (GLint x, GLint y);
+	void glVertex2iv (GLint *v);
+	void glVertex2s (GLshort x, GLshort y);
+	void glVertex2sv (GLshort *v);
+	void glVertex3d (GLdouble x, GLdouble y, GLdouble z);
+	void glVertex3dv (GLdouble *v);
+	void glVertex3f (GLfloat x, GLfloat y, GLfloat z);
+	void glVertex3fv (GLfloat *v);
+	void glVertex3i (GLint x, GLint y, GLint z);
+	void glVertex3iv (GLint *v);
+	void glVertex3s (GLshort x, GLshort y, GLshort z);
+	void glVertex3sv (GLshort *v);
+	void glVertex4d (GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+	void glVertex4dv (GLdouble *v);
+	void glVertex4f (GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+	void glVertex4fv (GLfloat *v);
+	void glVertex4i (GLint x, GLint y, GLint z, GLint w);
+	void glVertex4iv (GLint *v);
+	void glVertex4s (GLshort x, GLshort y, GLshort z, GLshort w);
+	void glVertex4sv (GLshort *v);
+	void glVertexPointer (GLint size, GLenum type, GLsizei stride, GLvoid *pointer);
+	void glViewport (GLint x, GLint y, GLsizei width, GLsizei height);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qt/opengl/gltypes.d	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,631 @@
+module qt.opengl.gltypes;
+
+alias uint      GLenum;
+alias ubyte     GLboolean;
+alias uint      GLbitfield;
+alias void      GLvoid;
+alias byte      GLbyte;
+alias short     GLshort;
+alias int       GLint;
+alias ubyte     GLubyte;
+alias ushort    GLushort;
+alias uint      GLuint;
+alias int       GLsizei;
+alias float     GLfloat;
+alias float     GLclampf;
+alias double    GLdouble;
+alias double    GLclampd;
+alias char      GLchar;
+alias ptrdiff_t GLintptr;
+alias ptrdiff_t GLsizeiptr;
+
+// Boolean values
+enum : GLboolean
+{
+    GL_FALSE    = 0x0,
+    GL_TRUE    = 0x1,
+}
+
+enum : GLenum
+{
+    // Data types
+    GL_BYTE                                = 0x1400,
+    GL_UNSIGNED_BYTE                       = 0x1401,
+    GL_SHORT                               = 0x1402,
+    GL_UNSIGNED_SHORT                      = 0x1403,
+    GL_INT                                 = 0x1404,
+    GL_UNSIGNED_INT                        = 0x1405,
+    GL_FLOAT                               = 0x1406,
+    GL_DOUBLE                              = 0x140A,
+    GL_2_BYTES                             = 0x1407,
+    GL_3_BYTES                             = 0x1408,
+    GL_4_BYTES                             = 0x1409,
+
+    // Primitives
+    GL_POINTS                              = 0x0000,
+    GL_LINES                               = 0x0001,
+    GL_LINE_LOOP                           = 0x0002,
+    GL_LINE_STRIP                          = 0x0003,
+    GL_TRIANGLES                           = 0x0004,
+    GL_TRIANGLE_STRIP                      = 0x0005,
+    GL_TRIANGLE_FAN                        = 0x0006,
+    GL_QUADS                               = 0x0007,
+    GL_QUAD_STRIP                          = 0x0008,
+    GL_POLYGON                             = 0x0009,
+
+    // Vertex Arrays
+    GL_VERTEX_ARRAY                        = 0x8074,
+    GL_NORMAL_ARRAY                        = 0x8075,
+    GL_COLOR_ARRAY                         = 0x8076,
+    GL_INDEX_ARRAY                         = 0x8077,
+    GL_TEXTURE_COORD_ARRAY                 = 0x8078,
+    GL_EDGE_FLAG_ARRAY                     = 0x8079,
+    GL_VERTEX_ARRAY_SIZE                   = 0x807A,
+    GL_VERTEX_ARRAY_TYPE                   = 0x807B,
+    GL_VERTEX_ARRAY_STRIDE                 = 0x807C,
+    GL_NORMAL_ARRAY_TYPE                   = 0x807E,
+    GL_NORMAL_ARRAY_STRIDE                 = 0x807F,
+    GL_COLOR_ARRAY_SIZE                    = 0x8081,
+    GL_COLOR_ARRAY_TYPE                    = 0x8082,
+    GL_COLOR_ARRAY_STRIDE                  = 0x8083,
+    GL_INDEX_ARRAY_TYPE                    = 0x8085,
+    GL_INDEX_ARRAY_STRIDE                  = 0x8086,
+    GL_TEXTURE_COORD_ARRAY_SIZE            = 0x8088,
+    GL_TEXTURE_COORD_ARRAY_TYPE            = 0x8089,
+    GL_TEXTURE_COORD_ARRAY_STRIDE          = 0x808A,
+    GL_EDGE_FLAG_ARRAY_STRIDE              = 0x808C,
+    GL_VERTEX_ARRAY_POINTER                = 0x808E,
+    GL_NORMAL_ARRAY_POINTER                = 0x808F,
+    GL_COLOR_ARRAY_POINTER                 = 0x8090,
+    GL_INDEX_ARRAY_POINTER                 = 0x8091,
+    GL_TEXTURE_COORD_ARRAY_POINTER         = 0x8092,
+    GL_EDGE_FLAG_ARRAY_POINTER             = 0x8093,
+    GL_V2F                                 = 0x2A20,
+    GL_V3F                                 = 0x2A21,
+    GL_C4UB_V2F                            = 0x2A22,
+    GL_C4UB_V3F                            = 0x2A23,
+    GL_C3F_V3F                             = 0x2A24,
+    GL_N3F_V3F                             = 0x2A25,
+    GL_C4F_N3F_V3F                         = 0x2A26,
+    GL_T2F_V3F                             = 0x2A27,
+    GL_T4F_V4F                             = 0x2A28,
+    GL_T2F_C4UB_V3F                        = 0x2A29,
+    GL_T2F_C3F_V3F                         = 0x2A2A,
+    GL_T2F_N3F_V3F                         = 0x2A2B,
+    GL_T2F_C4F_N3F_V3F                     = 0x2A2C,
+    GL_T4F_C4F_N3F_V4F                     = 0x2A2D,
+
+    // Matrix Mode
+    GL_MATRIX_MODE                         = 0x0BA0,
+    GL_MODELVIEW                           = 0x1700,
+    GL_PROJECTION                          = 0x1701,
+    GL_TEXTURE                             = 0x1702,
+
+    // Points
+    GL_POINT_SMOOTH                        = 0x0B10,
+    GL_POINT_SIZE                          = 0x0B11,
+    GL_POINT_SIZE_GRANULARITY              = 0x0B13,
+    GL_POINT_SIZE_RANGE                    = 0x0B12,
+
+    // Lines
+    GL_LINE_SMOOTH                         = 0x0B20,
+    GL_LINE_STIPPLE                        = 0x0B24,
+    GL_LINE_STIPPLE_PATTERN                = 0x0B25,
+    GL_LINE_STIPPLE_REPEAT                 = 0x0B26,
+    GL_LINE_WIDTH                          = 0x0B21,
+    GL_LINE_WIDTH_GRANULARITY              = 0x0B23,
+    GL_LINE_WIDTH_RANGE                    = 0x0B22,
+
+    // Polygons
+    GL_POINT                               = 0x1B00,
+    GL_LINE                                = 0x1B01,
+    GL_FILL                                = 0x1B02,
+    GL_CW                                  = 0x0900,
+    GL_CCW                                 = 0x0901,
+    GL_FRONT                               = 0x0404,
+    GL_BACK                                = 0x0405,
+    GL_POLYGON_MODE                        = 0x0B40,
+    GL_POLYGON_SMOOTH                      = 0x0B41,
+    GL_POLYGON_STIPPLE                     = 0x0B42,
+    GL_EDGE_FLAG                           = 0x0B43,
+    GL_CULL_FACE                           = 0x0B44,
+    GL_CULL_FACE_MODE                      = 0x0B45,
+    GL_FRONT_FACE                          = 0x0B46,
+    GL_POLYGON_OFFSET_FACTOR               = 0x8038,
+    GL_POLYGON_OFFSET_UNITS                = 0x2A00,
+    GL_POLYGON_OFFSET_POINT                = 0x2A01,
+    GL_POLYGON_OFFSET_LINE                 = 0x2A02,
+    GL_POLYGON_OFFSET_FILL                 = 0x8037,
+
+    // Display Lists
+    GL_COMPILE                             = 0x1300,
+    GL_COMPILE_AND_EXECUTE                 = 0x1301,
+    GL_LIST_BASE                           = 0x0B32,
+    GL_LIST_INDEX                          = 0x0B33,
+    GL_LIST_MODE                           = 0x0B30,
+
+    // Depth buffer
+    GL_NEVER                               = 0x0200,
+    GL_LESS                                = 0x0201,
+    GL_EQUAL                               = 0x0202,
+    GL_LEQUAL                              = 0x0203,
+    GL_GREATER                             = 0x0204,
+    GL_NOTEQUAL                            = 0x0205,
+    GL_GEQUAL                              = 0x0206,
+    GL_ALWAYS                              = 0x0207,
+    GL_DEPTH_TEST                          = 0x0B71,
+    GL_DEPTH_BITS                          = 0x0D56,
+    GL_DEPTH_CLEAR_VALUE                   = 0x0B73,
+    GL_DEPTH_FUNC                          = 0x0B74,
+    GL_DEPTH_RANGE                         = 0x0B70,
+    GL_DEPTH_WRITEMASK                     = 0x0B72,
+    GL_DEPTH_COMPONENT                     = 0x1902,
+
+    // Lighting
+    GL_LIGHTING                            = 0x0B50,
+    GL_LIGHT0                              = 0x4000,
+    GL_LIGHT1                              = 0x4001,
+    GL_LIGHT2                              = 0x4002,
+    GL_LIGHT3                              = 0x4003,
+    GL_LIGHT4                              = 0x4004,
+    GL_LIGHT5                              = 0x4005,
+    GL_LIGHT6                              = 0x4006,
+    GL_LIGHT7                              = 0x4007,
+    GL_SPOT_EXPONENT                       = 0x1205,
+    GL_SPOT_CUTOFF                         = 0x1206,
+    GL_CONSTANT_ATTENUATION                = 0x1207,
+    GL_LINEAR_ATTENUATION                  = 0x1208,
+    GL_QUADRATIC_ATTENUATION               = 0x1209,
+    GL_AMBIENT                             = 0x1200,
+    GL_DIFFUSE                             = 0x1201,
+    GL_SPECULAR                            = 0x1202,
+    GL_SHININESS                           = 0x1601,
+    GL_EMISSION                            = 0x1600,
+    GL_POSITION                            = 0x1203,
+    GL_SPOT_DIRECTION                      = 0x1204,
+    GL_AMBIENT_AND_DIFFUSE                 = 0x1602,
+    GL_COLOR_INDEXES                       = 0x1603,
+    GL_LIGHT_MODEL_TWO_SIDE                = 0x0B52,
+    GL_LIGHT_MODEL_LOCAL_VIEWER            = 0x0B51,
+    GL_LIGHT_MODEL_AMBIENT                 = 0x0B53,
+    GL_FRONT_AND_BACK                      = 0x0408,
+    GL_SHADE_MODEL                         = 0x0B54,
+    GL_FLAT                                = 0x1D00,
+    GL_SMOOTH                              = 0x1D01,
+    GL_COLOR_MATERIAL                      = 0x0B57,
+    GL_COLOR_MATERIAL_FACE                 = 0x0B55,
+    GL_COLOR_MATERIAL_PARAMETER            = 0x0B56,
+    GL_NORMALIZE                           = 0x0BA1,
+
+    // User clipping planes
+    GL_CLIP_PLANE0                         = 0x3000,
+    GL_CLIP_PLANE1                         = 0x3001,
+    GL_CLIP_PLANE2                         = 0x3002,
+    GL_CLIP_PLANE3                         = 0x3003,
+    GL_CLIP_PLANE4                         = 0x3004,
+    GL_CLIP_PLANE5                         = 0x3005,
+
+    // Accumulation buffer
+    GL_ACCUM_RED_BITS                      = 0x0D58,
+    GL_ACCUM_GREEN_BITS                    = 0x0D59,
+    GL_ACCUM_BLUE_BITS                     = 0x0D5A,
+    GL_ACCUM_ALPHA_BITS                    = 0x0D5B,
+    GL_ACCUM_CLEAR_VALUE                   = 0x0B80,
+    GL_ACCUM                               = 0x0100,
+    GL_ADD                                 = 0x0104,
+    GL_LOAD                                = 0x0101,
+    GL_MULT                                = 0x0103,
+    GL_RETURN                              = 0x0102,
+
+    // Alpha testing
+    GL_ALPHA_TEST                          = 0x0BC0,
+    GL_ALPHA_TEST_REF                      = 0x0BC2,
+    GL_ALPHA_TEST_FUNC                     = 0x0BC1,
+
+    // Blending
+    GL_BLEND                               = 0x0BE2,
+    GL_BLEND_SRC                           = 0x0BE1,
+    GL_BLEND_DST                           = 0x0BE0,
+    GL_ZERO                                = 0x0,
+    GL_ONE                                 = 0x1,
+    GL_SRC_COLOR                           = 0x0300,
+    GL_ONE_MINUS_SRC_COLOR                 = 0x0301,
+    GL_SRC_ALPHA                           = 0x0302,
+    GL_ONE_MINUS_SRC_ALPHA                 = 0x0303,
+    GL_DST_ALPHA                           = 0x0304,
+    GL_ONE_MINUS_DST_ALPHA                 = 0x0305,
+    GL_DST_COLOR                           = 0x0306,
+    GL_ONE_MINUS_DST_COLOR                 = 0x0307,
+    GL_SRC_ALPHA_SATURATE                  = 0x0308,
+    
+    // Render Mode
+    GL_FEEDBACK                            = 0x1C01,
+    GL_RENDER                              = 0x1C00,
+    GL_SELECT                              = 0x1C02,
+
+    // Feedback
+    GL_2D                                  = 0x0600,
+    GL_3D                                  = 0x0601,
+    GL_3D_COLOR                            = 0x0602,
+    GL_3D_COLOR_TEXTURE                    = 0x0603,
+    GL_4D_COLOR_TEXTURE                    = 0x0604,
+    GL_POINT_TOKEN                         = 0x0701,
+    GL_LINE_TOKEN                          = 0x0702,
+    GL_LINE_RESET_TOKEN                    = 0x0707,
+    GL_POLYGON_TOKEN                       = 0x0703,
+    GL_BITMAP_TOKEN                        = 0x0704,
+    GL_DRAW_PIXEL_TOKEN                    = 0x0705,
+    GL_COPY_PIXEL_TOKEN                    = 0x0706,
+    GL_PASS_THROUGH_TOKEN                  = 0x0700,
+    GL_FEEDBACK_BUFFER_POINTER             = 0x0DF0,
+    GL_FEEDBACK_BUFFER_SIZE                = 0x0DF1,
+    GL_FEEDBACK_BUFFER_TYPE                = 0x0DF2,
+
+    // Selection
+    GL_SELECTION_BUFFER_POINTER            = 0x0DF3,
+    GL_SELECTION_BUFFER_SIZE               = 0x0DF4,
+
+    // Fog
+    GL_FOG                                 = 0x0B60,
+    GL_FOG_MODE                            = 0x0B65,
+    GL_FOG_DENSITY                         = 0x0B62,
+    GL_FOG_COLOR                           = 0x0B66,
+    GL_FOG_INDEX                           = 0x0B61,
+    GL_FOG_START                           = 0x0B63,
+    GL_FOG_END                             = 0x0B64,
+    GL_LINEAR                              = 0x2601,
+    GL_EXP                                 = 0x0800,
+    GL_EXP2                                = 0x0801,
+
+    // Logic Ops
+    GL_LOGIC_OP                            = 0x0BF1,
+    GL_INDEX_LOGIC_OP                      = 0x0BF1,
+    GL_COLOR_LOGIC_OP                      = 0x0BF2,
+    GL_LOGIC_OP_MODE                       = 0x0BF0,
+    GL_CLEAR                               = 0x1500,
+    GL_SET                                 = 0x150F,
+    GL_COPY                                = 0x1503,
+    GL_COPY_INVERTED                       = 0x150C,
+    GL_NOOP                                = 0x1505,
+    GL_INVERT                              = 0x150A,
+    GL_AND                                 = 0x1501,
+    GL_NAND                                = 0x150E,
+    GL_OR                                  = 0x1507,
+    GL_NOR                                 = 0x1508,
+    GL_XOR                                 = 0x1506,
+    GL_EQUIV                               = 0x1509,
+    GL_AND_REVERSE                         = 0x1502,
+    GL_AND_INVERTED                        = 0x1504,
+    GL_OR_REVERSE                          = 0x150B,
+    GL_OR_INVERTED                         = 0x150D,
+
+    // Stencil
+    GL_STENCIL_TEST                        = 0x0B90,
+    GL_STENCIL_WRITEMASK                   = 0x0B98,
+    GL_STENCIL_BITS                        = 0x0D57,
+    GL_STENCIL_FUNC                        = 0x0B92,
+    GL_STENCIL_VALUE_MASK                  = 0x0B93,
+    GL_STENCIL_REF                         = 0x0B97,
+    GL_STENCIL_FAIL                        = 0x0B94,
+    GL_STENCIL_PASS_DEPTH_PASS             = 0x0B96,
+    GL_STENCIL_PASS_DEPTH_FAIL             = 0x0B95,
+    GL_STENCIL_CLEAR_VALUE                 = 0x0B91,
+    GL_STENCIL_INDEX                       = 0x1901,
+    GL_KEEP                                = 0x1E00,
+    GL_REPLACE                             = 0x1E01,
+    GL_INCR                                = 0x1E02,
+    GL_DECR                                = 0x1E03,
+
+    // Buffers, Pixel Drawing/Reading
+    GL_NONE                                = 0x0,
+    GL_LEFT                                = 0x0406,
+    GL_RIGHT                               = 0x0407,
+    GL_FRONT_LEFT                          = 0x0400,
+    GL_FRONT_RIGHT                         = 0x0401,
+    GL_BACK_LEFT                           = 0x0402,
+    GL_BACK_RIGHT                          = 0x0403,
+    GL_AUX0                                = 0x0409,
+    GL_AUX1                                = 0x040A,
+    GL_AUX2                                = 0x040B,
+    GL_AUX3                                = 0x040C,
+    GL_COLOR_INDEX                         = 0x1900,
+    GL_RED                                 = 0x1903,
+    GL_GREEN                               = 0x1904,
+    GL_BLUE                                = 0x1905,
+    GL_ALPHA                               = 0x1906,
+    GL_LUMINANCE                           = 0x1909,
+    GL_LUMINANCE_ALPHA                     = 0x190A,
+    GL_ALPHA_BITS                          = 0x0D55,
+    GL_RED_BITS                            = 0x0D52,
+    GL_GREEN_BITS                          = 0x0D53,
+    GL_BLUE_BITS                           = 0x0D54,
+    GL_INDEX_BITS                          = 0x0D51,
+    GL_SUBPIXEL_BITS                       = 0x0D50,
+    GL_AUX_BUFFERS                         = 0x0C00,
+    GL_READ_BUFFER                         = 0x0C02,
+    GL_DRAW_BUFFER                         = 0x0C01,
+    GL_DOUBLEBUFFER                        = 0x0C32,
+    GL_STEREO                              = 0x0C33,
+    GL_BITMAP                              = 0x1A00,
+    GL_COLOR                               = 0x1800,
+    GL_DEPTH                               = 0x1801,
+    GL_STENCIL                             = 0x1802,
+    GL_DITHER                              = 0x0BD0,
+    GL_RGB                                 = 0x1907,
+    GL_RGBA                                = 0x1908,
+
+    // Implementation limits
+    GL_MAX_LIST_NESTING                    = 0x0B31,
+    GL_MAX_ATTRIB_STACK_DEPTH              = 0x0D35,
+    GL_MAX_MODELVIEW_STACK_DEPTH           = 0x0D36,
+    GL_MAX_NAME_STACK_DEPTH                = 0x0D37,
+    GL_MAX_PROJECTION_STACK_DEPTH          = 0x0D38,
+    GL_MAX_TEXTURE_STACK_DEPTH             = 0x0D39,
+    GL_MAX_EVAL_ORDER                      = 0x0D30,
+    GL_MAX_LIGHTS                          = 0x0D31,
+    GL_MAX_CLIP_PLANES                     = 0x0D32,
+    GL_MAX_TEXTURE_SIZE                    = 0x0D33,
+    GL_MAX_PIXEL_MAP_TABLE                 = 0x0D34,
+    GL_MAX_VIEWPORT_DIMS                   = 0x0D3A,
+    GL_MAX_CLIENT_ATTRIB_STACK_DEPTH       = 0x0D3B,
+
+    // Gets
+    GL_ATTRIB_STACK_DEPTH                  = 0x0BB0,
+    GL_CLIENT_ATTRIB_STACK_DEPTH           = 0x0BB1,
+    GL_COLOR_CLEAR_VALUE                   = 0x0C22,
+    GL_COLOR_WRITEMASK                     = 0x0C23,
+    GL_CURRENT_INDEX                       = 0x0B01,
+    GL_CURRENT_COLOR                       = 0x0B00,
+    GL_CURRENT_NORMAL                      = 0x0B02,
+    GL_CURRENT_RASTER_COLOR                = 0x0B04,
+    GL_CURRENT_RASTER_DISTANCE             = 0x0B09,
+    GL_CURRENT_RASTER_INDEX                = 0x0B05,
+    GL_CURRENT_RASTER_POSITION             = 0x0B07,
+    GL_CURRENT_RASTER_TEXTURE_COORDS       = 0x0B06,
+    GL_CURRENT_RASTER_POSITION_VALID       = 0x0B08,
+    GL_CURRENT_TEXTURE_COORDS              = 0x0B03,
+    GL_INDEX_CLEAR_VALUE                   = 0x0C20,
+    GL_INDEX_MODE                          = 0x0C30,
+    GL_INDEX_WRITEMASK                     = 0x0C21,
+    GL_MODELVIEW_MATRIX                    = 0x0BA6,
+    GL_MODELVIEW_STACK_DEPTH               = 0x0BA3,
+    GL_NAME_STACK_DEPTH                    = 0x0D70,
+    GL_PROJECTION_MATRIX                   = 0x0BA7,
+    GL_PROJECTION_STACK_DEPTH              = 0x0BA4,
+    GL_RENDER_MODE                         = 0x0C40,
+    GL_RGBA_MODE                           = 0x0C31,
+    GL_TEXTURE_MATRIX                      = 0x0BA8,
+    GL_TEXTURE_STACK_DEPTH                 = 0x0BA5,
+    GL_VIEWPORT                            = 0x0BA2,
+
+    // Evaluators
+    GL_AUTO_NORMAL                         = 0x0D80,
+    GL_MAP1_COLOR_4                        = 0x0D90,
+    GL_MAP1_GRID_DOMAIN                    = 0x0DD0,
+    GL_MAP1_GRID_SEGMENTS                  = 0x0DD1,
+    GL_MAP1_INDEX                          = 0x0D91,
+    GL_MAP1_NORMAL                         = 0x0D92,
+    GL_MAP1_TEXTURE_COORD_1                = 0x0D93,
+    GL_MAP1_TEXTURE_COORD_2                = 0x0D94,
+    GL_MAP1_TEXTURE_COORD_3                = 0x0D95,
+    GL_MAP1_TEXTURE_COORD_4                = 0x0D96,
+    GL_MAP1_VERTEX_3                       = 0x0D97,
+    GL_MAP1_VERTEX_4                       = 0x0D98,
+    GL_MAP2_COLOR_4                        = 0x0DB0,
+    GL_MAP2_GRID_DOMAIN                    = 0x0DD2,
+    GL_MAP2_GRID_SEGMENTS                  = 0x0DD3,
+    GL_MAP2_INDEX                          = 0x0DB1,
+    GL_MAP2_NORMAL                         = 0x0DB2,
+    GL_MAP2_TEXTURE_COORD_1                = 0x0DB3,
+    GL_MAP2_TEXTURE_COORD_2                = 0x0DB4,
+    GL_MAP2_TEXTURE_COORD_3                = 0x0DB5,
+    GL_MAP2_TEXTURE_COORD_4                = 0x0DB6,
+    GL_MAP2_VERTEX_3                       = 0x0DB7,
+    GL_MAP2_VERTEX_4                       = 0x0DB8,
+    GL_COEFF                               = 0x0A00,
+    GL_DOMAIN                              = 0x0A02,
+    GL_ORDER                               = 0x0A01,
+
+    // Hints
+    GL_FOG_HINT                            = 0x0C54,
+    GL_LINE_SMOOTH_HINT                    = 0x0C52,
+    GL_PERSPECTIVE_CORRECTION_HINT         = 0x0C50,
+    GL_POINT_SMOOTH_HINT                   = 0x0C51,
+    GL_POLYGON_SMOOTH_HINT                 = 0x0C53,
+    GL_DONT_CARE                           = 0x1100,
+    GL_FASTEST                             = 0x1101,
+    GL_NICEST                              = 0x1102,
+
+    // Scissor box
+    GL_SCISSOR_TEST                        = 0x0C11,
+    GL_SCISSOR_BOX                         = 0x0C10,
+
+    // Pixel Mode / Transfer
+    GL_MAP_COLOR                           = 0x0D10,
+    GL_MAP_STENCIL                         = 0x0D11,
+    GL_INDEX_SHIFT                         = 0x0D12,
+    GL_INDEX_OFFSET                        = 0x0D13,
+    GL_RED_SCALE                           = 0x0D14,
+    GL_RED_BIAS                            = 0x0D15,
+    GL_GREEN_SCALE                         = 0x0D18,
+    GL_GREEN_BIAS                          = 0x0D19,
+    GL_BLUE_SCALE                          = 0x0D1A,
+    GL_BLUE_BIAS                           = 0x0D1B,
+    GL_ALPHA_SCALE                         = 0x0D1C,
+    GL_ALPHA_BIAS                          = 0x0D1D,
+    GL_DEPTH_SCALE                         = 0x0D1E,
+    GL_DEPTH_BIAS                          = 0x0D1F,
+    GL_PIXEL_MAP_S_TO_S_SIZE               = 0x0CB1,
+    GL_PIXEL_MAP_I_TO_I_SIZE               = 0x0CB0,
+    GL_PIXEL_MAP_I_TO_R_SIZE               = 0x0CB2,
+    GL_PIXEL_MAP_I_TO_G_SIZE               = 0x0CB3,
+    GL_PIXEL_MAP_I_TO_B_SIZE               = 0x0CB4,
+    GL_PIXEL_MAP_I_TO_A_SIZE               = 0x0CB5,
+    GL_PIXEL_MAP_R_TO_R_SIZE               = 0x0CB6,
+    GL_PIXEL_MAP_G_TO_G_SIZE               = 0x0CB7,
+    GL_PIXEL_MAP_B_TO_B_SIZE               = 0x0CB8,
+    GL_PIXEL_MAP_A_TO_A_SIZE               = 0x0CB9,
+    GL_PIXEL_MAP_S_TO_S                    = 0x0C71,
+    GL_PIXEL_MAP_I_TO_I                    = 0x0C70,
+    GL_PIXEL_MAP_I_TO_R                    = 0x0C72,
+    GL_PIXEL_MAP_I_TO_G                    = 0x0C73,
+    GL_PIXEL_MAP_I_TO_B                    = 0x0C74,
+    GL_PIXEL_MAP_I_TO_A                    = 0x0C75,
+    GL_PIXEL_MAP_R_TO_R                    = 0x0C76,
+    GL_PIXEL_MAP_G_TO_G                    = 0x0C77,
+    GL_PIXEL_MAP_B_TO_B                    = 0x0C78,
+    GL_PIXEL_MAP_A_TO_A                    = 0x0C79,
+    GL_PACK_ALIGNMENT                      = 0x0D05,
+    GL_PACK_LSB_FIRST                      = 0x0D01,
+    GL_PACK_ROW_LENGTH                     = 0x0D02,
+    GL_PACK_SKIP_PIXELS                    = 0x0D04,
+    GL_PACK_SKIP_ROWS                      = 0x0D03,
+    GL_PACK_SWAP_BYTES                     = 0x0D00,
+    GL_UNPACK_ALIGNMENT                    = 0x0CF5,
+    GL_UNPACK_LSB_FIRST                    = 0x0CF1,
+    GL_UNPACK_ROW_LENGTH                   = 0x0CF2,
+    GL_UNPACK_SKIP_PIXELS                  = 0x0CF4,
+    GL_UNPACK_SKIP_ROWS                    = 0x0CF3,
+    GL_UNPACK_SWAP_BYTES                   = 0x0CF0,
+    GL_ZOOM_X                              = 0x0D16,
+    GL_ZOOM_Y                              = 0x0D17,
+
+    // Texture mapping
+    GL_TEXTURE_ENV                         = 0x2300,
+    GL_TEXTURE_ENV_MODE                    = 0x2200,
+    GL_TEXTURE_1D                          = 0x0DE0,
+    GL_TEXTURE_2D                          = 0x0DE1,
+    GL_TEXTURE_WRAP_S                      = 0x2802,
+    GL_TEXTURE_WRAP_T                      = 0x2803,
+    GL_TEXTURE_MAG_FILTER                  = 0x2800,
+    GL_TEXTURE_MIN_FILTER                  = 0x2801,
+    GL_TEXTURE_ENV_COLOR                   = 0x2201,
+    GL_TEXTURE_GEN_S                       = 0x0C60,
+    GL_TEXTURE_GEN_T                       = 0x0C61,
+    GL_TEXTURE_GEN_MODE                    = 0x2500,
+    GL_TEXTURE_BORDER_COLOR                = 0x1004,
+    GL_TEXTURE_WIDTH                       = 0x1000,
+    GL_TEXTURE_HEIGHT                      = 0x1001,
+    GL_TEXTURE_BORDER                      = 0x1005,
+    GL_TEXTURE_COMPONENTS                  = 0x1003,
+    GL_TEXTURE_RED_SIZE                    = 0x805C,
+    GL_TEXTURE_GREEN_SIZE                  = 0x805D,
+    GL_TEXTURE_BLUE_SIZE                   = 0x805E,
+    GL_TEXTURE_ALPHA_SIZE                  = 0x805F,
+    GL_TEXTURE_LUMINANCE_SIZE              = 0x8060,
+    GL_TEXTURE_INTENSITY_SIZE              = 0x8061,
+    GL_NEAREST_MIPMAP_NEAREST              = 0x2700,
+    GL_NEAREST_MIPMAP_LINEAR               = 0x2702,
+    GL_LINEAR_MIPMAP_NEAREST               = 0x2701,
+    GL_LINEAR_MIPMAP_LINEAR                = 0x2703,
+    GL_OBJECT_LINEAR                       = 0x2401,
+    GL_OBJECT_PLANE                        = 0x2501,
+    GL_EYE_LINEAR                          = 0x2400,
+    GL_EYE_PLANE                           = 0x2502,
+    GL_SPHERE_MAP                          = 0x2402,
+    GL_DECAL                               = 0x2101,
+    GL_MODULATE                            = 0x2100,
+    GL_NEAREST                             = 0x2600,
+    GL_REPEAT                              = 0x2901,
+    GL_CLAMP                               = 0x2900,
+    GL_S                                   = 0x2000,
+    GL_T                                   = 0x2001,
+    GL_R                                   = 0x2002,
+    GL_Q                                   = 0x2003,
+    GL_TEXTURE_GEN_R                       = 0x0C62,
+    GL_TEXTURE_GEN_Q                       = 0x0C63,
+
+    // Utility
+    GL_VENDOR                              = 0x1F00,
+    GL_RENDERER                            = 0x1F01,
+    GL_VERSION                             = 0x1F02,
+    GL_EXTENSIONS                          = 0x1F03,
+
+    // Errors
+    GL_NO_ERROR                            = 0x0,
+    GL_INVALID_VALUE                       = 0x0501,
+    GL_INVALID_ENUM                        = 0x0500,
+    GL_INVALID_OPERATION                   = 0x0502,
+    GL_STACK_OVERFLOW                      = 0x0503,
+    GL_STACK_UNDERFLOW                     = 0x0504,
+    GL_OUT_OF_MEMORY                       = 0x0505,
+}
+
+// glPush/PopAttrib bits
+enum : GLuint
+{
+    GL_CURRENT_BIT                         = 0x00000001,
+    GL_POINT_BIT                           = 0x00000002,
+    GL_LINE_BIT                            = 0x00000004,
+    GL_POLYGON_BIT                         = 0x00000008,
+    GL_POLYGON_STIPPLE_BIT                 = 0x00000010,
+    GL_PIXEL_MODE_BIT                      = 0x00000020,
+    GL_LIGHTING_BIT                        = 0x00000040,
+    GL_FOG_BIT                             = 0x00000080,
+    GL_DEPTH_BUFFER_BIT                    = 0x00000100,
+    GL_ACCUM_BUFFER_BIT                    = 0x00000200,
+    GL_STENCIL_BUFFER_BIT                  = 0x00000400,
+    GL_VIEWPORT_BIT                        = 0x00000800,
+    GL_TRANSFORM_BIT                       = 0x00001000,
+    GL_ENABLE_BIT                          = 0x00002000,
+    GL_COLOR_BUFFER_BIT                    = 0x00004000,
+    GL_HINT_BIT                            = 0x00008000,
+    GL_EVAL_BIT                            = 0x00010000,
+    GL_LIST_BIT                            = 0x00020000,
+    GL_TEXTURE_BIT                         = 0x00040000,
+    GL_SCISSOR_BIT                         = 0x00080000,
+    GL_ALL_ATTRIB_BITS                     = 0x000FFFFF,
+}
+
+// gl 1.1
+enum : GLenum
+{
+GL_PROXY_TEXTURE_1D                    = 0x8063,
+GL_PROXY_TEXTURE_2D                    = 0x8064,
+GL_TEXTURE_PRIORITY                    = 0x8066,
+GL_TEXTURE_RESIDENT                    = 0x8067,
+GL_TEXTURE_BINDING_1D                  = 0x8068,
+GL_TEXTURE_BINDING_2D                  = 0x8069,
+GL_TEXTURE_INTERNAL_FORMAT             = 0x1003,
+GL_ALPHA4                              = 0x803B,
+GL_ALPHA8                              = 0x803C,
+GL_ALPHA12                             = 0x803D,
+GL_ALPHA16                             = 0x803E,
+GL_LUMINANCE4                          = 0x803F,
+GL_LUMINANCE8                          = 0x8040,
+GL_LUMINANCE12                         = 0x8041,
+GL_LUMINANCE16                         = 0x8042,
+GL_LUMINANCE4_ALPHA4                   = 0x8043,
+GL_LUMINANCE6_ALPHA2                   = 0x8044,
+GL_LUMINANCE8_ALPHA8                   = 0x8045,
+GL_LUMINANCE12_ALPHA4                  = 0x8046,
+GL_LUMINANCE12_ALPHA12                 = 0x8047,
+GL_LUMINANCE16_ALPHA16                 = 0x8048,
+GL_INTENSITY                           = 0x8049,
+GL_INTENSITY4                          = 0x804A,
+GL_INTENSITY8                          = 0x804B,
+GL_INTENSITY12                         = 0x804C,
+GL_INTENSITY16                         = 0x804D,
+GL_R3_G3_B2                            = 0x2A10,
+GL_RGB4                                = 0x804F,
+GL_RGB5                                = 0x8050,
+GL_RGB8                                = 0x8051,
+GL_RGB10                               = 0x8052,
+GL_RGB12                               = 0x8053,
+GL_RGB16                               = 0x8054,
+GL_RGBA2                               = 0x8055,
+GL_RGBA4                               = 0x8056,
+GL_RGB5_A1                             = 0x8057,
+GL_RGBA8                               = 0x8058,
+GL_RGB10_A2                            = 0x8059,
+GL_RGBA12                              = 0x805A,
+GL_RGBA16                              = 0x805B,
+}
+
+enum : GLuint
+{
+    GL_CLIENT_PIXEL_STORE_BIT              = 0x00000001,
+    GL_CLIENT_VERTEX_ARRAY_BIT             = 0x00000002,
+    GL_ALL_CLIENT_ATTRIB_BITS              = 0xFFFFFFFF,
+    GL_CLIENT_ALL_ATTRIB_BITS              = 0xFFFFFFFF,
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qt/opengl/glu.d	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,196 @@
+module qt.opengl.glu;
+
+private import qt.opengl.gltypes;
+
+//==============================================================================
+// CONSTANTS
+//==============================================================================
+enum : GLenum
+{
+    // StringName
+    GLU_VERSION                      = 100800,
+    GLU_EXTENSIONS                   = 100801,
+    // ErrorCode
+    GLU_INVALID_ENUM                 = 100900,
+    GLU_INVALID_VALUE                = 100901,
+    GLU_OUT_OF_MEMORY                = 100902,
+    GLU_INVALID_OPERATION            = 100904,
+    // NurbsDisplay
+    GLU_OUTLINE_POLYGON              = 100240,
+    GLU_OUTLINE_PATCH                = 100241,
+    // NurbsCallback
+    GLU_NURBS_ERROR                  = 100103,
+    GLU_ERROR                        = 100103,
+    GLU_NURBS_BEGIN                  = 100164,
+    GLU_NURBS_BEGIN_EXT              = 100164,
+    GLU_NURBS_VERTEX                 = 100165,
+    GLU_NURBS_VERTEX_EXT             = 100165,
+    GLU_NURBS_NORMAL                 = 100166,
+    GLU_NURBS_NORMAL_EXT             = 100166,
+    GLU_NURBS_COLOR                  = 100167,
+    GLU_NURBS_COLOR_EXT              = 100167,
+    GLU_NURBS_TEXTURE_COORD          = 100168,
+    GLU_NURBS_TEX_COORD_EXT          = 100168,
+    GLU_NURBS_END                    = 100169,
+    GLU_NURBS_END_EXT                = 100169,
+    GLU_NURBS_BEGIN_DATA             = 100170,
+    GLU_NURBS_BEGIN_DATA_EXT         = 100170,
+    GLU_NURBS_VERTEX_DATA            = 100171,
+    GLU_NURBS_VERTEX_DATA_EXT        = 100171,
+    GLU_NURBS_NORMAL_DATA            = 100172,
+    GLU_NURBS_NORMAL_DATA_EXT        = 100172,
+    GLU_NURBS_COLOR_DATA             = 100173,
+    GLU_NURBS_COLOR_DATA_EXT         = 100173,
+    GLU_NURBS_TEXTURE_COORD_DATA     = 100174,
+    GLU_NURBS_TEX_COORD_DATA_EXT     = 100174,
+    GLU_NURBS_END_DATA               = 100175,
+    GLU_NURBS_END_DATA_EXT           = 100175,
+    // NurbsError
+    GLU_NURBS_ERROR1                 = 100251,
+    GLU_NURBS_ERROR2                 = 100252,
+    GLU_NURBS_ERROR3                 = 100253,
+    GLU_NURBS_ERROR4                 = 100254,
+    GLU_NURBS_ERROR5                 = 100255,
+    GLU_NURBS_ERROR6                 = 100256,
+    GLU_NURBS_ERROR7                 = 100257,
+    GLU_NURBS_ERROR8                 = 100258,
+    GLU_NURBS_ERROR9                 = 100259,
+    GLU_NURBS_ERROR10                = 100260,
+    GLU_NURBS_ERROR11                = 100261,
+    GLU_NURBS_ERROR12                = 100262,
+    GLU_NURBS_ERROR13                = 100263,
+    GLU_NURBS_ERROR14                = 100264,
+    GLU_NURBS_ERROR15                = 100265,
+    GLU_NURBS_ERROR16                = 100266,
+    GLU_NURBS_ERROR17                = 100267,
+    GLU_NURBS_ERROR18                = 100268,
+    GLU_NURBS_ERROR19                = 100269,
+    GLU_NURBS_ERROR20                = 100270,
+    GLU_NURBS_ERROR21                = 100271,
+    GLU_NURBS_ERROR22                = 100272,
+    GLU_NURBS_ERROR23                = 100273,
+    GLU_NURBS_ERROR24                = 100274,
+    GLU_NURBS_ERROR25                = 100275,
+    GLU_NURBS_ERROR26                = 100276,
+    GLU_NURBS_ERROR27                = 100277,
+    GLU_NURBS_ERROR28                = 100278,
+    GLU_NURBS_ERROR29                = 100279,
+    GLU_NURBS_ERROR30                = 100280,
+    GLU_NURBS_ERROR31                = 100281,
+    GLU_NURBS_ERROR32                = 100282,
+    GLU_NURBS_ERROR33                = 100283,
+    GLU_NURBS_ERROR34                = 100284,
+    GLU_NURBS_ERROR35                = 100285,
+    GLU_NURBS_ERROR36                = 100286,
+    GLU_NURBS_ERROR37                = 100287,
+    // NurbsProperty
+    GLU_AUTO_LOAD_MATRIX             = 100200,
+    GLU_CULLING                      = 100201,
+    GLU_SAMPLING_TOLERANCE           = 100203,
+    GLU_DISPLAY_MODE                 = 100204,
+    GLU_PARAMETRIC_TOLERANCE         = 100202,
+    GLU_SAMPLING_METHOD              = 100205,
+    GLU_U_STEP                       = 100206,
+    GLU_V_STEP                       = 100207,
+    GLU_NURBS_MODE                   = 100160,
+    GLU_NURBS_MODE_EXT               = 100160,
+    GLU_NURBS_TESSELLATOR            = 100161,
+    GLU_NURBS_TESSELLATOR_EXT        = 100161,
+    GLU_NURBS_RENDERER               = 100162,
+    GLU_NURBS_RENDERER_EXT           = 100162,
+    // NurbsSampling
+    GLU_OBJECT_PARAMETRIC_ERROR      = 100208,
+    GLU_OBJECT_PARAMETRIC_ERROR_EXT  = 100208,
+    GLU_OBJECT_PATH_LENGTH           = 100209,
+    GLU_OBJECT_PATH_LENGTH_EXT       = 100209,
+    GLU_PATH_LENGTH                  = 100215,
+    GLU_PARAMETRIC_ERROR             = 100216,
+    GLU_DOMAIN_DISTANCE              = 100217,
+    // NurbsTrim
+    GLU_MAP1_TRIM_2                  = 100210,
+    GLU_MAP2_TRIM_3                  = 100211,
+    // QuadricDrawStyle
+    GLU_POINT                        = 100010,
+    GLU_LINE                         = 100011,
+    GLU_FILL                         = 100012,
+    GLU_SILHOUETTE                   = 100013,
+    // QuadricNormal
+    GLU_SMOOTH                       = 100000,
+    GLU_FLAT                         = 100001,
+    GLU_NONE                         = 100002,
+    // QuadricOrientation
+    GLU_OUTSIDE                      = 100020,
+    GLU_INSIDE                       = 100021,
+    // TessCallback
+    GLU_TESS_BEGIN                   = 100100,
+    GLU_BEGIN                        = 100100,
+    GLU_TESS_VERTEX                  = 100101,
+    GLU_VERTEX                       = 100101,
+    GLU_TESS_END                     = 100102,
+    GLU_END                          = 100102,
+    GLU_TESS_ERROR                   = 100103,
+    GLU_TESS_EDGE_FLAG               = 100104,
+    GLU_EDGE_FLAG                    = 100104,
+    GLU_TESS_COMBINE                 = 100105,
+    GLU_TESS_BEGIN_DATA              = 100106,
+    GLU_TESS_VERTEX_DATA             = 100107,
+    GLU_TESS_END_DATA                = 100108,
+    GLU_TESS_ERROR_DATA              = 100109,
+    GLU_TESS_EDGE_FLAG_DATA          = 100110,
+    GLU_TESS_COMBINE_DATA            = 100111,
+    // TessContour
+    GLU_CW                           = 100120,
+    GLU_CCW                          = 100121,
+    GLU_INTERIOR                     = 100122,
+    GLU_EXTERIOR                     = 100123,
+    GLU_UNKNOWN                      = 100124,
+    // TessProperty
+    GLU_TESS_WINDING_RULE            = 100140,
+    GLU_TESS_BOUNDARY_ONLY           = 100141,
+    GLU_TESS_TOLERANCE               = 100142,
+    // TessError
+    GLU_TESS_ERROR1                  = 100151,
+    GLU_TESS_ERROR2                  = 100152,
+    GLU_TESS_ERROR3                  = 100153,
+    GLU_TESS_ERROR4                  = 100154,
+    GLU_TESS_ERROR5                  = 100155,
+    GLU_TESS_ERROR6                  = 100156,
+    GLU_TESS_ERROR7                  = 100157,
+    GLU_TESS_ERROR8                  = 100158,
+    GLU_TESS_MISSING_BEGIN_POLYGON   = 100151,
+    GLU_TESS_MISSING_BEGIN_COUNTER   = 100152,
+    GLU_TESS_MISSING_END_POLYGON     = 100153,
+    GLU_TESS_MISSING_END_COUNTER     = 100154,
+    GLU_TESS_COORD_TOO_LARGE         = 100155,
+    GLU_TESS_NEED_COMBINE_CALLBACK   = 100156,
+    // TessWinding
+    GLU_TESS_WINDING_ODD             = 100130,
+    GLU_TESS_WINDING_NONZERO         = 100131,
+    GLU_TESS_WINDING_POSITIVE        = 100132,
+    GLU_TESS_WINDING_NEGATIVE        = 100133,
+    GLU_TESS_WINDING_ABS_GEQ_TWO     = 100134,
+}
+
+const GLdouble GLU_TESS_MAX_COORD           = 1.0e150;
+
+//==============================================================================
+// TYPES
+//==============================================================================
+struct GLUnurbs {}
+struct GLUquadric {}
+struct GLUtesselator {}
+
+typedef GLUnurbs GLUnurbsObj;
+typedef GLUquadric GLUquadricObj;
+typedef GLUtesselator GLUtesselatorObj;
+typedef GLUtesselator GLUtriangulatorObj;
+
+extern(System)
+{
+	void gluOrtho2D(GLdouble,GLdouble,GLdouble,GLdouble);
+	void gluPerspective(GLdouble,GLdouble,GLdouble,GLdouble);
+	void gluLookAt(GLdouble,GLdouble,GLdouble,GLdouble,GLdouble,GLdouble,GLdouble,GLdouble,GLdouble);
+	GLint gluProject(GLdouble,GLdouble,GLdouble,GLdouble*,GLdouble*,GLint*,GLdouble*,GLdouble*,GLdouble*);
+	GLint gluUnProject(GLdouble,GLdouble,GLdouble,GLdouble*,GLdouble*,GLint*,GLdouble*,GLdouble*,GLdouble*);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qt/qtd/Array.d	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,37 @@
+/**
+ *
+ *  Copyright: Copyright QtD Team, 2008-2009
+ *  Authors: Max Samukha
+ *  License: <a href="http://www.boost.org/LICENSE_1_0.txt>Boost License 1.0</a>
+ *
+ *  Copyright QtD Team, 2008-2009
+ *  Distributed under the Boost Software License, Version 1.0.
+ *  (See accompanying file boost-license-1.0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ */
+module qt.qtd.Array;
+
+version (Tango)
+    import tango.stdc.string;
+else
+    import core.stdc.string;
+
+void remove(T)(ref T[] haystack, T needle)
+{
+    foreach (i, e; haystack)
+    {
+        if (e == needle)
+        {
+            if (haystack.length > 1)
+            {
+                i++;
+                memmove(haystack.ptr + i - 1, haystack.ptr + i, (haystack.length - i) * T.sizeof);
+                haystack.length = haystack.length - 1;
+            }
+            else
+                haystack.length = 0;
+
+            break;
+        }
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qt/qtd/ArrayOpsPrimitive.d	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,111 @@
+/**
+*
+*  Copyright: Copyright QtD Team, 2008-2009
+*  License: <a href="http://www.boost.org/LICENSE_1_0.txt>Boost License 1.0</a>
+*
+*  Copyright QtD Team, 2008-2009
+*  Distributed under the Boost Software License, Version 1.0.
+*  (See accompanying file boost-license-1.0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+*
+*/
+
+module qt.qtd.ArrayOpsPrimitive;
+
+import qt.QGlobal;
+
+// int
+private extern(C) void qtd_allocate_int_array(int[]* arr, size_t len)
+{
+    *arr = new int[len];
+}
+
+private extern(C) void qtd_assign_int_array_element(int[]* arr, size_t pos, int elem)
+{
+    (*arr)[pos] = elem;
+}
+
+private extern(C) void qtd_get_int_from_array(int* arr, size_t pos, int* elem)
+{
+    *elem = arr[pos];
+}
+
+// uint
+private extern(C) void qtd_allocate_uint_array(int[]* arr, size_t len)
+{
+    *arr = new int[len];
+}
+
+private extern(C) void qtd_assign_uint_array_element(int[]* arr, size_t pos, uint elem)
+{
+    (*arr)[pos] = elem;
+}
+
+private extern(C) void qtd_get_uint_from_array(uint* arr, size_t pos, uint* elem)
+{
+    *elem = arr[pos];
+}
+
+// double
+private extern(C) void qtd_allocate_double_array(double[]* arr, size_t len)
+{
+    *arr = new double[len];
+}
+
+private extern(C) void qtd_assign_double_array_element(double[]* arr, size_t pos, double elem)
+{
+    (*arr)[pos] = elem;
+}
+
+private extern(C) void qtd_get_double_from_array(double* arr, size_t pos, double* elem)
+{
+    *elem = arr[pos];
+}
+
+// string
+private extern(C) void qtd_allocate_string_array(string[]* arr, size_t len)
+{
+    *arr = new string[len];
+}
+
+private extern(C) void qtd_assign_string_array_element(string[]* arr, size_t pos, string* elem)
+{
+}
+
+private extern(C) void* qtd_string_from_array(string[]* arr, size_t pos)
+{
+    return &((*arr)[pos]);
+}
+
+private extern(C) void qtd_get_string_from_array(string* arr, size_t pos, char** elem, size_t* elem_size)
+{
+    *elem = arr[pos].ptr;
+    *elem_size = arr[pos].length;
+}
+
+version(Windows)
+{
+    extern (C) void qtd_core_ArrayOps_initCallBacks(void* callbacks);
+
+    static this() {
+        void*[13] callbacks;
+
+        callbacks[0] = &qtd_allocate_int_array;
+        callbacks[1] = &qtd_assign_int_array_element;
+        callbacks[2] = &qtd_get_int_from_array;
+        
+        callbacks[3] = &qtd_allocate_uint_array;
+        callbacks[4] = &qtd_assign_uint_array_element;
+        callbacks[5] = &qtd_get_uint_from_array;
+        
+        callbacks[6] = &qtd_allocate_double_array;
+        callbacks[7] = &qtd_assign_double_array_element;
+        callbacks[8] = &qtd_get_double_from_array;
+        
+        callbacks[9] = &qtd_allocate_string_array;
+        callbacks[10] = &qtd_assign_string_array_element;
+        callbacks[11] = &qtd_string_from_array;
+        callbacks[12] = &qtd_get_string_from_array;
+        
+        qtd_core_ArrayOps_initCallBacks(callbacks.ptr);
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qt/qtd/CMakeLists.txt	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,3 @@
+set(QT_QTD_SRCS_D
+Str.d
+)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qt/qtd/Str.d	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,55 @@
+/**
+ *
+ *  Copyright: Copyright QtD Team, 2008-2009
+ *  License: <a href="http://www.boost.org/LICENSE_1_0.txt>Boost License 1.0</a>
+ *
+ *  Copyright QtD Team, 2008-2009
+ *  Distributed under the Boost Software License, Version 1.0.
+ *  (See accompanying file boost-license-1.0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ */
+
+module qt.qtd.Str;
+
+version (Tango)
+{
+    import tango.text.convert.Utf : toString;
+    alias char[] string;
+}
+else
+{
+    import std.utf : toString = toUTF8;
+}
+
+public static char** toStringzArray(char[][] args)
+{
+	if ( args is null )
+	{
+		return null;
+	}
+	char** argv = (new char*[args.length]).ptr;
+	int argc = 0;
+	foreach (char[] p; args)
+	{
+		argv[argc++] = cast(char*)(p.dup~'\0');
+	}
+	argv[argc] = null;
+
+	return argv;
+}
+version(Windows)
+{
+    export extern(C) void _d_toUtf8(wchar* arr, uint size, string* str)
+    {
+        *str = toString(arr[0..size]);
+    }
+}
+else
+{
+    extern(C) void _d_toUtf8(wchar* arr, uint size, string* str)
+    {
+        *str = toString(arr[0..size]);
+    }
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/duic/CMakeLists.txt	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,34 @@
+cmake_minimum_required(VERSION 2.6)
+find_package(Qt4 REQUIRED)
+
+include_directories( ${QT_INCLUDE_DIR}
+			${CMAKE_CURRENT_SOURCE_DIR}
+			${CMAKE_CURRENT_SOURCE_DIR}/d )
+
+########### next target ###############
+
+set(uic_bin_SRCS 
+   customwidgetsinfo.cpp 
+   databaseinfo.cpp 
+   driver.cpp 
+   treewalker.cpp 
+   ui4.cpp 
+   uic.cpp 
+   validator.cpp 
+   ${CMAKE_CURRENT_SOURCE_DIR}/d/dextractimages.cpp
+   ${CMAKE_CURRENT_SOURCE_DIR}/d/dwritedeclaration.cpp 
+   ${CMAKE_CURRENT_SOURCE_DIR}/d/dwriteincludes.cpp 
+   ${CMAKE_CURRENT_SOURCE_DIR}/d/dwriteicondata.cpp 
+   ${CMAKE_CURRENT_SOURCE_DIR}/d/dwriteicondeclaration.cpp 
+   ${CMAKE_CURRENT_SOURCE_DIR}/d/dwriteiconinitialization.cpp 
+   ${CMAKE_CURRENT_SOURCE_DIR}/d/dwriteinitialization.cpp 
+   main.cpp )
+
+add_executable(duic ${uic_bin_SRCS})
+set_target_properties(duic PROPERTIES OUTPUT_NAME duic)
+set_target_properties(duic PROPERTIES COMPILE_FLAGS -DQT_UIC_D_GENERATOR)
+
+target_link_libraries(duic  ${QT_QTCORE_LIBRARY} ${QT_QTXML_LIBRARY} )
+
+install(TARGETS duic DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/duic/customwidgetsinfo.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,109 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+** exception, Nokia gives you certain additional rights. These rights
+** are described in the Nokia Qt GPL Exception version 1.3, included in
+** the file GPL_EXCEPTION.txt in this package.
+**
+** Qt for Windows(R) Licensees
+** As a special exception, Nokia, as the sole copyright holder for Qt
+** Designer, grants users of the Qt/Eclipse Integration plug-in the
+** right for the Qt/Eclipse Integration to link to functionality
+** provided by Qt Designer and its related libraries.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+****************************************************************************/
+
+#include "customwidgetsinfo.h"
+#include "driver.h"
+#include "ui4.h"
+#include "utils.h"
+
+QT_BEGIN_NAMESPACE
+
+CustomWidgetsInfo::CustomWidgetsInfo()
+{
+}
+
+void CustomWidgetsInfo::acceptUI(DomUI *node)
+{
+    m_customWidgets.clear();
+
+    if (node->elementCustomWidgets())
+        acceptCustomWidgets(node->elementCustomWidgets());
+}
+
+void CustomWidgetsInfo::acceptCustomWidgets(DomCustomWidgets *node)
+{
+    TreeWalker::acceptCustomWidgets(node);
+}
+
+void CustomWidgetsInfo::acceptCustomWidget(DomCustomWidget *node)
+{
+    if (node->elementClass().isEmpty())
+        return;
+
+    m_customWidgets.insert(node->elementClass(), node);
+}
+
+bool CustomWidgetsInfo::extends(const QString &className, const QString &baseClassName) const
+{
+    if (className == baseClassName)
+        return true;
+
+    if (DomCustomWidget *c = customWidget(className))
+        return c->elementExtends() == baseClassName;
+
+    return false;
+}
+
+QString CustomWidgetsInfo::realClassName(const QString &className) const
+{
+    if (className == QLatin1String("Line"))
+        return QLatin1String("QFrame");
+
+    return className;
+}
+
+DomScript *CustomWidgetsInfo::customWidgetScript(const QString &name) const
+{
+    if (m_customWidgets.empty())
+        return 0;
+
+    const NameCustomWidgetMap::const_iterator it = m_customWidgets.constFind(name);
+    if (it == m_customWidgets.constEnd())
+        return 0;
+
+    return it.value()->elementScript();
+}
+
+QString CustomWidgetsInfo::customWidgetAddPageMethod(const QString &name) const
+{
+    if (DomCustomWidget *dcw = m_customWidgets.value(name, 0))
+        return dcw->elementAddPageMethod();
+    return QString();
+}
+
+
+QT_END_NAMESPACE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/duic/customwidgetsinfo.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,85 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+** exception, Nokia gives you certain additional rights. These rights
+** are described in the Nokia Qt GPL Exception version 1.3, included in
+** the file GPL_EXCEPTION.txt in this package.
+**
+** Qt for Windows(R) Licensees
+** As a special exception, Nokia, as the sole copyright holder for Qt
+** Designer, grants users of the Qt/Eclipse Integration plug-in the
+** right for the Qt/Eclipse Integration to link to functionality
+** provided by Qt Designer and its related libraries.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+****************************************************************************/
+
+#ifndef CUSTOMWIDGETSINFO_H
+#define CUSTOMWIDGETSINFO_H
+
+#include "treewalker.h"
+#include <QtCore/QStringList>
+#include <QtCore/QMap>
+
+QT_BEGIN_NAMESPACE
+
+class Driver;
+class DomScript;
+
+class CustomWidgetsInfo : public TreeWalker
+{
+public:
+    CustomWidgetsInfo();
+
+    void acceptUI(DomUI *node);
+
+    void acceptCustomWidgets(DomCustomWidgets *node);
+    void acceptCustomWidget(DomCustomWidget *node);
+
+    inline QStringList customWidgets() const
+    { return m_customWidgets.keys(); }
+
+    inline bool hasCustomWidget(const QString &name) const
+    { return m_customWidgets.contains(name); }
+
+    inline DomCustomWidget *customWidget(const QString &name) const
+    { return m_customWidgets.value(name); }
+
+    DomScript *customWidgetScript(const QString &name) const;
+
+    QString customWidgetAddPageMethod(const QString &name) const;
+
+    QString realClassName(const QString &className) const;
+
+    bool extends(const QString &className, const QString &baseClassName) const;
+
+private:
+    typedef QMap<QString, DomCustomWidget*> NameCustomWidgetMap;
+    NameCustomWidgetMap m_customWidgets;
+    bool m_scriptsActivated;
+};
+
+QT_END_NAMESPACE
+
+#endif // CUSTOMWIDGETSINFO_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/duic/d/dextractimages.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,140 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+** exception, Nokia gives you certain additional rights. These rights
+** are described in the Nokia Qt GPL Exception version 1.3, included in
+** the file GPL_EXCEPTION.txt in this package.
+**
+** Qt for Windows(R) Licensees
+** As a special exception, Nokia, as the sole copyright holder for Qt
+** Designer, grants users of the Qt/Eclipse Integration plug-in the
+** right for the Qt/Eclipse Integration to link to functionality
+** provided by Qt Designer and its related libraries.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+****************************************************************************/
+
+#include "dextractimages.h"
+#include "dwriteicondata.h"
+#include "driver.h"
+#include "ui4.h"
+#include "utils.h"
+#include "uic.h"
+
+#include <QtCore/QDataStream>
+#include <QtCore/QTextStream>
+#include <QtCore/QTextCodec>
+#include <QtCore/QDir>
+#include <QtCore/QFile>
+#include <QtCore/QFileInfo>
+
+QT_BEGIN_NAMESPACE
+
+namespace D {
+
+ExtractImages::ExtractImages(const Option &opt)
+    : m_output(0), m_option(opt)
+{
+}
+
+void ExtractImages::acceptUI(DomUI *node)
+{
+    if (!m_option.extractImages)
+        return;
+
+    if (node->elementImages() == 0)
+        return;
+
+    QString className = node->elementClass() + m_option.postfix;
+
+    QFile f;
+    if (m_option.qrcOutputFile.size()) {
+        f.setFileName(m_option.qrcOutputFile);
+        if (!f.open(QIODevice::WriteOnly | QFile::Text)) {
+            fprintf(stderr, "Could not create resource file\n");
+            return;
+        }
+
+        QFileInfo fi(m_option.qrcOutputFile);
+        QDir dir = fi.absoluteDir();
+        if (!dir.exists(QLatin1String("images")) && !dir.mkdir(QLatin1String("images"))) {
+            fprintf(stderr, "Could not create image dir\n");
+            return;
+        }
+        dir.cd(QLatin1String("images"));
+        m_imagesDir = dir;
+
+        m_output = new QTextStream(&f);
+        m_output->setCodec(QTextCodec::codecForName("UTF-8"));
+
+        QTextStream &out = *m_output;
+
+        out << "<RCC>\n";
+        out << "    <qresource prefix=\"/" << className << "\" >\n";
+        TreeWalker::acceptUI(node);
+        out << "    </qresource>\n";
+        out << "</RCC>\n";
+
+        f.close();
+        delete m_output;
+        m_output = 0;
+    }
+}
+
+void ExtractImages::acceptImages(DomImages *images)
+{
+    TreeWalker::acceptImages(images);
+}
+
+void ExtractImages::acceptImage(DomImage *image)
+{
+    QString format = image->elementData()->attributeFormat();
+    QString extension = format.left(format.indexOf(QLatin1Char('.'))).toLower();
+    QString fname = m_imagesDir.absoluteFilePath(image->attributeName() + QLatin1Char('.') + extension);
+
+    *m_output << "        <file>images/" << image->attributeName() << QLatin1Char('.') + extension << "</file>\n";
+
+    QFile f;
+    f.setFileName(fname);
+    if (!f.open(QIODevice::WriteOnly | QIODevice::Text)) {
+        fprintf(stderr, "Could not create image file\n");
+        return;
+    }
+
+    if (format == QLatin1String("XPM.GZ")) {
+        QTextStream *imageOut = new QTextStream(&f);
+        imageOut->setCodec(QTextCodec::codecForName("UTF-8"));
+
+        D::WriteIconData::writeImage(*imageOut, QString(), image);
+        delete imageOut;
+    } else {
+        D::WriteIconData::writeImage(f, image);
+    }
+
+    f.close();
+}
+
+} // namespace D
+
+QT_END_NAMESPACE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/duic/d/dextractimages.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+** exception, Nokia gives you certain additional rights. These rights
+** are described in the Nokia Qt GPL Exception version 1.3, included in
+** the file GPL_EXCEPTION.txt in this package.
+**
+** Qt for Windows(R) Licensees
+** As a special exception, Nokia, as the sole copyright holder for Qt
+** Designer, grants users of the Qt/Eclipse Integration plug-in the
+** right for the Qt/Eclipse Integration to link to functionality
+** provided by Qt Designer and its related libraries.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+****************************************************************************/
+
+#ifndef DEXTRACTIMAGES_H
+#define DEXTRACTIMAGES_H
+
+#include "treewalker.h"
+#include <QtCore/QDir>
+
+QT_BEGIN_NAMESPACE
+
+class QTextStream;
+class Driver;
+class Uic;
+
+struct Option;
+
+namespace D {
+
+class ExtractImages : public TreeWalker
+{
+public:
+    ExtractImages(const Option &opt);
+
+    void acceptUI(DomUI *node);
+    void acceptImages(DomImages *images);
+    void acceptImage(DomImage *image);
+
+private:
+    QTextStream *m_output;
+    const Option &m_option;
+    QDir m_imagesDir;
+};
+
+} // namespace D
+
+QT_END_NAMESPACE
+
+#endif // DEXTRACTIMAGES_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/duic/d/dwritedeclaration.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,266 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+** exception, Nokia gives you certain additional rights. These rights
+** are described in the Nokia Qt GPL Exception version 1.3, included in
+** the file GPL_EXCEPTION.txt in this package.
+**
+** Qt for Windows(R) Licensees
+** As a special exception, Nokia, as the sole copyright holder for Qt
+** Designer, grants users of the Qt/Eclipse Integration plug-in the
+** right for the Qt/Eclipse Integration to link to functionality
+** provided by Qt Designer and its related libraries.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+****************************************************************************/
+
+#include "dwritedeclaration.h"
+#include "dwriteicondeclaration.h"
+#include "dwriteinitialization.h"
+#include "dwriteiconinitialization.h"
+#include "dextractimages.h"
+#include "driver.h"
+#include "ui4.h"
+#include "uic.h"
+#include "databaseinfo.h"
+#include "customwidgetsinfo.h"
+
+#include <QtCore/QTextStream>
+
+QT_BEGIN_NAMESPACE
+
+namespace {
+    void openNameSpaces(const QStringList &namespaceList, QTextStream &output) {
+        if (namespaceList.empty())
+            return;
+        const QStringList::const_iterator cend = namespaceList.constEnd();
+        for (QStringList::const_iterator it = namespaceList.constBegin(); it != cend; ++it) {
+            if (!it->isEmpty()) {
+                output << "namespace " << *it << " {\n";
+            }
+        }
+    }
+
+    void closeNameSpaces(const QStringList &namespaceList, QTextStream &output) {
+        if (namespaceList.empty())
+            return;
+
+        QListIterator<QString> it(namespaceList);
+        it.toBack();
+        while (it.hasPrevious()) {
+            const QString ns = it.previous();
+            if (!ns.isEmpty()) {
+                output << "} // namespace " << ns << "\n";
+            }
+        }
+    }
+
+    void writeScriptContextClass(const QString &indent, QTextStream &str) {
+         str << indent << "class ScriptContext\n"
+             << indent << "{\n"
+             << indent << "public:\n"
+             << indent << "    void run(const QString &script, QWidget *widget, const QWidgetList &childWidgets)\n"
+             << indent << "    {\n"
+             << indent << "        QScriptValue widgetObject =  scriptEngine.newQObject(widget);\n"
+             << indent << "        QScriptValue childWidgetArray = scriptEngine.newArray (childWidgets.size());\n"
+             << indent << "        for (int i = 0; i < childWidgets.size(); i++)\n"
+             << indent << "               childWidgetArray.setProperty(i, scriptEngine.newQObject(childWidgets[i]));\n"
+             << indent << "        QScriptContext *ctx = scriptEngine.pushContext();\n"
+             << indent << "        ctx ->activationObject().setProperty(QLatin1String(\"widget\"), widgetObject);\n"
+             << indent << "        ctx ->activationObject().setProperty(QLatin1String(\"childWidgets\"), childWidgetArray);\n\n"
+             << indent << "        scriptEngine.evaluate(script);\n"
+             << indent << "        if (scriptEngine.hasUncaughtException ()) {\n"
+             << indent << "            qWarning() << \"An exception occurred at line \" << scriptEngine.uncaughtExceptionLineNumber()\n"
+             << indent << "                       << \" of the script for \" << widget->objectName() << \": \" << engineError() << '\\n'\n"
+             << indent << "                       << script;\n"
+             << indent << "        }\n\n"
+             << indent << "        scriptEngine.popContext();\n"
+             << indent << "    }\n\n"
+             << indent << "private:\n"
+             << indent << "    QString engineError()\n"
+             << indent << "    {\n"
+             << indent << "        QScriptValue error = scriptEngine.evaluate(\"Error\");\n"
+             << indent << "        return error.toString();\n"
+             << indent << "    }\n\n"
+             << indent << "    QScriptEngine scriptEngine;\n"
+             << indent << "};\n\n";
+    }
+}
+
+namespace D {
+
+WriteDeclaration::WriteDeclaration(Uic *uic, bool activateScripts)  :
+    m_uic(uic),
+    m_driver(uic->driver()),
+    m_output(uic->output()),
+    m_option(uic->option()),
+    m_activateScripts(activateScripts)
+{
+}
+
+void WriteDeclaration::acceptUI(DomUI *node)
+{
+    QString qualifiedClassName = node->elementClass() + m_option.postfix;
+    QString className = qualifiedClassName;
+
+    QString varName = m_driver->findOrInsertWidget(node->elementWidget());
+    QString widgetClassName = node->elementWidget()->attributeClass();
+
+    QString exportMacro = node->elementExportMacro();
+    if (!exportMacro.isEmpty())
+        exportMacro.append(QLatin1Char(' '));
+
+    QStringList namespaceList = qualifiedClassName.split(QLatin1String("."));
+    if (namespaceList.count()) {
+        className = namespaceList.last();
+        namespaceList.removeLast();
+    }
+
+    // This is a bit of the hack but covers the cases Qt in/without namespaces
+    // and User defined classes in/without namespaces. The "strange" case
+    // is a User using Qt-in-namespace having his own classes not in a namespace.
+    // In this case the generated Ui helper classes will also end up in
+    // the Qt namespace (which is harmless, but not "pretty")
+    const bool needsMacro = namespaceList.count() == 0
+        || namespaceList[0] == QLatin1String("qdesigner_internal");
+
+    if (needsMacro)
+        m_output << "mixin QT_BEGIN_NAMESPACE;\n\n";
+
+    openNameSpaces(namespaceList, m_output);
+
+    if (namespaceList.count())
+        m_output << "\n";
+
+    m_output << "class " << exportMacro << m_option.prefix << className << "\n"
+           << "{\n"
+           << "public:\n";
+
+    const QStringList connections = m_uic->databaseInfo()->connections();
+    for (int i=0; i<connections.size(); ++i) {
+        const QString connection = connections.at(i);
+
+        if (connection == QLatin1String("(default)"))
+            continue;
+
+        m_output << m_option.indent << "QSqlDatabase " << connection << "Connection;\n";
+    }
+
+    TreeWalker::acceptWidget(node->elementWidget());
+
+    m_output << "\n";
+
+    WriteInitialization(m_uic, m_activateScripts).acceptUI(node);
+
+    if (node->elementImages()) {
+        if (m_option.extractImages) {
+            ExtractImages(m_uic->option()).acceptUI(node);
+        } else {
+            m_output << "\n"
+                << "protected:\n"
+                << m_option.indent << "enum IconID\n"
+                << m_option.indent << "{\n";
+            WriteIconDeclaration(m_uic).acceptUI(node);
+
+            m_output << m_option.indent << m_option.indent << "unknown_ID\n"
+                << m_option.indent << "};\n";
+
+            WriteIconInitialization(m_uic).acceptUI(node);
+        }
+    }
+
+    if (m_activateScripts) {
+        m_output << "\nprivate:\n\n";
+        writeScriptContextClass(m_option.indent, m_output);
+    }
+
+    m_output << "};\n\n";
+
+    closeNameSpaces(namespaceList, m_output);
+
+    if (namespaceList.count())
+        m_output << "\n";
+
+    if (m_option.generateNamespace && !m_option.prefix.isEmpty()) {
+        namespaceList.append(QLatin1String("Ui"));
+
+        openNameSpaces(namespaceList, m_output);
+
+        m_output << m_option.indent << "class " << exportMacro << className << ": public " << m_option.prefix << className << " {};\n";
+
+        closeNameSpaces(namespaceList, m_output);
+
+        if (namespaceList.count())
+            m_output << "\n";
+    }
+
+    if (needsMacro)
+        m_output << "mixin QT_END_NAMESPACE;\n\n";
+}
+
+void WriteDeclaration::acceptWidget(DomWidget *node)
+{
+    QString className = QLatin1String("QWidget");
+    if (node->hasAttributeClass())
+        className = node->attributeClass();
+
+    m_output << m_option.indent << m_uic->customWidgetsInfo()->realClassName(className) << " *" << m_driver->findOrInsertWidget(node) << ";\n";
+
+    TreeWalker::acceptWidget(node);
+}
+
+void WriteDeclaration::acceptSpacer(DomSpacer *node)
+{
+     m_output << m_option.indent << "QSpacerItem *" << m_driver->findOrInsertSpacer(node) << ";\n";
+     TreeWalker::acceptSpacer(node);
+}
+
+void WriteDeclaration::acceptLayout(DomLayout *node)
+{
+    QString className = QLatin1String("QLayout");
+    if (node->hasAttributeClass())
+        className = node->attributeClass();
+
+    m_output << m_option.indent << className << " *" << m_driver->findOrInsertLayout(node) << ";\n";
+
+    TreeWalker::acceptLayout(node);
+}
+
+void WriteDeclaration::acceptActionGroup(DomActionGroup *node)
+{
+    m_output << m_option.indent << "QActionGroup *" << m_driver->findOrInsertActionGroup(node) << ";\n";
+
+    TreeWalker::acceptActionGroup(node);
+}
+
+void WriteDeclaration::acceptAction(DomAction *node)
+{
+    m_output << m_option.indent << "QAction *" << m_driver->findOrInsertAction(node) << ";\n";
+
+    TreeWalker::acceptAction(node);
+}
+
+} // namespace D
+
+QT_END_NAMESPACE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/duic/d/dwritedeclaration.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+** exception, Nokia gives you certain additional rights. These rights
+** are described in the Nokia Qt GPL Exception version 1.3, included in
+** the file GPL_EXCEPTION.txt in this package.
+**
+** Qt for Windows(R) Licensees
+** As a special exception, Nokia, as the sole copyright holder for Qt
+** Designer, grants users of the Qt/Eclipse Integration plug-in the
+** right for the Qt/Eclipse Integration to link to functionality
+** provided by Qt Designer and its related libraries.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+****************************************************************************/
+
+#ifndef DWRITEDECLARATION_H
+#define DWRITEDECLARATION_H
+
+#include "treewalker.h"
+
+QT_BEGIN_NAMESPACE
+
+class QTextStream;
+class Driver;
+class Uic;
+
+struct Option;
+
+namespace D {
+
+struct WriteDeclaration : public TreeWalker
+{
+    WriteDeclaration(Uic *uic, bool activateScripts);
+
+    void acceptUI(DomUI *node);
+    void acceptWidget(DomWidget *node);
+    void acceptSpacer(DomSpacer *node);
+    void acceptLayout(DomLayout *node);
+    void acceptActionGroup(DomActionGroup *node);
+    void acceptAction(DomAction *node);
+
+private:
+    Uic *m_uic;
+    Driver *m_driver;
+    QTextStream &m_output;
+    const Option &m_option;
+    const bool m_activateScripts;
+};
+
+} // namespace D
+
+QT_END_NAMESPACE
+
+#endif // DWRITEDECLARATION_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/duic/d/dwriteicondata.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,177 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+** exception, Nokia gives you certain additional rights. These rights
+** are described in the Nokia Qt GPL Exception version 1.3, included in
+** the file GPL_EXCEPTION.txt in this package.
+**
+** Qt for Windows(R) Licensees
+** As a special exception, Nokia, as the sole copyright holder for Qt
+** Designer, grants users of the Qt/Eclipse Integration plug-in the
+** right for the Qt/Eclipse Integration to link to functionality
+** provided by Qt Designer and its related libraries.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+****************************************************************************/
+
+#include "dwriteicondata.h"
+#include "driver.h"
+#include "ui4.h"
+#include "uic.h"
+
+#include <QtCore/QTextStream>
+
+QT_BEGIN_NAMESPACE
+
+namespace D {
+
+static QByteArray transformImageData(QString data)
+{
+    int baSize = data.length() / 2;
+    uchar *ba = new uchar[baSize];
+    for (int i = 0; i < baSize; ++i) {
+        char h = data[2 * (i)].toLatin1();
+        char l = data[2 * (i) + 1].toLatin1();
+        uchar r = 0;
+        if (h <= '9')
+            r += h - '0';
+        else
+            r += h - 'a' + 10;
+        r = r << 4;
+        if (l <= '9')
+            r += l - '0';
+        else
+            r += l - 'a' + 10;
+        ba[i] = r;
+    }
+    QByteArray ret(reinterpret_cast<const char *>(ba), baSize);
+    delete [] ba;
+    return ret;
+}
+
+static QByteArray unzipXPM(QString data, ulong& length)
+{
+#ifndef QT_NO_COMPRESS
+    const int lengthOffset = 4;
+    QByteArray ba(lengthOffset, ' ');
+
+    // qUncompress() expects the first 4 bytes to be the expected length of the
+    // uncompressed data
+    ba[0] = (length & 0xff000000) >> 24;
+    ba[1] = (length & 0x00ff0000) >> 16;
+    ba[2] = (length & 0x0000ff00) >> 8;
+    ba[3] = (length & 0x000000ff);
+    ba.append(transformImageData(data));
+    QByteArray baunzip = qUncompress(ba);
+    return baunzip;
+#else
+    Q_UNUSED(data);
+    Q_UNUSED(length);
+    return QByteArray();
+#endif
+}
+
+
+WriteIconData::WriteIconData(Uic *uic)
+    : driver(uic->driver()), output(uic->output()), option(uic->option())
+{
+}
+
+void WriteIconData::acceptUI(DomUI *node)
+{
+    TreeWalker::acceptUI(node);
+}
+
+void WriteIconData::acceptImages(DomImages *images)
+{
+    TreeWalker::acceptImages(images);
+}
+
+void WriteIconData::acceptImage(DomImage *image)
+{
+    writeImage(output, option.indent, image);
+}
+
+void WriteIconData::writeImage(QTextStream &output, const QString &indent, DomImage *image)
+{
+    QString img = image->attributeName() + QLatin1String("_data");
+    QString data = image->elementData()->text();
+    QString fmt = image->elementData()->attributeFormat();
+    int size = image->elementData()->attributeLength();
+
+    if (fmt == QLatin1String("XPM.GZ")) {
+        ulong length = size;
+        QByteArray baunzip = unzipXPM(data, length);
+        length = baunzip.size();
+        // shouldn't we test the initial 'length' against the
+        // resulting 'length' to catch corrupt UIC files?
+        int a = 0;
+        int column = 0;
+        bool inQuote = false;
+        output << indent << "static const char* const " << img << "[] = { \n";
+        while (baunzip[a] != '\"')
+            a++;
+        for (; a < (int) length; a++) {
+            output << baunzip[a];
+            if (baunzip[a] == '\n') {
+                column = 0;
+            } else if (baunzip[a] == '"') {
+                inQuote = !inQuote;
+            }
+
+            if (column++ >= 511 && inQuote) {
+                output << "\"\n\""; // be nice with MSVC & Co.
+                column = 1;
+            }
+        }
+
+        if (! baunzip.trimmed ().endsWith ("};"))
+            output << "};";
+
+        output << "\n\n";
+    } else {
+        output << indent << "static const unsigned char " << img << "[] = { \n";
+        output << indent;
+        int a ;
+        for (a = 0; a < (int) (data.length()/2)-1; a++) {
+            output << "0x" << QString(data[2*a]) << QString(data[2*a+1]) << ',';
+            if (a % 12 == 11)
+                output << "\n" << indent;
+            else
+                output << " ";
+        }
+        output << "0x" << QString(data[2*a]) << QString(data[2*a+1]) << '\n';
+        output << "};\n\n";
+    }
+}
+
+void WriteIconData::writeImage(QIODevice &output, DomImage *image)
+{
+    QByteArray array = transformImageData(image->elementData()->text());
+    output.write(array, array.size());
+}
+
+} // namespace D
+
+QT_END_NAMESPACE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/duic/d/dwriteicondata.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+** exception, Nokia gives you certain additional rights. These rights
+** are described in the Nokia Qt GPL Exception version 1.3, included in
+** the file GPL_EXCEPTION.txt in this package.
+**
+** Qt for Windows(R) Licensees
+** As a special exception, Nokia, as the sole copyright holder for Qt
+** Designer, grants users of the Qt/Eclipse Integration plug-in the
+** right for the Qt/Eclipse Integration to link to functionality
+** provided by Qt Designer and its related libraries.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+****************************************************************************/
+
+#ifndef DWRITEICONDATA_H
+#define DWRITEICONDATA_H
+
+#include "treewalker.h"
+
+QT_BEGIN_NAMESPACE
+
+class QTextStream;
+class QIODevice;
+class Driver;
+class Uic;
+
+struct Option;
+
+namespace D {
+
+class WriteIconData : public TreeWalker
+{
+public:
+    WriteIconData(Uic *uic);
+
+    void acceptUI(DomUI *node);
+    void acceptImages(DomImages *images);
+    void acceptImage(DomImage *image);
+
+    static void writeImage(QTextStream &output, const QString &indent, DomImage *image);
+    static void writeImage(QIODevice &output, DomImage *image);
+
+private:
+    Driver *driver;
+    QTextStream &output;
+    const Option &option;
+};
+
+} // namespace D
+
+QT_END_NAMESPACE
+
+#endif // DWRITEICONDATA_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/duic/d/dwriteicondeclaration.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+** exception, Nokia gives you certain additional rights. These rights
+** are described in the Nokia Qt GPL Exception version 1.3, included in
+** the file GPL_EXCEPTION.txt in this package.
+**
+** Qt for Windows(R) Licensees
+** As a special exception, Nokia, as the sole copyright holder for Qt
+** Designer, grants users of the Qt/Eclipse Integration plug-in the
+** right for the Qt/Eclipse Integration to link to functionality
+** provided by Qt Designer and its related libraries.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+****************************************************************************/
+
+#include "dwriteicondeclaration.h"
+#include "driver.h"
+#include "ui4.h"
+#include "uic.h"
+
+#include <QtCore/QTextStream>
+
+QT_BEGIN_NAMESPACE
+
+namespace D {
+
+WriteIconDeclaration::WriteIconDeclaration(Uic *uic)
+    : driver(uic->driver()), output(uic->output()), option(uic->option())
+{
+}
+
+void WriteIconDeclaration::acceptUI(DomUI *node)
+{
+    TreeWalker::acceptUI(node);
+}
+
+void WriteIconDeclaration::acceptImages(DomImages *images)
+{
+    TreeWalker::acceptImages(images);
+}
+
+void WriteIconDeclaration::acceptImage(DomImage *image)
+{
+    QString name = image->attributeName();
+    if (name.isEmpty())
+        return;
+
+    driver->insertPixmap(name);
+    output << option.indent << option.indent << name << "_ID,\n";
+}
+
+} // namespace D
+
+QT_END_NAMESPACE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/duic/d/dwriteicondeclaration.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+** exception, Nokia gives you certain additional rights. These rights
+** are described in the Nokia Qt GPL Exception version 1.3, included in
+** the file GPL_EXCEPTION.txt in this package.
+**
+** Qt for Windows(R) Licensees
+** As a special exception, Nokia, as the sole copyright holder for Qt
+** Designer, grants users of the Qt/Eclipse Integration plug-in the
+** right for the Qt/Eclipse Integration to link to functionality
+** provided by Qt Designer and its related libraries.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+****************************************************************************/
+
+#ifndef DWRITEICONDECLARATION_H
+#define DWRITEICONDECLARATION_H
+
+#include "treewalker.h"
+
+QT_BEGIN_NAMESPACE
+
+class QTextStream;
+class Driver;
+class Uic;
+
+struct Option;
+
+namespace D {
+
+class WriteIconDeclaration : public TreeWalker
+{
+public:
+    WriteIconDeclaration(Uic *uic);
+
+    void acceptUI(DomUI *node);
+    void acceptImages(DomImages *images);
+    void acceptImage(DomImage *image);
+
+private:
+    Uic *uic;
+    Driver *driver;
+    QTextStream &output;
+    const Option &option;
+};
+
+} // namespace D
+
+QT_END_NAMESPACE
+
+#endif // DWRITEICONDECLARATION_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/duic/d/dwriteiconinitialization.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,111 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+** exception, Nokia gives you certain additional rights. These rights
+** are described in the Nokia Qt GPL Exception version 1.3, included in
+** the file GPL_EXCEPTION.txt in this package.
+**
+** Qt for Windows(R) Licensees
+** As a special exception, Nokia, as the sole copyright holder for Qt
+** Designer, grants users of the Qt/Eclipse Integration plug-in the
+** right for the Qt/Eclipse Integration to link to functionality
+** provided by Qt Designer and its related libraries.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+****************************************************************************/
+
+#include "dwriteiconinitialization.h"
+#include "dwriteicondata.h"
+#include "driver.h"
+#include "ui4.h"
+#include "utils.h"
+#include "uic.h"
+
+#include <QtCore/QTextStream>
+#include <QtCore/QString>
+
+QT_BEGIN_NAMESPACE
+
+namespace D {
+
+WriteIconInitialization::WriteIconInitialization(Uic *uic)
+    : driver(uic->driver()), output(uic->output()), option(uic->option())
+{
+    this->uic = uic;
+}
+
+void WriteIconInitialization::acceptUI(DomUI *node)
+{
+    if (node->elementImages() == 0)
+        return;
+
+    QString className = node->elementClass() + option.postfix;
+
+    output << option.indent << "static QPixmap " << iconFromDataFunction() << "(IconID id)\n"
+           << option.indent << "{\n";
+
+    WriteIconData(uic).acceptUI(node);
+
+    output << option.indent << "switch (id) {\n";
+
+    TreeWalker::acceptUI(node);
+
+    output << option.indent << option.indent << "default: return QPixmap();\n";
+
+    output << option.indent << "} // switch\n"
+           << option.indent << "} // icon\n\n";
+}
+
+QString WriteIconInitialization::iconFromDataFunction()
+{
+    return QLatin1String("qt_get_icon");
+}
+
+void WriteIconInitialization::acceptImages(DomImages *images)
+{
+    TreeWalker::acceptImages(images);
+}
+
+void WriteIconInitialization::acceptImage(DomImage *image)
+{
+    QString img = image->attributeName() + QLatin1String("_data");
+    QString data = image->elementData()->text();
+    QString fmt = image->elementData()->attributeFormat();
+
+    QString imageId = image->attributeName() + QLatin1String("_ID");
+    QString imageData = image->attributeName() + QLatin1String("_data");
+    QString ind = option.indent + option.indent;
+
+    output << ind << "case " << imageId << ": ";
+
+    if (fmt == QLatin1String("XPM.GZ")) {
+        output << "return " << "QPixmap((const char**)" << imageData << ");\n";
+    } else {
+        output << " { QImage img; img.loadFromData(" << imageData << ", sizeof(" << imageData << "), " << fixString(fmt, ind) << "); return QPixmap::fromImage(img); }\n";
+    }
+}
+
+} // namespace D
+
+QT_END_NAMESPACE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/duic/d/dwriteiconinitialization.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+** exception, Nokia gives you certain additional rights. These rights
+** are described in the Nokia Qt GPL Exception version 1.3, included in
+** the file GPL_EXCEPTION.txt in this package.
+**
+** Qt for Windows(R) Licensees
+** As a special exception, Nokia, as the sole copyright holder for Qt
+** Designer, grants users of the Qt/Eclipse Integration plug-in the
+** right for the Qt/Eclipse Integration to link to functionality
+** provided by Qt Designer and its related libraries.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+****************************************************************************/
+
+#ifndef DWRITEICONINITIALIZATION_H
+#define DWRITEICONINITIALIZATION_H
+
+#include "treewalker.h"
+
+class QString;
+
+QT_BEGIN_NAMESPACE
+
+class QTextStream;
+class Driver;
+class Uic;
+
+struct Option;
+
+namespace D {
+
+class WriteIconInitialization : public TreeWalker
+{
+public:
+    WriteIconInitialization(Uic *uic);
+
+    void acceptUI(DomUI *node);
+    void acceptImages(DomImages *images);
+    void acceptImage(DomImage *image);
+
+    static QString iconFromDataFunction();
+
+private:
+    Uic *uic;
+    Driver *driver;
+    QTextStream &output;
+    const Option &option;
+};
+
+} // namespace D
+
+QT_END_NAMESPACE
+
+#endif // DWRITEICONINITIALIZATION_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/duic/d/dwriteincludes.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,316 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+** exception, Nokia gives you certain additional rights. These rights
+** are described in the Nokia Qt GPL Exception version 1.3, included in
+** the file GPL_EXCEPTION.txt in this package.
+**
+** Qt for Windows(R) Licensees
+** As a special exception, Nokia, as the sole copyright holder for Qt
+** Designer, grants users of the Qt/Eclipse Integration plug-in the
+** right for the Qt/Eclipse Integration to link to functionality
+** provided by Qt Designer and its related libraries.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+****************************************************************************/
+
+#include "dwriteincludes.h"
+#include "driver.h"
+#include "ui4.h"
+#include "uic.h"
+#include "databaseinfo.h"
+#include <QtCore/QDebug>
+#include <QtCore/QFileInfo>
+#include <QtCore/QTextStream>
+
+QT_BEGIN_NAMESPACE
+
+namespace {
+    enum { debugWriteIncludes = 0 };
+    enum { warnHeaderGeneration = 0 };
+}
+
+namespace D {
+
+struct ClassInfoEntry
+{
+    const char *klass;
+    const char *module;
+    const char *header;
+};
+
+static const ClassInfoEntry qclass_lib_map[] = {
+#define QT_CLASS_LIB(klass, module, header) { #klass, #module, #header },
+#include "qclass_lib_map.h"
+
+#undef QT_CLASS_LIB
+    { 0, 0, 0 }
+};
+
+WriteIncludes::WriteIncludes(Uic *uic)    :
+    m_uic(uic),
+    m_output(uic->output()),
+    m_scriptsActivated(false)
+{
+    for(const ClassInfoEntry *it = &qclass_lib_map[0]; it->klass != 0;  ++it) {
+        QString newHeader = QString("qt.%1").arg(QString(it->module).mid(2).toLower());
+        newHeader += QLatin1Char('.');
+        newHeader += QLatin1String(it->klass);
+        m_classToHeader.insert(QLatin1String(it->klass),         newHeader);
+        m_oldHeaderToNewHeader.insert(QLatin1String(it->header), newHeader);
+    }
+}
+
+void WriteIncludes::acceptUI(DomUI *node)
+{
+    m_scriptsActivated = false;
+    m_localIncludes.clear();
+    m_globalIncludes.clear();
+    m_knownClasses.clear();
+    m_includeBaseNames.clear();
+
+    if (node->elementIncludes())
+        acceptIncludes(node->elementIncludes());
+
+    if (node->elementCustomWidgets())
+        TreeWalker::acceptCustomWidgets(node->elementCustomWidgets());
+
+    add(QLatin1String("QApplication"));
+    add(QLatin1String("QVariant"));
+    add(QLatin1String("QAction"));
+
+    add(QLatin1String("QButtonGroup")); // ### only if it is really necessary
+
+    if (m_uic->hasExternalPixmap() && m_uic->pixmapFunction() == QLatin1String("qPixmapFromMimeSource")) {
+#ifdef QT_NO_QT3_SUPPORT
+        qWarning("Warning: The form file has external pixmaps or qPixmapFromMimeSource() set as a pixmap function. "
+                 "This requires Qt 3 support, which is disabled. The resulting code will not compile.");
+#endif
+        add(QLatin1String("qt.qt3support.Q3MimeSourceFactory"));
+    }
+
+    if (m_uic->databaseInfo()->connections().size()) {
+        add(QLatin1String("QSqlDatabase"));
+        add(QLatin1String("Q3SqlCursor"));
+        add(QLatin1String("QSqlRecord"));
+        add(QLatin1String("Q3SqlForm"));
+    }
+
+    TreeWalker::acceptUI(node);
+
+    QString qualifiedClassName = node->elementClass();
+    m_output << "module ui." << qualifiedClassName << "\n\n";
+
+    writeHeaders(m_globalIncludes, true);
+    writeHeaders(m_localIncludes, false);
+
+    m_output << QLatin1Char('\n');
+}
+
+void WriteIncludes::acceptWidget(DomWidget *node)
+{
+    add(QString("%1").arg(node->attributeClass()));
+    TreeWalker::acceptWidget(node);
+}
+
+void WriteIncludes::acceptLayout(DomLayout *node)
+{
+    add(QString("%1").arg(node->attributeClass()));
+    TreeWalker::acceptLayout(node);
+}
+
+void WriteIncludes::acceptSpacer(DomSpacer *node)
+{
+    add(QLatin1String("QSpacerItem"));
+    TreeWalker::acceptSpacer(node);
+}
+
+void WriteIncludes::acceptProperty(DomProperty *node)
+{
+    if (node->kind() == DomProperty::Date)
+        add(QLatin1String("QDate"));
+    if (node->kind() == DomProperty::Locale)
+        add(QLatin1String("QLocale"));
+    TreeWalker::acceptProperty(node);
+}
+
+void WriteIncludes::insertIncludeForClass(const QString &className, QString header, bool global)
+{
+    if (debugWriteIncludes)
+        qDebug() << "WriteIncludes::insertIncludeForClass" << className << header  << global;
+
+    do {
+        if (!header.isEmpty())
+            break;
+
+        // Known class
+        const StringMap::const_iterator it = m_classToHeader.constFind(className);
+        if (it != m_classToHeader.constEnd()) {
+            header = it.value();
+            global =  true;
+            break;
+        }
+
+        // Quick check by class name to detect includehints provided for custom widgets.
+        // Remove namespaces
+        QString lowerClassName = className;
+        static const QString namespaceSeparator = QLatin1String(".");
+        const int namespaceIndex = lowerClassName.lastIndexOf(namespaceSeparator);
+        if (namespaceIndex != -1)
+            lowerClassName.remove(0, namespaceIndex + namespaceSeparator.size());
+        if (m_includeBaseNames.contains(lowerClassName)) {
+            header.clear();
+            break;
+        }
+
+        // Last resort: Create default header
+        if (!m_uic->option().implicitIncludes)
+            break;
+        header = lowerClassName;
+        header += QLatin1String("");
+        if (warnHeaderGeneration) {
+            qWarning("Warning: generated header '%s' for class '%s'.", qPrintable(header),
+                     qPrintable(className));
+
+        }
+
+        global = true;
+    } while (false);
+
+    if (!header.isEmpty())
+        insertInclude(header, global);
+}
+
+void WriteIncludes::add(const QString &className, bool determineHeader, const QString &header, bool global)
+{
+    if (debugWriteIncludes)
+        qDebug() << "WriteIncludes::add" << className << header  << global;
+
+    if (className.isEmpty() || m_knownClasses.contains(className))
+        return;
+
+    m_knownClasses.insert(className);
+
+    if (className == QLatin1String("Line")) { // ### hmm, deprecate me!
+        add(QLatin1String("qt.gui.QFrame"));
+        return;
+    }
+
+    if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("Q3ListView"))  ||
+        m_uic->customWidgetsInfo()->extends(className, QLatin1String("Q3Table"))) {
+        add(QLatin1String("qt.qt3support.Q3Header"));
+    }
+    if (determineHeader)
+        insertIncludeForClass(className, header, global);
+}
+
+void WriteIncludes::acceptCustomWidget(DomCustomWidget *node)
+{
+    const QString className = node->elementClass();
+    if (className.isEmpty())
+        return;
+
+    if (const DomScript *domScript = node->elementScript())
+        if (!domScript->text().isEmpty())
+            activateScripts();
+
+    if (!node->elementHeader() || node->elementHeader()->text().isEmpty()) {
+        add(className, false); // no header specified
+    } else {
+        // custom header unless it is a built-in qt class
+        QString header;
+        bool global = false;
+        if (!m_classToHeader.contains(className)) {
+            global = node->elementHeader()->attributeLocation().toLower() == QLatin1String("global");
+            header = node->elementHeader()->text();
+        }
+        add(className, true, header, global);
+    }
+}
+
+void WriteIncludes::acceptCustomWidgets(DomCustomWidgets *node)
+{
+    Q_UNUSED(node);
+}
+
+void WriteIncludes::acceptIncludes(DomIncludes *node)
+{
+    TreeWalker::acceptIncludes(node);
+}
+
+void WriteIncludes::acceptInclude(DomInclude *node)
+{
+    bool global = true;
+    if (node->hasAttributeLocation())
+        global = node->attributeLocation() == QLatin1String("global");
+    insertInclude(node->text(), global);
+}
+void WriteIncludes::insertInclude(const QString &header, bool global)
+{
+    if (debugWriteIncludes)
+        qDebug() << "WriteIncludes::insertInclude" <<  header  << global;
+
+    OrderedSet &includes = global ?  m_globalIncludes : m_localIncludes;
+    if (includes.contains(header))
+        return;
+    // Insert. Also remember base name for quick check of suspicious custom plugins
+    includes.insert(header, false);
+    const QString lowerBaseName = QFileInfo(header).completeBaseName ().toLower();
+    m_includeBaseNames.insert(lowerBaseName);
+}
+
+void WriteIncludes::writeHeaders(const OrderedSet &headers, bool global)
+{
+    const QChar openingQuote = global ? QLatin1Char('<') : QLatin1Char('"');
+    const QChar closingQuote = global ? QLatin1Char('>') : QLatin1Char('"');
+
+    const OrderedSet::const_iterator cend = headers.constEnd();
+    for ( OrderedSet::const_iterator sit = headers.constBegin(); sit != cend; ++sit) {
+        const StringMap::const_iterator hit = m_oldHeaderToNewHeader.constFind(sit.key());
+        const bool mapped =  hit != m_oldHeaderToNewHeader.constEnd();
+        const  QString header =  mapped ? hit.value() : sit.key();
+        if (!header.trimmed().isEmpty()) {
+            m_output << "import " << header << QLatin1Char(';') << QLatin1Char('\n');
+        }
+    }
+}
+
+void WriteIncludes::acceptWidgetScripts(const DomScripts &scripts, DomWidget *, const  DomWidgets &)
+{
+    if (!scripts.empty()) {
+        activateScripts();
+    }
+}
+
+void WriteIncludes::activateScripts()
+{
+    if (!m_scriptsActivated) {
+        add(QLatin1String("qt.script.QScriptEngine"));
+        add(QLatin1String("qt.core.QDebug"));
+        m_scriptsActivated = true;
+    }
+}
+} // namespace D
+
+QT_END_NAMESPACE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/duic/d/dwriteincludes.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,111 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+** exception, Nokia gives you certain additional rights. These rights
+** are described in the Nokia Qt GPL Exception version 1.3, included in
+** the file GPL_EXCEPTION.txt in this package.
+**
+** Qt for Windows(R) Licensees
+** As a special exception, Nokia, as the sole copyright holder for Qt
+** Designer, grants users of the Qt/Eclipse Integration plug-in the
+** right for the Qt/Eclipse Integration to link to functionality
+** provided by Qt Designer and its related libraries.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+****************************************************************************/
+
+#ifndef DWRITEINCLUDES_H
+#define DWRITEINCLUDES_H
+
+#include "treewalker.h"
+
+#include <QtCore/QHash>
+#include <QtCore/QMap>
+#include <QtCore/QSet>
+#include <QtCore/QString>
+
+QT_BEGIN_NAMESPACE
+
+class QTextStream;
+class Driver;
+class Uic;
+
+namespace D {
+
+struct WriteIncludes : public TreeWalker
+{
+    WriteIncludes(Uic *uic);
+
+    void acceptUI(DomUI *node);
+    void acceptWidget(DomWidget *node);
+    void acceptLayout(DomLayout *node);
+    void acceptSpacer(DomSpacer *node);
+    void acceptProperty(DomProperty *node);
+    void acceptWidgetScripts(const DomScripts &, DomWidget *, const DomWidgets &);
+
+//
+// custom widgets
+//
+    void acceptCustomWidgets(DomCustomWidgets *node);
+    void acceptCustomWidget(DomCustomWidget *node);
+
+//
+// include hints
+//
+    void acceptIncludes(DomIncludes *node);
+    void acceptInclude(DomInclude *node);
+
+    bool scriptsActivated() const { return m_scriptsActivated; }
+
+private:
+    void add(const QString &className, bool determineHeader = true, const QString &header = QString(), bool global = false);
+
+private:
+    typedef QMap<QString, bool> OrderedSet;
+    void insertIncludeForClass(const QString &className, QString header = QString(), bool global = false);
+    void insertInclude(const QString &header, bool global);
+    void writeHeaders(const OrderedSet &headers, bool global);
+    QString headerForClassName(const QString &className) const;
+    void activateScripts();
+
+    const Uic *m_uic;
+    QTextStream &m_output;
+
+    OrderedSet m_localIncludes;
+    OrderedSet m_globalIncludes;
+    QSet<QString> m_includeBaseNames;
+
+    QSet<QString> m_knownClasses;
+
+    typedef QHash<QString, QString> StringMap;
+    StringMap m_classToHeader;
+    StringMap m_oldHeaderToNewHeader;
+    bool m_scriptsActivated;
+};
+
+} // namespace D
+
+QT_END_NAMESPACE
+
+#endif // DWRITEINCLUDES_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/duic/d/dwriteinitialization.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,2496 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+** exception, Nokia gives you certain additional rights. These rights
+** are described in the Nokia Qt GPL Exception version 1.3, included in
+** the file GPL_EXCEPTION.txt in this package.
+**
+** Qt for Windows(R) Licensees
+** As a special exception, Nokia, as the sole copyright holder for Qt
+** Designer, grants users of the Qt/Eclipse Integration plug-in the
+** right for the Qt/Eclipse Integration to link to functionality
+** provided by Qt Designer and its related libraries.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+****************************************************************************/
+
+#include "dwriteinitialization.h"
+#include "dwriteiconinitialization.h"
+#include "driver.h"
+#include "ui4.h"
+#include "utils.h"
+#include "uic.h"
+#include "databaseinfo.h"
+#include "globaldefs.h"
+
+#include <QtCore/QTextStream>
+#include <QtCore/QDebug>
+
+QT_BEGIN_NAMESPACE
+
+namespace {
+    // Fixup an enumeration name from class Qt.
+    // They are currently stored as "BottomToolBarArea" instead of "Qt::BottomToolBarArea".
+    // due to MO issues. This might be fixed in the future.
+    void fixQtEnumerationName(QString& name) {
+        static const QLatin1String prefix("qt.core.Qt.");
+        if (name.indexOf(prefix) != 0)
+            name.prepend(prefix);
+    }
+    // figure out the toolbar area of a DOM attrib list.
+    // By legacy, it is stored as an integer. As of 4.3.0, it is the enumeration value.
+    QString toolBarAreaStringFromDOMAttributes(const D::WriteInitialization::DomPropertyMap &attributes) {
+        const DomProperty *pstyle = attributes.value(QLatin1String("toolBarArea"));
+        if (!pstyle)
+            return QString();
+
+        switch (pstyle->kind()) {
+        case DomProperty::Number: {
+            QString area = QLatin1String("(cast(qt.core.Qt.ToolBarArea)(");
+            area += QString::number(pstyle->elementNumber());
+            area += QLatin1String(")), ");
+            return area;
+        }
+        case DomProperty::Enum: {
+            QString area = pstyle->elementEnum();
+            fixQtEnumerationName(area);
+            area += QLatin1String(", ");
+            return area;
+        }
+        default:
+            break;
+        }
+        return QString();
+    }
+
+    // Write a statement to create a spacer item.
+    void writeSpacerItem(const DomSpacer *node, QTextStream &output) {
+        const QHash<QString, DomProperty *> properties = propertyMap(node->elementProperty());
+                output << "new QSpacerItem(";
+
+        if (properties.contains(QLatin1String("sizeHint"))) {
+            const DomSize *sizeHint = properties.value(QLatin1String("sizeHint"))->elementSize();
+            output << sizeHint->elementWidth() << ", " << sizeHint->elementHeight() << ", ";
+        }
+
+        // size type
+        QString sizeType = properties.contains(QLatin1String("sizeType"))  ?
+                           properties.value(QLatin1String("sizeType"))->elementEnum() :
+                           QString::fromLatin1("Expanding");
+
+        if (!sizeType.startsWith(QLatin1String("qt.core.QSizePolicy.")))
+            sizeType.prepend(QLatin1String("qt.core.QSizePolicy."));
+        // orientation
+        bool isVspacer = false;
+        if (properties.contains(QLatin1String("orientation"))) {
+            const QString orientation = properties.value(QLatin1String("orientation"))->elementEnum();
+            if (orientation == QLatin1String("qt.core.Qt.Vertical") || orientation == QLatin1String("Vertical"))  isVspacer = true;
+        }
+
+        if (isVspacer)
+            output << "qt.core.QSizePolicy.Minimum, " << sizeType << ')';
+        else
+            output << sizeType << ", qt.core.QSizePolicy.Minimum)";
+    }
+
+
+    // Helper for implementing comparison functions for integers.
+    int compareInt(int i1, int i2) {
+        if (i1 < i2) return -1;
+        if (i1 > i2) return  1;
+        return  0;
+    }
+
+    // Write object->setFoo(x);
+    template <class Value>
+        void writeSetter(const QString &indent, const QString &varName,const QString &setter, Value v, QTextStream &str) {
+            str << indent << varName << "." << setter << '(' << v << ");\n";
+        }
+
+    void writeSetupUIScriptVariableDeclarations(const QString &indent, QTextStream &str)  {
+        str << indent << "ScriptContext scriptContext;\n"
+            << indent << "QWidgetList childWidgets;\n";
+    }
+
+    static inline bool isIconFormat44(const DomResourceIcon *i) {
+        return i->hasElementNormalOff()   || i->hasElementNormalOn() ||
+               i->hasElementDisabledOff() || i->hasElementDisabledOn() ||
+               i->hasElementActiveOff()   || i->hasElementActiveOn() ||
+               i->hasElementSelectedOff() || i->hasElementSelectedOn();
+    }
+
+    // Check on properties. Filter out empty legacy pixmap/icon properties
+    // as Designer pre 4.4 used to remove missing resource references.
+    // This can no longer be handled by the code as we have 'setIcon(QIcon())' as well as 'QIcon icon'
+    static bool checkProperty(const QString &fileName, const DomProperty *p) {
+        switch (p->kind()) {
+        case DomProperty::IconSet:
+            if (const DomResourceIcon *dri = p->elementIconSet()) {
+                if (!isIconFormat44(dri)) {
+                    if (dri->text().isEmpty())  {
+                        const QString msg = QString::fromUtf8("%1: An invalid icon property '%2' was encountered.").arg(fileName).arg(p->attributeName());
+                        qWarning("%s", qPrintable(msg));
+                        return false;
+                    }
+                }
+            }
+            break;
+        case DomProperty::Pixmap:
+            if (const DomResourcePixmap *drp = p->elementPixmap())
+                if (drp->text().isEmpty()) {
+                    const QString msg = QString::fromUtf8("%1: An invalid pixmap property '%2' was encountered.").arg(fileName).arg(p->attributeName());
+                    qWarning("%s", qPrintable(msg));
+                    return false;
+                }
+            break;
+        default:
+            break;
+        }
+        return  true;
+    }
+
+    inline void openIfndef(QTextStream &str, const QString &symbol)  { str << endl << QLatin1String("#ifndef ") << symbol << endl;  }
+    inline void closeIfdef(QTextStream &str, const QString &symbol) { str << QLatin1String("#endif // ") << symbol << endl << endl; }
+
+    const char *accessibilityDefineC = "QT_NO_ACCESSIBILITY";
+    const char *toolTipDefineC = "QT_NO_TOOLTIP";
+    const char *whatsThisDefineC = "QT_NO_WHATSTHIS";
+    const char *statusTipDefineC = "QT_NO_STATUSTIP";
+    const char *shortcutDefineC = "QT_NO_SHORTCUT";
+}
+
+namespace D {
+
+FontHandle::FontHandle(const DomFont *domFont) :
+      m_domFont(domFont)
+{
+}
+
+int FontHandle::compare(const FontHandle &rhs) const
+{
+    const QString family    = m_domFont->hasElementFamily()     ?     m_domFont->elementFamily() : QString();
+    const QString rhsFamily = rhs.m_domFont->hasElementFamily() ? rhs.m_domFont->elementFamily() : QString();
+
+    if (const int frc = family.compare(rhsFamily))
+        return frc;
+
+    const int pointSize    = m_domFont->hasElementPointSize()     ?     m_domFont->elementPointSize() : -1;
+    const int rhsPointSize = rhs.m_domFont->hasElementPointSize() ? rhs.m_domFont->elementPointSize() : -1;
+
+    if (const int crc = compareInt(pointSize, rhsPointSize))
+        return crc;
+
+    const int bold    = m_domFont->hasElementBold()     ? (m_domFont->elementBold()     ? 1 : 0) : -1;
+    const int rhsBold = rhs.m_domFont->hasElementBold() ? (rhs.m_domFont->elementBold() ? 1 : 0) : -1;
+    if (const int crc = compareInt(bold, rhsBold))
+        return crc;
+
+    const int italic    = m_domFont->hasElementItalic()     ? (m_domFont->elementItalic()     ? 1 : 0) : -1;
+    const int rhsItalic = rhs.m_domFont->hasElementItalic() ? (rhs.m_domFont->elementItalic() ? 1 : 0) : -1;
+    if (const int crc = compareInt(italic, rhsItalic))
+        return crc;
+
+    const int underline    = m_domFont->hasElementUnderline()     ? (m_domFont->elementUnderline()     ? 1 : 0) : -1;
+    const int rhsUnderline = rhs.m_domFont->hasElementUnderline() ? (rhs.m_domFont->elementUnderline() ? 1 : 0) : -1;
+    if (const int crc = compareInt(underline, rhsUnderline))
+        return crc;
+
+    const int weight    = m_domFont->hasElementWeight()     ?     m_domFont->elementWeight() : -1;
+    const int rhsWeight = rhs.m_domFont->hasElementWeight() ? rhs.m_domFont->elementWeight() : -1;
+    if (const int crc = compareInt(weight, rhsWeight))
+        return crc;
+
+    const int strikeOut    = m_domFont->hasElementStrikeOut()     ? (m_domFont->elementStrikeOut()     ? 1 : 0) : -1;
+    const int rhsStrikeOut = rhs.m_domFont->hasElementStrikeOut() ? (rhs.m_domFont->elementStrikeOut() ? 1 : 0) : -1;
+    if (const int crc = compareInt(strikeOut, rhsStrikeOut))
+        return crc;
+
+    const int kerning    = m_domFont->hasElementKerning()     ? (m_domFont->elementKerning()     ? 1 : 0) : -1;
+    const int rhsKerning = rhs.m_domFont->hasElementKerning() ? (rhs.m_domFont->elementKerning() ? 1 : 0) : -1;
+    if (const int crc = compareInt(kerning, rhsKerning))
+        return crc;
+
+    const int antialiasing    = m_domFont->hasElementAntialiasing()     ? (m_domFont->elementAntialiasing()     ? 1 : 0) : -1;
+    const int rhsAntialiasing = rhs.m_domFont->hasElementAntialiasing() ? (rhs.m_domFont->elementAntialiasing() ? 1 : 0) : -1;
+    if (const int crc = compareInt(antialiasing, rhsAntialiasing))
+        return crc;
+
+    const QString styleStrategy    = m_domFont->hasElementStyleStrategy()     ?     m_domFont->elementStyleStrategy() : QString();
+    const QString rhsStyleStrategy = rhs.m_domFont->hasElementStyleStrategy() ? rhs.m_domFont->elementStyleStrategy() : QString();
+
+    if (const int src = styleStrategy.compare(rhsStyleStrategy))
+        return src;
+
+    return 0;
+}
+
+IconHandle::IconHandle(const DomResourceIcon *domIcon) :
+      m_domIcon(domIcon)
+{
+}
+
+int IconHandle::compare(const IconHandle &rhs) const
+{
+    const QString normalOff    =     m_domIcon->hasElementNormalOff() ?     m_domIcon->elementNormalOff()->text() : QString();
+    const QString rhsNormalOff = rhs.m_domIcon->hasElementNormalOff() ? rhs.m_domIcon->elementNormalOff()->text() : QString();
+    if (const int comp = normalOff.compare(rhsNormalOff))
+        return comp;
+
+    const QString normalOn    =     m_domIcon->hasElementNormalOn() ?     m_domIcon->elementNormalOn()->text() : QString();
+    const QString rhsNormalOn = rhs.m_domIcon->hasElementNormalOn() ? rhs.m_domIcon->elementNormalOn()->text() : QString();
+    if (const int comp = normalOn.compare(rhsNormalOn))
+        return comp;
+
+    const QString disabledOff    =     m_domIcon->hasElementDisabledOff() ?     m_domIcon->elementDisabledOff()->text() : QString();
+    const QString rhsDisabledOff = rhs.m_domIcon->hasElementDisabledOff() ? rhs.m_domIcon->elementDisabledOff()->text() : QString();
+    if (const int comp = disabledOff.compare(rhsDisabledOff))
+        return comp;
+
+    const QString disabledOn    =     m_domIcon->hasElementDisabledOn() ?     m_domIcon->elementDisabledOn()->text() : QString();
+    const QString rhsDisabledOn = rhs.m_domIcon->hasElementDisabledOn() ? rhs.m_domIcon->elementDisabledOn()->text() : QString();
+    if (const int comp = disabledOn.compare(rhsDisabledOn))
+        return comp;
+
+    const QString activeOff    =     m_domIcon->hasElementActiveOff() ?     m_domIcon->elementActiveOff()->text() : QString();
+    const QString rhsActiveOff = rhs.m_domIcon->hasElementActiveOff() ? rhs.m_domIcon->elementActiveOff()->text() : QString();
+    if (const int comp = activeOff.compare(rhsActiveOff))
+        return comp;
+
+    const QString activeOn    =     m_domIcon->hasElementActiveOn() ?     m_domIcon->elementActiveOn()->text() : QString();
+    const QString rhsActiveOn = rhs.m_domIcon->hasElementActiveOn() ? rhs.m_domIcon->elementActiveOn()->text() : QString();
+    if (const int comp = activeOn.compare(rhsActiveOn))
+        return comp;
+
+    const QString selectedOff    =     m_domIcon->hasElementSelectedOff() ?     m_domIcon->elementSelectedOff()->text() : QString();
+    const QString rhsSelectedOff = rhs.m_domIcon->hasElementSelectedOff() ? rhs.m_domIcon->elementSelectedOff()->text() : QString();
+    if (const int comp = selectedOff.compare(rhsSelectedOff))
+        return comp;
+
+    const QString selectedOn    =     m_domIcon->hasElementSelectedOn() ?     m_domIcon->elementSelectedOn()->text() : QString();
+    const QString rhsSelectedOn = rhs.m_domIcon->hasElementSelectedOn() ? rhs.m_domIcon->elementSelectedOn()->text() : QString();
+    if (const int comp = selectedOn.compare(rhsSelectedOn))
+        return comp;
+    // Pre 4.4 Legacy
+    if (const int comp = m_domIcon->text().compare(rhs.m_domIcon->text()))
+        return comp;
+
+    return 0;
+}
+
+
+#if defined(Q_OS_MAC) && defined(Q_CC_GNU) && (__GNUC__ == 3 && __GNUC_MINOR__ == 3)
+inline uint qHash(const SizePolicyHandle &handle) { return qHash(handle.m_domSizePolicy); }
+inline uint qHash(const FontHandle &handle) { return qHash(handle.m_domFont); }
+inline uint qHash(const IconHandle &handle) { return qHash(handle.m_domIcon); }
+#endif
+
+SizePolicyHandle::SizePolicyHandle(const DomSizePolicy *domSizePolicy) :
+    m_domSizePolicy(domSizePolicy)
+{
+}
+
+int SizePolicyHandle::compare(const SizePolicyHandle &rhs) const
+{
+
+    const int hSizeType    = m_domSizePolicy->hasElementHSizeType()     ? m_domSizePolicy->elementHSizeType()     : -1;
+    const int rhsHSizeType = rhs.m_domSizePolicy->hasElementHSizeType() ? rhs.m_domSizePolicy->elementHSizeType() : -1;
+    if (const int crc = compareInt(hSizeType, rhsHSizeType))
+        return crc;
+
+    const int vSizeType    = m_domSizePolicy->hasElementVSizeType()     ? m_domSizePolicy->elementVSizeType()     : -1;
+    const int rhsVSizeType = rhs.m_domSizePolicy->hasElementVSizeType() ? rhs.m_domSizePolicy->elementVSizeType() : -1;
+    if (const int crc = compareInt(vSizeType, rhsVSizeType))
+        return crc;
+
+    const int hStretch    =  m_domSizePolicy->hasElementHorStretch()     ? m_domSizePolicy->elementHorStretch()     : -1;
+    const int rhsHStretch =  rhs.m_domSizePolicy->hasElementHorStretch() ? rhs.m_domSizePolicy->elementHorStretch() : -1;
+    if (const int crc = compareInt(hStretch, rhsHStretch))
+        return crc;
+
+    const int vStretch    =  m_domSizePolicy->hasElementVerStretch()     ? m_domSizePolicy->elementVerStretch()     : -1;
+    const int rhsVStretch =  rhs.m_domSizePolicy->hasElementVerStretch() ? rhs.m_domSizePolicy->elementVerStretch() : -1;
+    if (const int crc = compareInt(vStretch, rhsVStretch))
+        return crc;
+
+    const QString attributeHSizeType    = m_domSizePolicy->hasAttributeHSizeType()     ? m_domSizePolicy->attributeHSizeType()     : QString();
+    const QString rhsAttributeHSizeType = rhs.m_domSizePolicy->hasAttributeHSizeType() ? rhs.m_domSizePolicy->attributeHSizeType() : QString();
+
+    if (const int hrc = attributeHSizeType.compare(rhsAttributeHSizeType))
+        return hrc;
+
+    const QString attributeVSizeType    = m_domSizePolicy->hasAttributeVSizeType()     ? m_domSizePolicy->attributeVSizeType()     : QString();
+    const QString rhsAttributeVSizeType = rhs.m_domSizePolicy->hasAttributeVSizeType() ? rhs.m_domSizePolicy->attributeVSizeType() : QString();
+
+    return attributeVSizeType.compare(rhsAttributeVSizeType);
+}
+
+// ---  WriteInitialization: LayoutDefaultHandler
+
+WriteInitialization::LayoutDefaultHandler::LayoutDefaultHandler()
+{
+    qFill(m_state, m_state + NumProperties, 0u);
+    qFill(m_defaultValues, m_defaultValues + NumProperties, 0);
+}
+
+
+
+void WriteInitialization::LayoutDefaultHandler::acceptLayoutDefault(DomLayoutDefault *node)
+{
+    if (!node)
+        return;
+    if (node->hasAttributeMargin()) {
+        m_state[Margin] |= HasDefaultValue;
+        m_defaultValues[Margin] = node->attributeMargin();
+    }
+    if (node->hasAttributeSpacing()) {
+        m_state[Spacing] |= HasDefaultValue;
+        m_defaultValues[Spacing]  = node->attributeSpacing();
+    }
+}
+
+void WriteInitialization::LayoutDefaultHandler::acceptLayoutFunction(DomLayoutFunction *node)
+{
+    if (!node)
+        return;
+    if (node->hasAttributeMargin()) {
+        m_state[Margin]     |= HasDefaultFunction;
+        m_functions[Margin] =  node->attributeMargin();
+        m_functions[Margin] += QLatin1String("()");
+    }
+    if (node->hasAttributeSpacing()) {
+        m_state[Spacing]     |= HasDefaultFunction;
+        m_functions[Spacing] =  node->attributeSpacing();
+        m_functions[Spacing] += QLatin1String("()");
+    }
+}
+
+void WriteInitialization::LayoutDefaultHandler::writeProperty(int p, const QString &indent, const QString &objectName,
+                                                              const DomPropertyMap &properties, const QString &propertyName, const QString &setter,
+                                                              int defaultStyleValue, bool suppressDefault, QTextStream &str) const
+{
+    // User value
+    const DomPropertyMap::const_iterator mit = properties.constFind(propertyName);
+    const bool found = mit != properties.constEnd();
+    if (found) {
+        const int value = mit.value()->elementNumber();
+        // Emulate the pre 4.3 behaviour: The value form default value was only used to determine
+        // the default value, layout properties were always written
+        const bool useLayoutFunctionPre43 = !suppressDefault && (m_state[p] == (HasDefaultFunction|HasDefaultValue)) && value == m_defaultValues[p];
+        if (!useLayoutFunctionPre43) {
+            bool ifndefMac = (!(m_state[p] & (HasDefaultFunction|HasDefaultValue))
+                             && value == defaultStyleValue);
+            if (ifndefMac)
+                str << "#ifndef Q_OS_MAC\n";
+            writeSetter(indent, objectName, setter, value, str);
+            if (ifndefMac)
+                str << "#endif\n";
+            return;
+        }
+    }
+    if (suppressDefault)
+        return;
+    // get default
+    if (m_state[p] & HasDefaultFunction) {
+        writeSetter(indent, objectName, setter, m_functions[p], str);
+        return;
+    }
+    if (m_state[p] & HasDefaultValue) {
+        writeSetter(indent, objectName, setter, m_defaultValues[p], str);
+    }
+    return;
+}
+
+
+void WriteInitialization::LayoutDefaultHandler::writeProperties(const QString &indent, const QString &varName,
+                                                                const DomPropertyMap &properties, int marginType,
+                                                                bool suppressMarginDefault,
+                                                                QTextStream &str) const {
+    // Write out properties and ignore the ones found in
+    // subsequent writing of the property list.
+    int defaultSpacing = marginType == WriteInitialization::Use43UiFile ? -1 : 6;
+    writeProperty(Spacing, indent, varName, properties, QLatin1String("spacing"), QLatin1String("setSpacing"),
+                  defaultSpacing, false, str);
+    // We use 9 as TopLevelMargin, since Designer seem to always use 9.
+    static const int layoutmargins[4] = {-1, 9, 9, 0};
+    writeProperty(Margin,  indent, varName, properties, QLatin1String("margin"),  QLatin1String("setMargin"),
+                  layoutmargins[marginType], suppressMarginDefault, str);
+}
+
+// ---  WriteInitialization
+WriteInitialization::WriteInitialization(Uic *uic, bool activateScripts) :
+      m_uic(uic),
+      m_driver(uic->driver()), m_output(uic->output()), m_option(uic->option()),
+      m_layoutMarginType(TopLevelMargin),
+      m_delayedOut(&m_delayedInitialization, QIODevice::WriteOnly),
+      m_refreshOut(&m_refreshInitialization, QIODevice::WriteOnly),
+      m_actionOut(&m_delayedActionInitialization, QIODevice::WriteOnly),
+      m_activateScripts(activateScripts), m_layoutWidget(false)
+{
+}
+
+void WriteInitialization::acceptUI(DomUI *node)
+{
+    m_registeredImages.clear();
+    m_actionGroupChain.push(0);
+    m_widgetChain.push(0);
+    m_layoutChain.push(0);
+
+    acceptLayoutDefault(node->elementLayoutDefault());
+    acceptLayoutFunction(node->elementLayoutFunction());
+
+    if (node->elementCustomWidgets())
+        TreeWalker::acceptCustomWidgets(node->elementCustomWidgets());
+
+    if (node->elementImages())
+        TreeWalker::acceptImages(node->elementImages());
+
+    if (m_option.generateImplemetation)
+        m_output << "#include <" << m_driver->headerFileName() << ">\n\n";
+
+    m_stdsetdef = true;
+    if (node->hasAttributeStdSetDef())
+        m_stdsetdef = node->attributeStdSetDef();
+
+    const QString className = node->elementClass() + m_option.postfix;
+    m_generatedClass = className;
+
+    const QString varName = m_driver->findOrInsertWidget(node->elementWidget());
+    m_registeredWidgets.insert(varName, node->elementWidget()); // register the main widget
+
+    const QString widgetClassName = node->elementWidget()->attributeClass();
+
+    m_output << m_option.indent << "void " << "setupUi(" << widgetClassName << " *" << varName << ")\n"
+           << m_option.indent << "{\n";
+
+    if (m_activateScripts)
+        writeSetupUIScriptVariableDeclarations( m_option.indent, m_output);
+
+    const QStringList connections = m_uic->databaseInfo()->connections();
+    for (int i=0; i<connections.size(); ++i) {
+        QString connection = connections.at(i);
+
+        if (connection == QLatin1String("(default)"))
+            continue;
+
+        const QString varConn = connection + QLatin1String("Connection");
+        m_output << m_option.indent << varConn << " = QSqlDatabase::database(" << fixString(connection, m_option.indent) << ");\n";
+    }
+
+    acceptWidget(node->elementWidget());
+
+    if (m_buddies.size() > 0)
+        openIfndef(m_output, QLatin1String(shortcutDefineC));
+    for (int i=0; i<m_buddies.size(); ++i) {
+        const Buddy &b = m_buddies.at(i);
+
+        if (!m_registeredWidgets.contains(b.objName)) {
+            fprintf(stderr, "'%s' isn't a valid widget\n", b.objName.toLatin1().data());
+            continue;
+        } else if (!m_registeredWidgets.contains(b.buddy)) {
+            fprintf(stderr, "'%s' isn't a valid widget\n", b.buddy.toLatin1().data());
+            continue;
+        }
+
+        m_output << m_option.indent << b.objName << ".setBuddy(" << b.buddy << ");\n";
+    }
+    if (m_buddies.size() > 0)
+        closeIfdef(m_output, QLatin1String(shortcutDefineC));
+
+    if (node->elementTabStops())
+        acceptTabStops(node->elementTabStops());
+
+    if (m_delayedActionInitialization.size())
+        m_output << "\n" << m_delayedActionInitialization;
+
+    m_output << "\n" << m_option.indent << "retranslateUi(" << varName << ");\n";
+
+    if (node->elementConnections())
+        acceptConnections(node->elementConnections());
+
+    if (!m_delayedInitialization.isEmpty())
+        m_output << "\n" << m_delayedInitialization << "\n";
+
+    if (m_option.autoConnection)
+        m_output << "\n" << m_option.indent << "QMetaObject.connectSlotsByName(" << varName << ");\n";
+
+    m_output << m_option.indent << "} // setupUi\n\n";
+
+    if (m_delayedActionInitialization.isEmpty()) {
+        m_refreshInitialization += m_option.indent;
+        m_refreshInitialization += QLatin1String("Q_UNUSED(");
+        m_refreshInitialization += varName ;
+        m_refreshInitialization +=QLatin1String(");\n");
+    }
+
+    m_output << m_option.indent << "void " << "retranslateUi(" << widgetClassName << " *" << varName << ")\n"
+           << m_option.indent << "{\n"
+           << m_refreshInitialization
+           << m_option.indent << "} // retranslateUi\n\n";
+
+    m_layoutChain.pop();
+    m_widgetChain.pop();
+    m_actionGroupChain.pop();
+}
+
+void WriteInitialization::acceptWidget(DomWidget *node)
+{
+    m_layoutMarginType = m_widgetChain.count() == 1 ? TopLevelMargin : ChildMargin;
+    const QString className = node->attributeClass();
+    const QString varName = m_driver->findOrInsertWidget(node);
+    m_registeredWidgets.insert(varName, node); // register the current widget
+
+    QString parentWidget, parentClass;
+    if (m_widgetChain.top()) {
+        parentWidget = m_driver->findOrInsertWidget(m_widgetChain.top());
+        parentClass = m_widgetChain.top()->attributeClass();
+    }
+
+    const QString savedParentWidget = parentWidget;
+
+    if (m_uic->isContainer(parentClass) || m_uic->customWidgetsInfo()->extends(parentClass, QLatin1String("Q3ToolBar")))
+        parentWidget.clear();
+
+    if (m_widgetChain.size() != 1)
+        m_output << m_option.indent << varName << " = new " << m_uic->customWidgetsInfo()->realClassName(className) << '(' << parentWidget << ");\n";
+
+    parentWidget = savedParentWidget;
+
+    if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("QComboBox"))) {
+        initializeComboBox(node);
+    } else if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("QListWidget"))) {
+        initializeListWidget(node);
+    } else if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("QTreeWidget"))) {
+        initializeTreeWidget(node);
+    } else if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("QTableWidget"))) {
+        initializeTableWidget(node);
+    } else if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("Q3ListBox"))) {
+        initializeQ3ListBox(node);
+    } else if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("Q3ListView"))) {
+        initializeQ3ListView(node);
+    } else if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("Q3IconView"))) {
+        initializeQ3IconView(node);
+    } else if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("Q3Table"))) {
+        initializeQ3Table(node);
+    } else if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("Q3DataTable"))) {
+        initializeQ3SqlDataTable(node);
+    } else if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("Q3DataBrowser"))) {
+        initializeQ3SqlDataBrowser(node);
+    }
+
+    if (m_uic->isButton(className)) {
+        const DomPropertyMap attributes = propertyMap(node->elementAttribute());
+        if (const DomProperty *prop = attributes.value(QLatin1String("buttonGroup"))) {
+            const QString groupName = toString(prop->elementString());
+            if (!m_buttonGroups.contains(groupName)) {
+                m_buttonGroups.insert(groupName, m_driver->findOrInsertName(groupName));
+                const QString g = m_buttonGroups.value(groupName);
+                m_output << m_option.indent << "QButtonGroup *" << g << " = new QButtonGroup(" << m_generatedClass << ");\n";
+            }
+
+            const QString g = m_buttonGroups.value(groupName);
+            m_output << m_option.indent << g << ".addButton(" << varName << ");\n";
+        }
+    }
+
+    writeProperties(varName, className, node->elementProperty());
+
+    if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("QMenu")) && parentWidget.size()) {
+        initializeMenu(node, parentWidget);
+    }
+
+    if (node->elementLayout().isEmpty())
+        m_layoutChain.push(0);
+
+    m_layoutWidget = false;
+    if (className == QLatin1String("QWidget") && !node->hasAttributeNative()) {
+        if (m_widgetChain.top()
+            && m_widgetChain.top()->attributeClass() != QLatin1String("QMainWindow")
+            && !m_uic->isContainer(m_widgetChain.top()->attributeClass()))
+            m_layoutWidget = true;
+    }
+    m_widgetChain.push(node);
+    m_layoutChain.push(0);
+    TreeWalker::acceptWidget(node);
+    m_layoutChain.pop();
+    m_widgetChain.pop();
+    m_layoutWidget = false;
+
+    const DomPropertyMap attributes = propertyMap(node->elementAttribute());
+
+    QString title = QLatin1String("Page");
+    if (const DomProperty *ptitle = attributes.value(QLatin1String("title"))) {
+        title = toString(ptitle->elementString());
+    }
+
+    QString label = QLatin1String("Page");
+    if (const DomProperty *plabel = attributes.value(QLatin1String("label"))) {
+        label = toString(plabel->elementString());
+    }
+
+    int id = -1;
+    if (const DomProperty *pid = attributes.value(QLatin1String("id"))) {
+        id = pid->elementNumber();
+    }
+
+    if (m_uic->customWidgetsInfo()->extends(parentClass, QLatin1String("QMainWindow"))
+            || m_uic->customWidgetsInfo()->extends(parentClass, QLatin1String("Q3MainWindow"))) {
+
+        if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("QMenuBar"))) {
+            if (!m_uic->customWidgetsInfo()->extends(parentClass, QLatin1String("Q3MainWindow")))
+                m_output << m_option.indent << parentWidget << ".setMenuBar(" << varName <<");\n";
+        } else if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("QToolBar"))) {
+            m_output << m_option.indent << parentWidget << ".addToolBar("
+                     << toolBarAreaStringFromDOMAttributes(attributes) << varName << ");\n";
+
+            if (const DomProperty *pbreak = attributes.value(QLatin1String("toolBarBreak"))) {
+                if (pbreak->elementBool() == QLatin1String("true")) {
+                    m_output << m_option.indent << parentWidget << ".insertToolBarBreak(" <<  varName << ");\n";
+                }
+            }
+
+        } else if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("QDockWidget"))) {
+            QString area;
+            if (DomProperty *pstyle = attributes.value(QLatin1String("dockWidgetArea"))) {
+                area += QLatin1String("(cast(qt.core.Qt.DockWidgetArea)(");
+                area += QString::number(pstyle->elementNumber());
+                area += QLatin1String(")), ");
+            }
+
+            m_output << m_option.indent << parentWidget << ".addDockWidget(" << area << varName << ");\n";
+        } else if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("QStatusBar"))) {
+            m_output << m_option.indent << parentWidget << ".setStatusBar(" << varName << ");\n";
+        } else if (className == QLatin1String("QWidget")) {
+            m_output << m_option.indent << parentWidget << ".setCentralWidget(" << varName << ");\n";
+        }
+    }
+
+    // Check for addPageMethod of a custom plugin first
+    const QString addPageMethod = m_uic->customWidgetsInfo()->customWidgetAddPageMethod(parentClass);
+    if (!addPageMethod.isEmpty()) {
+        m_output << m_option.indent << parentWidget << "." << addPageMethod << '(' << varName << ");\n";
+    } else if (m_uic->customWidgetsInfo()->extends(parentClass, QLatin1String("QStackedWidget"))) {
+        m_output << m_option.indent << parentWidget << ".addWidget(" << varName << ");\n";
+    } else if (m_uic->customWidgetsInfo()->extends(parentClass, QLatin1String("QToolBar"))) {
+        m_output << m_option.indent << parentWidget << ".addWidget(" << varName << ");\n";
+    } else if (m_uic->customWidgetsInfo()->extends(parentClass, QLatin1String("Q3WidgetStack"))) {
+        m_output << m_option.indent << parentWidget << ".addWidget(" << varName << ", " << id << ");\n";
+    } else if (m_uic->customWidgetsInfo()->extends(parentClass, QLatin1String("QDockWidget"))) {
+        m_output << m_option.indent << parentWidget << ".setWidget(" << varName << ");\n";
+    } else if (m_uic->customWidgetsInfo()->extends(parentClass, QLatin1String("QScrollArea"))) {
+        m_output << m_option.indent << parentWidget << ".setWidget(" << varName << ");\n";
+    } else if (m_uic->customWidgetsInfo()->extends(parentClass, QLatin1String("QSplitter"))) {
+        m_output << m_option.indent << parentWidget << ".addWidget(" << varName << ");\n";
+    } else if (m_uic->customWidgetsInfo()->extends(parentClass, QLatin1String("QMdiArea"))) {
+        m_output << m_option.indent << parentWidget << ".addSubWindow(" << varName << ");\n";
+    } else if (m_uic->customWidgetsInfo()->extends(parentClass, QLatin1String("QWorkspace"))) {
+        m_output << m_option.indent << parentWidget << ".addWindow(" << varName << ");\n";
+    } else if (m_uic->customWidgetsInfo()->extends(parentClass, QLatin1String("QWizard"))) {
+        m_output << m_option.indent << parentWidget << ".addPage(" << varName << ");\n";
+    } else if (m_uic->customWidgetsInfo()->extends(parentClass, QLatin1String("QToolBox"))) {
+        QString icon;
+        if (const DomProperty *picon = attributes.value(QLatin1String("icon"))) {
+            icon += QLatin1String(", ") ;
+            icon += iconCall(picon);
+        }
+
+        m_output << m_option.indent << parentWidget << ".addItem(" << varName << icon << ", " << trCall(label) << ");\n";
+
+        m_refreshOut << m_option.indent << parentWidget << ".setItemText("
+                   << parentWidget << ".indexOf(" << varName << "), " << trCall(label) << ");\n";
+
+#ifndef QT_NO_TOOLTIP
+        if (DomProperty *ptoolTip = attributes.value(QLatin1String("toolTip"))) {
+            m_refreshOut << m_option.indent << parentWidget << ".setItemToolTip("
+                       << parentWidget << ".indexOf(" << varName << "), " << trCall(ptoolTip->elementString()) << ");\n";
+        }
+#endif // QT_NO_TOOLTIP
+    } else if (m_uic->customWidgetsInfo()->extends(parentClass, QLatin1String("QTabWidget"))) {
+        QString icon;
+        if (const DomProperty *picon = attributes.value(QLatin1String("icon"))) {
+            icon += QLatin1String(", ");
+            icon += iconCall(picon);
+        }
+
+        m_output << m_option.indent << parentWidget << ".addTab(" << varName << icon << ", " << "QString());\n";
+
+        m_refreshOut << m_option.indent << parentWidget << ".setTabText("
+                   << parentWidget << ".indexOf(" << varName << "), " << trCall(title) << ");\n";
+
+#ifndef QT_NO_TOOLTIP
+        if (const DomProperty *ptoolTip = attributes.value(QLatin1String("toolTip"))) {
+            m_refreshOut << m_option.indent << parentWidget << ".setTabToolTip("
+                       << parentWidget << ".indexOf(" << varName << "), " << trCall(ptoolTip->elementString()) << ");\n";
+        }
+#endif // QT_NO_TOOLTIP
+    } else if (m_uic->customWidgetsInfo()->extends(parentClass, QLatin1String("Q3Wizard"))) {
+        m_output << m_option.indent << parentWidget << ".addPage(" << varName << ", " << trCall(title) << ");\n";
+
+        m_refreshOut << m_option.indent << parentWidget << ".setTitle("
+                   << varName << ", " << trCall(title) << ");\n";
+
+    }
+
+    if (node->elementLayout().isEmpty())
+        m_layoutChain.pop();
+
+    const QStringList zOrder = node->elementZOrder();
+    for (int i = 0; i < zOrder.size(); ++i) {
+        const QString name = zOrder.at(i);
+
+        if (!m_registeredWidgets.contains(name)) {
+            fprintf(stderr, "'%s' isn't a valid widget\n", name.toLatin1().data());
+            continue;
+        }
+
+        if (name.isEmpty()) {
+            continue;
+        }
+
+        m_output << m_option.indent << name << ".raise();\n";
+    }
+}
+
+
+void WriteInitialization::acceptLayout(DomLayout *node)
+{
+    const QString className = node->attributeClass();
+    const QString varName = m_driver->findOrInsertLayout(node);
+
+    const DomPropertyMap properties = propertyMap(node->elementProperty());
+    const bool oldLayoutProperties = properties.constFind(QLatin1String("margin")) != properties.constEnd();
+
+    bool isGroupBox = false;
+
+    if (m_widgetChain.top()) {
+        const QString parentWidget = m_widgetChain.top()->attributeClass();
+
+        if (!m_layoutChain.top() && (m_uic->customWidgetsInfo()->extends(parentWidget, QLatin1String("Q3GroupBox"))
+                        || m_uic->customWidgetsInfo()->extends(parentWidget, QLatin1String("Q3ButtonGroup")))) {
+            const QString parent = m_driver->findOrInsertWidget(m_widgetChain.top());
+
+            isGroupBox = true;
+            // special case for group box
+
+            m_output << m_option.indent << parent << ".setColumnLayout(0, qt.core.Qt.Vertical);\n";
+            QString objectName = parent;
+            objectName += QLatin1String(".layout()");
+            int marginType = Use43UiFile;
+            if (oldLayoutProperties)
+                marginType = m_layoutMarginType;
+
+            m_LayoutDefaultHandler.writeProperties(m_option.indent,
+                                    objectName, properties, marginType, false, m_output);
+        }
+    }
+
+    m_output << m_option.indent << varName << " = new " << className << '(';
+
+    if (!m_layoutChain.top() && !isGroupBox)
+        m_output << m_driver->findOrInsertWidget(m_widgetChain.top());
+
+    m_output << ");\n";
+
+    if (isGroupBox) {
+        const QString tempName = m_driver->unique(QLatin1String("boxlayout"));
+        m_output << m_option.indent << "QBoxLayout *" << tempName << " = qobject_cast<QBoxLayout *>(" <<
+                    m_driver->findOrInsertWidget(m_widgetChain.top()) << ".layout());\n";
+        m_output << m_option.indent << "if (" << tempName << ")\n";
+        m_output << m_option.indent << "    " << tempName << ".addLayout(" << varName << ");\n";
+    }
+
+    if (isGroupBox) {
+        m_output << m_option.indent << varName << ".setAlignment(qt.core.Qt.AlignTop);\n";
+    }  else {
+        // Suppress margin on a read child layout
+        const bool suppressMarginDefault = m_layoutChain.top();
+        int marginType = Use43UiFile;
+        if (oldLayoutProperties)
+            marginType = m_layoutMarginType;
+        m_LayoutDefaultHandler.writeProperties(m_option.indent, varName, properties, marginType, suppressMarginDefault, m_output);
+    }
+
+    m_layoutMarginType = SubLayoutMargin;
+
+    DomPropertyList propList = node->elementProperty();
+    if (m_layoutWidget) {
+        bool left, top, right, bottom;
+        left = top = right = bottom = false;
+        for (int i = 0; i < propList.size(); ++i) {
+            const DomProperty *p = propList.at(i);
+            const QString propertyName = p->attributeName();
+            if (propertyName == QLatin1String("leftMargin") && p->kind() == DomProperty::Number)
+                left = true;
+            else if (propertyName == QLatin1String("topMargin") && p->kind() == DomProperty::Number)
+                top = true;
+            else if (propertyName == QLatin1String("rightMargin") && p->kind() == DomProperty::Number)
+                right = true;
+            else if (propertyName == QLatin1String("bottomMargin") && p->kind() == DomProperty::Number)
+                bottom = true;
+        }
+        if (!left) {
+            DomProperty *p = new DomProperty();
+            p->setAttributeName(QLatin1String("leftMargin"));
+            p->setElementNumber(0);
+            propList.append(p);
+        }
+        if (!top) {
+            DomProperty *p = new DomProperty();
+            p->setAttributeName(QLatin1String("topMargin"));
+            p->setElementNumber(0);
+            propList.append(p);
+        }
+        if (!right) {
+            DomProperty *p = new DomProperty();
+            p->setAttributeName(QLatin1String("rightMargin"));
+            p->setElementNumber(0);
+            propList.append(p);
+        }
+        if (!bottom) {
+            DomProperty *p = new DomProperty();
+            p->setAttributeName(QLatin1String("bottomMargin"));
+            p->setElementNumber(0);
+            propList.append(p);
+        }
+        m_layoutWidget = false;
+    }
+
+    writeProperties(varName, className, propList, WritePropertyIgnoreMargin|WritePropertyIgnoreSpacing);
+
+    m_layoutChain.push(node);
+    TreeWalker::acceptLayout(node);
+    m_layoutChain.pop();
+}
+
+void WriteInitialization::acceptSpacer(DomSpacer *node)
+{
+    m_output << m_option.indent << m_driver->findOrInsertSpacer(node) << " = ";
+    writeSpacerItem(node, m_output);
+    m_output << ";\n";
+}
+
+void WriteInitialization::acceptLayoutItem(DomLayoutItem *node)
+{
+    TreeWalker::acceptLayoutItem(node);
+
+    DomLayout *layout = m_layoutChain.top();
+
+    if (!layout)
+        return;
+
+    const QString layoutName = m_driver->findOrInsertLayout(layout);
+    const QString itemName = m_driver->findOrInsertLayoutItem(node);
+
+    QString addArgs;
+    QString methodPrefix = QLatin1String("add"); //Consistent API-design galore!
+    if (layout->attributeClass() == QLatin1String("QGridLayout")) {
+        const int row = node->attributeRow();
+        const int col = node->attributeColumn();
+
+        int rowSpan = 1;
+        if (node->hasAttributeRowSpan())
+            rowSpan = node->attributeRowSpan();
+
+        int colSpan = 1;
+        if (node->hasAttributeColSpan())
+            colSpan = node->attributeColSpan();
+
+        addArgs = QString::fromLatin1("%1, %2, %3, %4, %5").arg(itemName).arg(row).arg(col).arg(rowSpan).arg(colSpan);
+    } else {
+        if (layout->attributeClass() == QLatin1String("QFormLayout")) {
+            methodPrefix = QLatin1String("set");
+            const int row = node->attributeRow();
+            const QString role = node->attributeColumn() == 0 ? QLatin1String("qt.gui.QFormLayout.LabelRole") : QLatin1String("qt.gui.QFormLayout.FieldRole");
+            addArgs = QString::fromLatin1("%1, %2, %3").arg(row).arg(role).arg(itemName);
+        } else {
+            addArgs = itemName;
+        }
+    }
+
+    // figure out "add" method
+    m_output << "\n" << m_option.indent << layoutName << ".";
+    switch (node->kind()) {
+    case DomLayoutItem::Widget:
+        m_output << methodPrefix << "Widget(" <<  addArgs;
+        break;
+    case DomLayoutItem::Layout:
+        m_output <<  methodPrefix << "Layout(" << addArgs;
+        break;
+    case DomLayoutItem::Spacer:
+        m_output << methodPrefix << "Item(" << addArgs;
+        break;
+    case DomLayoutItem::Unknown:
+        Q_ASSERT( 0 );
+        break;
+    }
+    m_output << ");\n\n";
+}
+
+void WriteInitialization::acceptActionGroup(DomActionGroup *node)
+{
+    const QString actionName = m_driver->findOrInsertActionGroup(node);
+    QString varName = m_driver->findOrInsertWidget(m_widgetChain.top());
+
+    if (m_actionGroupChain.top())
+        varName = m_driver->findOrInsertActionGroup(m_actionGroupChain.top());
+
+    m_output << m_option.indent << actionName << " = new QActionGroup(" << varName << ");\n";
+    writeProperties(actionName, QLatin1String("QActionGroup"), node->elementProperty());
+
+    m_actionGroupChain.push(node);
+    TreeWalker::acceptActionGroup(node);
+    m_actionGroupChain.pop();
+}
+
+void WriteInitialization::acceptAction(DomAction *node)
+{
+    if (node->hasAttributeMenu())
+        return;
+
+    const QString actionName = m_driver->findOrInsertAction(node);
+    m_registeredActions.insert(actionName, node);
+    QString varName = m_driver->findOrInsertWidget(m_widgetChain.top());
+
+    if (m_actionGroupChain.top())
+        varName = m_driver->findOrInsertActionGroup(m_actionGroupChain.top());
+
+    m_output << m_option.indent << actionName << " = new QAction(" << varName << ");\n";
+    writeProperties(actionName, QLatin1String("QAction"), node->elementProperty());
+}
+
+void WriteInitialization::acceptActionRef(DomActionRef *node)
+{
+    QString actionName = node->attributeName();
+    const bool isSeparator = actionName == QLatin1String("separator");
+    bool isMenu = false;
+
+    QString varName = m_driver->findOrInsertWidget(m_widgetChain.top());
+
+    if (actionName.isEmpty() || !m_widgetChain.top()) {
+        return;
+    } else if (m_driver->actionGroupByName(actionName)) {
+        return;
+    } else if (DomWidget *w = m_driver->widgetByName(actionName)) {
+        isMenu = m_uic->isMenu(w->attributeClass());
+        bool inQ3ToolBar = m_uic->customWidgetsInfo()->extends(m_widgetChain.top()->attributeClass(), QLatin1String("Q3ToolBar"));
+        if (!isMenu && inQ3ToolBar) {
+            m_actionOut << m_option.indent << actionName << ".setParent(" << varName << ");\n";
+            return;
+        }
+    } else if (!(m_driver->actionByName(actionName) || isSeparator)) {
+        fprintf(stderr, "Warning: action `%s' not declared\n", actionName.toLatin1().data());
+        return;
+    }
+
+    if (m_widgetChain.top() && isSeparator) {
+        // separator is always reserved!
+        m_actionOut << m_option.indent << varName << ".addSeparator();\n";
+        return;
+    }
+
+    if (isMenu)
+        actionName += QLatin1String(".menuAction()");
+
+    m_actionOut << m_option.indent << varName << ".addAction(" << actionName << ");\n";
+}
+
+void WriteInitialization::writeProperties(const QString &varName,
+                                          const QString &className,
+                                          const DomPropertyList &lst,
+                                          unsigned flags)
+{
+    const bool isTopLevel = m_widgetChain.count() == 1;
+
+    if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("QAxWidget"))) {
+        DomPropertyMap properties = propertyMap(lst);
+        if (properties.contains(QLatin1String("control"))) {
+            DomProperty *p = properties.value(QLatin1String("control"));
+            m_output << m_option.indent << varName << ".setControl(qt.core.QString.fromUtf8("
+                   << fixString(toString(p->elementString()), m_option.indent) << "));\n";
+        }
+    }
+
+    DomWidget *buttonGroupWidget = findWidget(QLatin1String("Q3ButtonGroup"));
+
+    QString indent;
+    if (!m_widgetChain.top()) {
+        indent = QLatin1String("    ");
+        m_output << m_option.indent << "if (" << varName << ".objectName().isEmpty())\n";
+    }
+    m_output << m_option.indent << indent << varName << ".setObjectName(qt.core.QString.fromUtf8(" << fixString(varName, m_option.indent) << "));\n";
+
+    int leftMargin, topMargin, rightMargin, bottomMargin;
+    leftMargin = topMargin = rightMargin = bottomMargin = -1;
+    bool frameShadowEncountered = false;
+
+    for (int i=0; i<lst.size(); ++i) {
+        const DomProperty *p = lst.at(i);
+        if (!checkProperty(m_option.inputFile, p))
+            continue;
+        const QString propertyName = p->attributeName();
+        QString propertyValue;
+
+        // special case for the property `geometry': Do not use position
+        if (isTopLevel && propertyName == QLatin1String("geometry") && p->elementRect()) {
+            const DomRect *r = p->elementRect();
+            m_output << m_option.indent << varName << ".resize(" << r->elementWidth() << ", " << r->elementHeight() << ");\n";
+            continue;
+        } else if (propertyName == QLatin1String("buttonGroupId") && buttonGroupWidget) { // Q3ButtonGroup support
+            m_output << m_option.indent << m_driver->findOrInsertWidget(buttonGroupWidget) << ".insert("
+                   << varName << ", " << p->elementNumber() << ");\n";
+            continue;
+        } else if (propertyName == QLatin1String("currentRow") // QListWidget::currentRow
+                    && m_uic->customWidgetsInfo()->extends(className, QLatin1String("QListWidget"))) {
+            m_delayedOut << m_option.indent << varName << ".setCurrentRow("
+                       << p->elementNumber() << ");\n";
+            continue;
+        } else if (propertyName == QLatin1String("currentIndex") // set currentIndex later
+                    && (m_uic->customWidgetsInfo()->extends(className, QLatin1String("QComboBox"))
+                    || m_uic->customWidgetsInfo()->extends(className, QLatin1String("QStackedWidget"))
+                    || m_uic->customWidgetsInfo()->extends(className, QLatin1String("QTabWidget"))
+                    || m_uic->customWidgetsInfo()->extends(className, QLatin1String("QToolBox")))) {
+            m_delayedOut << m_option.indent << varName << ".setCurrentIndex("
+                       << p->elementNumber() << ");\n";
+            continue;
+        } else if (propertyName == QLatin1String("tabSpacing")
+                    && m_uic->customWidgetsInfo()->extends(className, QLatin1String("QToolBox"))) {
+            m_delayedOut << m_option.indent << varName << ".layout()->setSpacing("
+                       << p->elementNumber() << ");\n";
+            continue;
+        } else if (propertyName == QLatin1String("control") // ActiveQt support
+                    && m_uic->customWidgetsInfo()->extends(className, QLatin1String("QAxWidget"))) {
+            // already done ;)
+            continue;
+        } else if (propertyName == QLatin1String("database")
+                    && p->elementStringList()) {
+            // Sql support
+            continue;
+        } else if (propertyName == QLatin1String("frameworkCode")
+                    && p->kind() == DomProperty::Bool) {
+            // Sql support
+            continue;
+        } else if (propertyName == QLatin1String("orientation")
+                    && m_uic->customWidgetsInfo()->extends(className, QLatin1String("Line"))) {
+            // Line support
+            QString shape = QLatin1String("qt.gui.QFrame.HLine");
+            if (p->elementEnum() == QLatin1String("qt.core.Qt.Vertical"))
+                shape = QLatin1String("qt.gui.QFrame.VLine");
+
+            m_output << m_option.indent << varName << ".setFrameShape(" << shape << ");\n";
+            // QFrame Default is 'Plain'. Make the line 'Sunken' unless otherwise specified
+            if (!frameShadowEncountered)
+                m_output << m_option.indent << varName << ".setFrameShadow(qt.gui.QFrame.Sunken);\n";
+            continue;
+        } else if ((flags & WritePropertyIgnoreMargin)  && propertyName == QLatin1String("margin")) {
+            continue;
+        } else if ((flags & WritePropertyIgnoreSpacing) && propertyName == QLatin1String("spacing")) {
+            continue;
+        } else if (propertyName == QLatin1String("leftMargin") && p->kind() == DomProperty::Number) {
+            leftMargin = p->elementNumber();
+            continue;
+        } else if (propertyName == QLatin1String("topMargin") && p->kind() == DomProperty::Number) {
+            topMargin = p->elementNumber();
+            continue;
+        } else if (propertyName == QLatin1String("rightMargin") && p->kind() == DomProperty::Number) {
+            rightMargin = p->elementNumber();
+            continue;
+        } else if (propertyName == QLatin1String("bottomMargin") && p->kind() == DomProperty::Number) {
+            bottomMargin = p->elementNumber();
+            continue;
+        } else if (propertyName == QLatin1String("frameShadow"))
+            frameShadowEncountered = true;
+
+        bool stdset = m_stdsetdef;
+        if (p->hasAttributeStdset())
+            stdset = p->attributeStdset();
+
+        QString setFunction;
+
+        if (stdset) {
+            setFunction = QLatin1String(".set");
+            setFunction += propertyName.left(1).toUpper();
+            setFunction += propertyName.mid(1);
+            setFunction += QLatin1Char('(');
+        } else {
+            setFunction = QLatin1String(".setProperty(\"");
+            setFunction += propertyName;
+            setFunction += QLatin1String("\", QVariant(");
+        }
+
+        QString varNewName = varName;
+
+        switch (p->kind()) {
+        case DomProperty::Bool: {
+            propertyValue = p->elementBool();
+            break;
+        }
+        case DomProperty::Color:
+            propertyValue = domColor2QString(p->elementColor());
+            break;
+        case DomProperty::Cstring:
+            if (propertyName == QLatin1String("buddy") && m_uic->customWidgetsInfo()->extends(className, QLatin1String("QLabel"))) {
+                m_buddies.append(Buddy(varName, p->elementCstring()));
+            } else {
+                if (stdset)
+                    propertyValue = fixString(p->elementCstring(), m_option.indent);
+                else {
+                    propertyValue = QLatin1String("QByteArray(");
+                    propertyValue += fixString(p->elementCstring(), m_option.indent);
+                    propertyValue += QLatin1Char(')');
+                }
+            }
+            break;
+        case DomProperty::Cursor:
+            propertyValue = QString::fromLatin1("qt.gui.QCursor(cast(qt.core.Qt.CursorShape)(%1))")
+                            .arg(p->elementCursor());
+            break;
+        case DomProperty::CursorShape:
+            if (p->hasAttributeStdset() && !p->attributeStdset())
+                varNewName += QLatin1String(".viewport()");
+            propertyValue = QString::fromLatin1("QCursor(qt.core.Qt.%1)")
+                            .arg(p->elementCursorShape());
+            break;
+        case DomProperty::Enum:
+            propertyValue = p->elementEnum();
+            if (!propertyValue.contains(QLatin1String("."))) {
+                QString scope  = className;
+                scope += QLatin1String(".");
+                propertyValue.prepend(scope);
+            }
+            break;
+        case DomProperty::Set:
+            propertyValue = p->elementSet();
+            break;
+        case DomProperty::Font:
+            propertyValue = writeFontProperties(p->elementFont());
+            break;
+        case DomProperty::IconSet:
+            propertyValue = writeIconProperties(p->elementIconSet());
+            break;
+        case DomProperty::Pixmap:
+            propertyValue = pixCall(p);
+            break;
+        case DomProperty::Palette: {
+            const DomPalette *pal = p->elementPalette();
+            const QString paletteName = m_driver->unique(QLatin1String("palette"));
+            m_output << m_option.indent << "QPalette " << paletteName << ";\n";
+
+            writeColorGroup(pal->elementActive(), QLatin1String("qt.gui.QPalette.Active"), paletteName);
+            writeColorGroup(pal->elementInactive(), QLatin1String("qt.gui.QPalette.Inactive"), paletteName);
+            writeColorGroup(pal->elementDisabled(), QLatin1String("qt.gui.QPalette.Disabled"), paletteName);
+
+            propertyValue = paletteName;
+            break;
+        }
+        case DomProperty::Point: {
+            const DomPoint *po = p->elementPoint();
+            propertyValue = QString::fromLatin1("qt.core.QPoint(%1, %2)")
+                            .arg(po->elementX()).arg(po->elementY());
+            break;
+        }
+        case DomProperty::PointF: {
+            const DomPointF *pof = p->elementPointF();
+            propertyValue = QString::fromLatin1("qt.core.QPointF(%1, %2)")
+                            .arg(pof->elementX()).arg(pof->elementY());
+            break;
+        }
+        case DomProperty::Rect: {
+            const DomRect *r = p->elementRect();
+            propertyValue = QString::fromLatin1("qt.core.QRect(%1, %2, %3, %4)")
+                            .arg(r->elementX()).arg(r->elementY())
+                            .arg(r->elementWidth()).arg(r->elementHeight());
+            break;
+        }
+        case DomProperty::RectF: {
+            const DomRectF *rf = p->elementRectF();
+            propertyValue = QString::fromLatin1("qt.core.QRectF(%1, %2, %3, %4)")
+                            .arg(rf->elementX()).arg(rf->elementY())
+                            .arg(rf->elementWidth()).arg(rf->elementHeight());
+            break;
+        }
+        case DomProperty::Locale: {
+             const DomLocale *locale = p->elementLocale();
+             propertyValue = QString::fromLatin1("qt.core.QLocale(qt.core.QLocale.%1, qt.core.QLocale.%2)")
+                             .arg(locale->attributeLanguage()).arg(locale->attributeCountry());
+            break;
+        }
+        case DomProperty::SizePolicy: {
+            const QString spName = writeSizePolicy( p->elementSizePolicy());
+            m_output << m_option.indent << spName << QString::fromLatin1(
+                ".setHeightForWidth(%1.sizePolicy().hasHeightForWidth());\n")
+                .arg(varName);
+
+            propertyValue = spName;
+            break;
+        }
+        case DomProperty::Size: {
+             const DomSize *s = p->elementSize();
+              propertyValue = QString::fromLatin1("qt.core.QSize(%1, %2)")
+                             .arg(s->elementWidth()).arg(s->elementHeight());
+            break;
+        }
+        case DomProperty::SizeF: {
+            const DomSizeF *sf = p->elementSizeF();
+             propertyValue = QString::fromLatin1("qt.core.QSizeF(%1, %2)")
+                            .arg(sf->elementWidth()).arg(sf->elementHeight());
+            break;
+        }
+        case DomProperty::String: {
+            if (propertyName == QLatin1String("objectName")) {
+                const QString v = p->elementString()->text();
+                if (v == varName)
+                    break;
+
+                // ### qWarning("Deprecated: the property `objectName' is different from the variable name");
+            }
+
+            if (p->elementString()->hasAttributeNotr()
+                    && toBool(p->elementString()->attributeNotr())) {
+                propertyValue = QLatin1String("QString.fromUtf8(");
+                propertyValue += fixString(p->elementString()->text(), m_option.indent);
+                propertyValue += QLatin1Char(')');
+            } else {
+                propertyValue = trCall(p->elementString());
+            }
+            break;
+        }
+        case DomProperty::Number:
+            propertyValue = QString::number(p->elementNumber());
+            break;
+        case DomProperty::UInt:
+            propertyValue = QString::number(p->elementUInt());
+            propertyValue += QLatin1Char('u');
+            break;
+        case DomProperty::LongLong:
+            propertyValue = QLatin1String("Q_INT64_C(");
+            propertyValue += QString::number(p->elementLongLong());
+            propertyValue += QLatin1Char(')');;
+            break;
+        case DomProperty::ULongLong:
+            propertyValue = QLatin1String("Q_UINT64_C(");
+            propertyValue += QString::number(p->elementULongLong());
+            propertyValue += QLatin1Char(')');
+            break;
+        case DomProperty::Float:
+            propertyValue = QString::number(p->elementFloat());
+            break;
+        case DomProperty::Double:
+            propertyValue = QString::number(p->elementDouble());
+            break;
+        case DomProperty::Char: {
+            const DomChar *c = p->elementChar();
+            propertyValue = QString::fromLatin1("qt.core.QChar(%1)")
+                            .arg(c->elementUnicode());
+            break;
+        }
+        case DomProperty::Date: {
+            const DomDate *d = p->elementDate();
+            propertyValue = QString::fromLatin1("qt.core.QDate(%1, %2, %3)")
+                            .arg(d->elementYear())
+                            .arg(d->elementMonth())
+                            .arg(d->elementDay());
+            break;
+        }
+        case DomProperty::Time: {
+            const DomTime *t = p->elementTime();
+            propertyValue = QString::fromLatin1("qt.core.QTime(%1, %2, %3)")
+                            .arg(t->elementHour())
+                            .arg(t->elementMinute())
+                            .arg(t->elementSecond());
+            break;
+        }
+        case DomProperty::DateTime: {
+            const DomDateTime *dt = p->elementDateTime();
+            propertyValue = QString::fromLatin1("qt.core.QDateTime(qt.core.QDate(%1, %2, %3), qt.core.QTime(%4, %5, %6))")
+                            .arg(dt->elementYear())
+                            .arg(dt->elementMonth())
+                            .arg(dt->elementDay())
+                            .arg(dt->elementHour())
+                            .arg(dt->elementMinute())
+                            .arg(dt->elementSecond());
+            break;
+        }
+        case DomProperty::StringList:
+            propertyValue = QLatin1String("qt.core.QStringList()");
+            if (p->elementStringList()->elementString().size()) {
+                const QStringList lst = p->elementStringList()->elementString();
+                for (int i=0; i<lst.size(); ++i) {
+                    propertyValue += QLatin1String(" << ");
+                    propertyValue +=fixString(lst.at(i), m_option.indent);
+                }
+            }
+            break;
+
+        case DomProperty::Url: {
+            const DomUrl* u = p->elementUrl();
+            propertyValue = QString::fromLatin1("qt.core.QUrl(%1)")
+                            .arg(fixString(u->elementString()->text(), m_option.indent));
+            break;
+        }
+        case DomProperty::Brush:
+            propertyValue = writeBrushInitialization(p->elementBrush());
+            break;
+        case DomProperty::Unknown:
+            break;
+        }
+
+        if (propertyValue.size()) {
+            const char* defineC = 0;
+            if (propertyName == QLatin1String("toolTip"))
+                defineC = toolTipDefineC;
+            if (propertyName == QLatin1String("whatsThis"))
+                defineC = whatsThisDefineC;
+            if (propertyName == QLatin1String("statusTip"))
+                defineC = statusTipDefineC;
+            const bool needsTranslation = p->kind() == DomProperty::String && (!p->elementString()->hasAttributeNotr() || !toBool(p->elementString()->attributeNotr()));
+            if (propertyName == QLatin1String("accessibleName") || propertyName == QLatin1String("accessibleDescription"))
+                defineC = accessibilityDefineC;
+
+            QTextStream &o = needsTranslation ? m_refreshOut : m_output;
+
+            if (defineC)
+                openIfndef(o, QLatin1String(defineC));
+            o << m_option.indent << varNewName << setFunction << propertyValue;
+            if (!stdset)
+                o << ')';
+            o << ");\n";
+            if (defineC)
+                closeIfdef(o, QLatin1String(defineC));
+        }
+    }
+    if (leftMargin != -1 || topMargin != -1 || rightMargin != -1 || bottomMargin != -1) {
+        QString objectName = varName;
+        if (m_widgetChain.top()) {
+            const QString parentWidget = m_widgetChain.top()->attributeClass();
+
+            if (!m_layoutChain.top() && (m_uic->customWidgetsInfo()->extends(parentWidget, QLatin1String("Q3GroupBox"))
+                        || m_uic->customWidgetsInfo()->extends(parentWidget, QLatin1String("Q3ButtonGroup")))) {
+                objectName = m_driver->findOrInsertWidget(m_widgetChain.top()) + QLatin1String(".layout()");
+            }
+        }
+        m_output << m_option.indent << objectName << QLatin1String(".setContentsMargins(")
+                 << leftMargin << QLatin1String(", ")
+                 << topMargin << QLatin1String(", ")
+                 << rightMargin << QLatin1String(", ")
+                 << bottomMargin << QLatin1String(");\n");
+    }
+}
+
+QString  WriteInitialization::writeSizePolicy(const DomSizePolicy *sp)
+{
+
+    // check cache
+    const SizePolicyHandle sizePolicyHandle(sp);
+    const SizePolicyNameMap::const_iterator it = m_sizePolicyNameMap.constFind(sizePolicyHandle);
+    if ( it != m_sizePolicyNameMap.constEnd()) {
+        return it.value();
+    }
+
+
+    // insert with new name
+    const QString spName = m_driver->unique(QLatin1String("sizePolicy"));
+    m_sizePolicyNameMap.insert(sizePolicyHandle, spName);
+
+    m_output << m_option.indent << "qt.core.QSizePolicy " << spName;
+    do {
+        if (sp->hasElementHSizeType() && sp->hasElementVSizeType()) {
+            m_output << "(cast(qt.core.QSizePolicy.Policy)(" << sp->elementHSizeType()
+                << "), cast(qt.core.QSizePolicy.Policy)(" << sp->elementVSizeType() << "));\n";
+            break;
+        }
+        if (sp->hasAttributeHSizeType() && sp->hasAttributeVSizeType()) {
+                m_output << "(qt.core.QSizePolicy." << sp->attributeHSizeType() << ", QSizePolicy."
+                << sp->attributeVSizeType() << ");\n";
+            break;
+        }
+        m_output << ";\n";
+    } while (false);
+
+    m_output << m_option.indent << spName << ".setHorizontalStretch("
+        << sp->elementHorStretch() << ");\n";
+    m_output << m_option.indent << spName << ".setVerticalStretch("
+        << sp->elementVerStretch() << ");\n";
+    return spName;
+}
+// Check for a font with the given properties in the FontPropertiesNameMap
+// or create a new one. Returns the name.
+
+QString WriteInitialization::writeFontProperties(const DomFont *f)
+{
+    // check cache
+    const FontHandle fontHandle(f);
+    const FontPropertiesNameMap::const_iterator it = m_fontPropertiesNameMap.constFind(fontHandle);
+    if ( it != m_fontPropertiesNameMap.constEnd()) {
+        return it.value();
+    }
+
+    // insert with new name
+    const QString fontName = m_driver->unique(QLatin1String("font"));
+    m_fontPropertiesNameMap.insert(FontHandle(f), fontName);
+
+    m_output << m_option.indent << "QFont " << fontName << ";\n";
+    if (f->hasElementFamily() && !f->elementFamily().isEmpty()) {
+        m_output << m_option.indent << fontName << ".setFamily(qt.core.QString.fromUtf8(" << fixString(f->elementFamily(), m_option.indent)
+            << "));\n";
+    }
+    if (f->hasElementPointSize() && f->elementPointSize() > 0) {
+         m_output << m_option.indent << fontName << ".setPointSize(" << f->elementPointSize()
+             << ");\n";
+    }
+
+    if (f->hasElementBold()) {
+        m_output << m_option.indent << fontName << ".setBold("
+            << (f->elementBold() ? "true" : "false") << ");\n";
+    }
+    if (f->hasElementItalic()) {
+        m_output << m_option.indent << fontName << ".setItalic("
+            <<  (f->elementItalic() ? "true" : "false") << ");\n";
+    }
+    if (f->hasElementUnderline()) {
+        m_output << m_option.indent << fontName << ".setUnderline("
+            << (f->elementUnderline() ? "true" : "false") << ");\n";
+    }
+    if (f->hasElementWeight() && f->elementWeight() > 0) {
+        m_output << m_option.indent << fontName << ".setWeight("
+            << f->elementWeight() << ");" << endl;
+    }
+    if (f->hasElementStrikeOut()) {
+         m_output << m_option.indent << fontName << ".setStrikeOut("
+            << (f->elementStrikeOut() ? "true" : "false") << ");\n";
+    }
+    if (f->hasElementKerning()) {
+        m_output << m_option.indent << fontName << ".setKerning("
+            << (f->elementKerning() ? "true" : "false") << ");\n";
+    }
+    if (f->hasElementAntialiasing()) {
+        m_output << m_option.indent << fontName << ".setStyleStrategy("
+            << (f->elementAntialiasing() ? "qt.gui.QFont.PreferDefault" : "qt.gui.QFont.NoAntialias") << ");\n";
+    }
+    if (f->hasElementStyleStrategy()) {
+         m_output << m_option.indent << fontName << ".setStyleStrategy(qt.core.QFont."
+            << f->elementStyleStrategy() << ");\n";
+    }
+    return  fontName;
+}
+
+QString WriteInitialization::writeIconProperties(const DomResourceIcon *i)
+{
+    // check cache
+    const IconHandle iconHandle(i);
+    const IconPropertiesNameMap::const_iterator it = m_iconPropertiesNameMap.constFind(iconHandle);
+    if (it != m_iconPropertiesNameMap.constEnd()) {
+        return it.value();
+    }
+
+    // insert with new name
+    const QString iconName = m_driver->unique(QLatin1String("icon"));
+    m_iconPropertiesNameMap.insert(IconHandle(i), iconName);
+    if (isIconFormat44(i)) {
+        const QString pixmap = QLatin1String("qt.gui.QPixmap");
+        m_output << m_option.indent << "qt.gui.QIcon " << iconName << ";\n";
+        if (i->hasElementNormalOff())
+            m_output << m_option.indent << iconName << ".addPixmap(" << pixCall(pixmap, i->elementNormalOff()->text()) << ", qt.gui.QIcon.Normal, qt.gui.QIcon.Off);\n";
+        if (i->hasElementNormalOn())
+            m_output << m_option.indent << iconName << ".addPixmap(" << pixCall(pixmap, i->elementNormalOn()->text()) << ", qt.gui.QIcon.Normal, qt.gui.QIcon.On);\n";
+        if (i->hasElementDisabledOff())
+            m_output << m_option.indent << iconName << ".addPixmap(" << pixCall(pixmap, i->elementDisabledOff()->text()) << ", qt.gui.QIcon.Disabled, qt.gui.QIcon.Off);\n";
+        if (i->hasElementDisabledOn())
+            m_output << m_option.indent << iconName << ".addPixmap(" << pixCall(pixmap, i->elementDisabledOn()->text()) << ", qt.gui.QIcon.Disabled, qt.gui.QIcon.On);\n";
+        if (i->hasElementActiveOff())
+            m_output << m_option.indent << iconName << ".addPixmap(" << pixCall(pixmap, i->elementActiveOff()->text()) << ", qt.gui.QIcon.Active, qt.gui.QIcon.Off);\n";
+        if (i->hasElementActiveOn())
+            m_output << m_option.indent << iconName << ".addPixmap(" << pixCall(pixmap, i->elementActiveOn()->text()) << ", qt.gui.QIcon.Active, qt.gui.QIcon.On);\n";
+        if (i->hasElementSelectedOff())
+            m_output << m_option.indent << iconName << ".addPixmap(" << pixCall(pixmap, i->elementSelectedOff()->text()) << ", qt.gui.QIcon.Selected, qt.gui.QIcon.Off);\n";
+        if (i->hasElementSelectedOn())
+            m_output << m_option.indent << iconName << ".addPixmap(" << pixCall(pixmap, i->elementSelectedOn()->text()) << ", qt.gui.QIcon.Selected, qt.gui.QIcon.On);\n";
+    } else { // pre-4.4 legacy
+        m_output <<  m_option.indent << "const qt.gui.QIcon " << iconName << " = " << pixCall(QLatin1String("QIcon"), i->text())<< ";\n";
+    }
+    return iconName;
+}
+
+QString WriteInitialization::domColor2QString(const DomColor *c)
+{
+    if (c->hasAttributeAlpha())
+        return QString::fromLatin1("qt.gui.QColor(%1, %2, %3, %4)")
+            .arg(c->elementRed())
+            .arg(c->elementGreen())
+            .arg(c->elementBlue())
+            .arg(c->attributeAlpha());
+    return QString::fromLatin1("qt.gui.QColor(%1, %2, %3)")
+        .arg(c->elementRed())
+        .arg(c->elementGreen())
+        .arg(c->elementBlue());
+}
+
+void WriteInitialization::writeColorGroup(DomColorGroup *colorGroup, const QString &group, const QString &paletteName)
+{
+    if (!colorGroup)
+        return;
+
+    // old format
+    const QList<DomColor*> colors = colorGroup->elementColor();
+    for (int i=0; i<colors.size(); ++i) {
+        const DomColor *color = colors.at(i);
+
+        m_output << m_option.indent << paletteName << ".setColor(" << group
+            << ", " << "cast(qt.gui.QPalette.ColorRole)(" << QString::number(i) << ')'
+            << ", " << domColor2QString(color)
+            << ");\n";
+    }
+
+    // new format
+    const QList<DomColorRole *> colorRoles = colorGroup->elementColorRole();
+    QListIterator<DomColorRole *> itRole(colorRoles);
+    while (itRole.hasNext()) {
+        const DomColorRole *colorRole = itRole.next();
+        if (colorRole->hasAttributeRole()) {
+            const QString brushName = writeBrushInitialization(colorRole->elementBrush());
+            m_output << m_option.indent << paletteName << ".setBrush(" << group
+                << ", " << "qt.gui.QPalette." << colorRole->attributeRole()
+                << ", " << brushName << ");\n";
+        }
+    }
+}
+
+// Write initialization for brush unless it is found in the cache. Returns the name to use
+// in an expression.
+QString WriteInitialization::writeBrushInitialization(const DomBrush *brush)
+{
+    // Simple solid, colored  brushes are cached
+    const bool solidColoredBrush = !brush->hasAttributeBrushStyle() || brush->attributeBrushStyle() == QLatin1String("SolidPattern");
+    uint rgb = 0;
+    if (solidColoredBrush) {
+        if (const DomColor *color = brush->elementColor()) {
+            rgb = ((color->elementRed() & 0xFF) << 24) |
+                  ((color->elementGreen() & 0xFF) << 16) |
+                  ((color->elementBlue() & 0xFF) << 8) |
+                  ((color->attributeAlpha() & 0xFF));
+            const ColorBrushHash::const_iterator cit = m_colorBrushHash.constFind(rgb);
+            if (cit != m_colorBrushHash.constEnd())
+                return cit.value();
+        }
+    }
+    // Create and enter into cache if simple
+    const QString brushName = m_driver->unique(QLatin1String("brush"));
+    writeBrush(brush, brushName);
+    if (solidColoredBrush)
+        m_colorBrushHash.insert(rgb, brushName);
+    return brushName;
+}
+
+void WriteInitialization::writeBrush(const DomBrush *brush, const QString &brushName)
+{
+    QString style = QLatin1String("SolidPattern");
+    if (brush->hasAttributeBrushStyle())
+        style = brush->attributeBrushStyle();
+
+    if (style == QLatin1String("LinearGradientPattern") ||
+            style == QLatin1String("RadialGradientPattern") ||
+            style == QLatin1String("ConicalGradientPattern")) {
+        const DomGradient *gradient = brush->elementGradient();
+        const QString gradientType = gradient->attributeType();
+        const QString gradientName = m_driver->unique(QLatin1String("gradient"));
+        if (gradientType == QLatin1String("LinearGradient")) {
+            m_output << m_option.indent << "QLinearGradient " << gradientName
+                << '(' << gradient->attributeStartX()
+                << ", " << gradient->attributeStartY()
+                << ", " << gradient->attributeEndX()
+                << ", " << gradient->attributeEndY() << ");\n";
+        } else if (gradientType == QLatin1String("RadialGradient")) {
+            m_output << m_option.indent << "QRadialGradient " << gradientName
+                << '(' << gradient->attributeCentralX()
+                << ", " << gradient->attributeCentralY()
+                << ", " << gradient->attributeRadius()
+                << ", " << gradient->attributeFocalX()
+                << ", " << gradient->attributeFocalY() << ");\n";
+        } else if (gradientType == QLatin1String("ConicalGradient")) {
+            m_output << m_option.indent << "QConicalGradient " << gradientName
+                << '(' << gradient->attributeCentralX()
+                << ", " << gradient->attributeCentralY()
+                << ", " << gradient->attributeAngle() << ");\n";
+        }
+
+        m_output << m_option.indent << gradientName << ".setSpread(qt.gui.QGradient."
+            << gradient->attributeSpread() << ");\n";
+
+        if (gradient->hasAttributeCoordinateMode()) {
+            m_output << m_option.indent << gradientName << ".setCoordinateMode(qt.gui.QGradient."
+                << gradient->attributeCoordinateMode() << ");\n";
+        }
+
+       const  QList<DomGradientStop *> stops = gradient->elementGradientStop();
+        QListIterator<DomGradientStop *> it(stops);
+        while (it.hasNext()) {
+            const DomGradientStop *stop = it.next();
+            const DomColor *color = stop->elementColor();
+            m_output << m_option.indent << gradientName << ".setColorAt("
+                << stop->attributePosition() << ", "
+                << domColor2QString(color) << ");\n";
+        }
+        m_output << m_option.indent << "QBrush " << brushName << '('
+            << gradientName << ");\n";
+    } else if (style == QLatin1String("TexturePattern")) {
+        const DomProperty *property = brush->elementTexture();
+        const QString iconValue = iconCall(property);
+
+        m_output << m_option.indent << "QBrush " << brushName << " = QBrush("
+            << iconValue << ");\n";
+    } else {
+        const DomColor *color = brush->elementColor();
+        m_output << m_option.indent << "QBrush " << brushName << '('
+            << domColor2QString(color) << ");\n";
+
+        m_output << m_option.indent << brushName << ".setStyle("
+            << "qt.core.Qt." << style << ");\n";
+    }
+}
+
+void WriteInitialization::acceptCustomWidget(DomCustomWidget *node)
+{
+    Q_UNUSED(node);
+}
+
+void WriteInitialization::acceptCustomWidgets(DomCustomWidgets *node)
+{
+    Q_UNUSED(node);
+}
+
+void WriteInitialization::acceptTabStops(DomTabStops *tabStops)
+{
+    QString lastName;
+
+    const QStringList l = tabStops->elementTabStop();
+    for (int i=0; i<l.size(); ++i) {
+        const QString name = l.at(i);
+
+        if (!m_registeredWidgets.contains(name)) {
+            fprintf(stderr, "'%s' isn't a valid widget\n", name.toLatin1().data());
+            continue;
+        }
+
+        if (i == 0) {
+            lastName = name;
+            continue;
+        } else if (name.isEmpty() || lastName.isEmpty()) {
+            continue;
+        }
+
+        m_output << m_option.indent << "qt.gui.QWidget.setTabOrder(" << lastName << ", " << name << ");\n";
+
+        lastName = name;
+    }
+}
+
+void WriteInitialization::initializeQ3ListBox(DomWidget *w)
+{
+    const QString varName = m_driver->findOrInsertWidget(w);
+    const QString className = w->attributeClass();
+
+    const QList<DomItem*> items = w->elementItem();
+
+    if (items.isEmpty())
+        return;
+
+    m_refreshOut << m_option.indent << varName << ".clear();\n";
+
+    for (int i=0; i<items.size(); ++i) {
+        const DomItem *item = items.at(i);
+
+        const DomPropertyMap properties = propertyMap(item->elementProperty());
+        const DomProperty *text = properties.value(QLatin1String("text"));
+        const DomProperty *pixmap = properties.value(QLatin1String("pixmap"));
+        if (!(text || pixmap))
+            continue;
+
+        m_refreshOut << m_option.indent << varName << ".insertItem(";
+        if (pixmap) {
+            m_refreshOut << pixCall(pixmap);
+
+            if (text)
+                m_refreshOut << ", ";
+        }
+        if (text)
+            m_refreshOut << trCall(text->elementString());
+        m_refreshOut << ");\n";
+    }
+}
+
+void WriteInitialization::initializeQ3IconView(DomWidget *w)
+{
+    const QString varName = m_driver->findOrInsertWidget(w);
+    const QString className = w->attributeClass();
+
+    const QList<DomItem*> items = w->elementItem();
+
+    if (items.isEmpty())
+        return;
+
+    m_refreshOut << m_option.indent << varName << ".clear();\n";
+
+    for (int i=0; i<items.size(); ++i) {
+        const DomItem *item = items.at(i);
+
+        const DomPropertyMap properties = propertyMap(item->elementProperty());
+        const DomProperty *text = properties.value(QLatin1String("text"));
+        const DomProperty *pixmap = properties.value(QLatin1String("pixmap"));
+        if (!(text || pixmap))
+            continue;
+
+        const QString itemName = m_driver->unique(QLatin1String("__item"));
+        m_refreshOut << "\n";
+        m_refreshOut << m_option.indent << "Q3IconViewItem *" << itemName << " = new Q3IconViewItem(" << varName << ");\n";
+
+        if (pixmap) {
+            m_refreshOut << m_option.indent << itemName << ".setPixmap(" << pixCall(pixmap) << ");\n";
+        }
+
+        if (text) {
+            m_refreshOut << m_option.indent << itemName << ".setText(" << trCall(text->elementString()) << ");\n";
+        }
+    }
+}
+
+void WriteInitialization::initializeQ3ListView(DomWidget *w)
+{
+    const QString varName = m_driver->findOrInsertWidget(w);
+    const QString className = w->attributeClass();
+
+    // columns
+    const QList<DomColumn*> columns = w->elementColumn();
+    for (int i=0; i<columns.size(); ++i) {
+        const DomColumn *column = columns.at(i);
+
+        const DomPropertyMap properties = propertyMap(column->elementProperty());
+        const DomProperty *text = properties.value(QLatin1String("text"));
+        const DomProperty *pixmap = properties.value(QLatin1String("pixmap"));
+        const DomProperty *clickable = properties.value(QLatin1String("clickable"));
+        const DomProperty *resizable = properties.value(QLatin1String("resizable"));
+
+        const QString txt = trCall(text->elementString());
+        m_output << m_option.indent << varName << ".addColumn(" << txt << ");\n";
+        m_refreshOut << m_option.indent << varName << ".header()->setLabel(" << i << ", " << txt << ");\n";
+
+        if (pixmap) {
+            m_output << m_option.indent << varName << ".header()->setLabel("
+                   << varName << ".header()->count() - 1, " << pixCall(pixmap) << ", " << txt << ");\n";
+        }
+
+        if (clickable != 0) {
+            m_output << m_option.indent << varName << ".header()->setClickEnabled(" << clickable->elementBool() << ", " << varName << ".header()->count() - 1);\n";
+        }
+
+        if (resizable != 0) {
+            m_output << m_option.indent << varName << ".header()->setResizeEnabled(" << resizable->elementBool() << ", " << varName << ".header()->count() - 1);\n";
+        }
+    }
+
+    if (w->elementItem().size()) {
+        m_refreshOut << m_option.indent << varName << ".clear();\n";
+
+        initializeQ3ListViewItems(className, varName, w->elementItem());
+    }
+}
+
+void WriteInitialization::initializeQ3ListViewItems(const QString &className, const QString &varName, const QList<DomItem *> &items)
+{
+    if (items.isEmpty())
+        return;
+
+    // items
+    for (int i=0; i<items.size(); ++i) {
+        const DomItem *item = items.at(i);
+
+        const QString itemName = m_driver->unique(QLatin1String("__item"));
+        m_refreshOut << "\n";
+        m_refreshOut << m_option.indent << "Q3ListViewItem *" << itemName << " = new Q3ListViewItem(" << varName << ");\n";
+
+        int textCount = 0, pixCount = 0;
+        const DomPropertyList properties = item->elementProperty();
+        for (int i=0; i<properties.size(); ++i) {
+            const DomProperty *p = properties.at(i);
+            if (p->attributeName() == QLatin1String("text"))
+                m_refreshOut << m_option.indent << itemName << ".setText(" << textCount++ << ", "
+                           << trCall(p->elementString()) << ");\n";
+
+            if (p->attributeName() == QLatin1String("pixmap"))
+                m_refreshOut << m_option.indent << itemName << ".setPixmap(" << pixCount++ << ", "
+                           << pixCall(p) << ");\n";
+        }
+
+        if (item->elementItem().size()) {
+            m_refreshOut << m_option.indent << itemName << ".setOpen(true);\n";
+            initializeQ3ListViewItems(className, itemName, item->elementItem());
+        }
+    }
+}
+
+
+void WriteInitialization::initializeQ3Table(DomWidget *w)
+{
+    const QString varName = m_driver->findOrInsertWidget(w);
+    const QString className = w->attributeClass();
+
+    // columns
+    const QList<DomColumn*> columns = w->elementColumn();
+
+    for (int i=0; i<columns.size(); ++i) {
+        const DomColumn *column = columns.at(i);
+
+        const DomPropertyMap properties = propertyMap(column->elementProperty());
+        const DomProperty *text = properties.value(QLatin1String("text"));
+        const DomProperty *pixmap = properties.value(QLatin1String("pixmap"));
+
+        m_refreshOut << m_option.indent << varName << ".horizontalHeader()->setLabel(" << i << ", ";
+        if (pixmap) {
+            m_refreshOut << pixCall(pixmap) << ", ";
+        }
+        m_refreshOut << trCall(text->elementString()) << ");\n";
+    }
+
+    // rows
+    const QList<DomRow*> rows = w->elementRow();
+    for (int i=0; i<rows.size(); ++i) {
+        const DomRow *row = rows.at(i);
+
+        const DomPropertyMap properties = propertyMap(row->elementProperty());
+        const DomProperty *text = properties.value(QLatin1String("text"));
+        const DomProperty *pixmap = properties.value(QLatin1String("pixmap"));
+
+        m_refreshOut << m_option.indent << varName << ".verticalHeader()->setLabel(" << i << ", ";
+        if (pixmap) {
+            m_refreshOut << pixCall(pixmap) << ", ";
+        }
+        m_refreshOut << trCall(text->elementString()) << ");\n";
+    }
+
+
+    //initializeQ3TableItems(className, varName, w->elementItem());
+}
+
+void WriteInitialization::initializeQ3TableItems(const QString &className, const QString &varName, const QList<DomItem *> &items)
+{
+    Q_UNUSED(className);
+    Q_UNUSED(varName);
+    Q_UNUSED(items);
+}
+
+QString WriteInitialization::iconCall(const DomProperty *icon)
+{
+    if (icon->kind() == DomProperty::IconSet)
+        return writeIconProperties(icon->elementIconSet());
+    return pixCall(icon);
+}
+
+QString WriteInitialization::pixCall(const DomProperty *p) const
+{
+    QString type, s;
+    switch (p->kind()) {
+    case DomProperty::IconSet:
+        type = QLatin1String("QIcon");
+        s = p->elementIconSet()->text();
+        break;
+    case DomProperty::Pixmap:
+        type = QLatin1String("QPixmap");
+        s = p->elementPixmap()->text();
+        break;
+    default:
+        qWarning() << "Warning: Unknown icon format encountered. The ui-file was generated with a too-recent version of Designer.";
+        return QLatin1String("QIcon()");
+        break;
+    }
+    return pixCall(type, s);
+}
+
+QString WriteInitialization::pixCall(const QString &t, const QString &text) const
+{
+    QString type = t;
+    if (text.isEmpty()) {
+        type += QLatin1String("()");
+        return type;
+    }
+    if (const DomImage *image = findImage(text)) {
+        if (m_option.extractImages) {
+            const QString format = image->elementData()->attributeFormat();
+            const QString extension = format.left(format.indexOf(QLatin1Char('.'))).toLower();
+            QString rc = QLatin1String("qt.gui.QPixmap(qt.core.QString.fromUtf8(\":/");
+            rc += m_generatedClass;
+            rc += QLatin1String("/images/");
+            rc += text;
+            rc += QLatin1Char('.');
+            rc += extension;
+            rc += QLatin1String("\"))");
+            return rc;
+        }
+        QString rc = WriteIconInitialization::iconFromDataFunction();
+        rc += QLatin1Char('(');
+        rc += text;
+        rc += QLatin1String("_ID)");
+        return rc;
+    }
+
+    QString pixFunc = m_uic->pixmapFunction();
+    if (pixFunc.isEmpty())
+        pixFunc = QLatin1String("qt.core.QString.fromUtf8");
+
+    type += QLatin1Char('(');
+    type += pixFunc;
+    type += QLatin1Char('(');
+    type += fixString(text, m_option.indent);
+    type += QLatin1String("))");
+    return type;
+}
+
+void WriteInitialization::initializeComboBox(DomWidget *w)
+{
+    const QString varName = m_driver->findOrInsertWidget(w);
+    const QString className = w->attributeClass();
+
+    const QList<DomItem*> items = w->elementItem();
+
+    if (items.isEmpty())
+        return;
+
+    // If possible use qcombobox's addItems() which is much faster then a bunch of addItem() calls
+    bool noIcons = true;
+    QStringList list;
+    for (int i=0; i<items.size(); ++i) {
+        const DomItem *item = items.at(i);
+        const DomPropertyMap properties = propertyMap(item->elementProperty());
+        const DomProperty *text = properties.value(QLatin1String("text"));
+        const DomProperty *pixmap = properties.value(QLatin1String("icon"));
+        if (pixmap != 0) {
+            noIcons = false;
+            break;
+        }
+        list.append(trCall(text->elementString()));
+    }
+
+    if (noIcons) {
+        m_refreshOut << m_option.indent << varName << ".clear();\n";
+        m_refreshOut << m_option.indent << varName << ".insertItems(0, QStringList()" << '\n';
+        for (int i = 0; i < list.size(); ++i)
+            m_refreshOut << m_option.indent << " << " << list.at(i) << "\n";
+        m_refreshOut << m_option.indent << ");\n";
+    } else {
+        for (int i = 0; i < items.size(); ++i) {
+            const DomItem *item = items.at(i);
+            const DomPropertyMap properties = propertyMap(item->elementProperty());
+            const DomProperty *text = properties.value(QLatin1String("text"));
+            const DomProperty *icon = properties.value(QLatin1String("icon"));
+
+            QString iconValue;
+            if (icon)
+                iconValue = iconCall(icon);
+
+            m_output << m_option.indent << varName << ".addItem(";
+            if (icon)
+                m_output << iconValue << ", ";
+            m_output << "QString());\n";
+
+            if (!toString(text->elementString()).isEmpty())
+                m_refreshOut << m_option.indent << varName << ".setItemText(" << i << ", " << trCall(text->elementString()) << ");\n";
+        }
+        m_refreshOut << "\n";
+    }
+}
+
+QString WriteInitialization::disableSorting(DomWidget *w, const QString &varName)
+{
+    // turn off sortingEnabled to force programmatic item order (setItem())
+    QString tempName;
+    if (!w->elementItem().isEmpty()) {
+        tempName = m_driver->unique(QLatin1String("__sortingEnabled"));
+        m_refreshOut << "\n";
+        m_refreshOut << m_option.indent << "const bool " << tempName
+            << " = " << varName << ".isSortingEnabled();\n";
+        m_refreshOut << m_option.indent << varName << ".setSortingEnabled(false);\n";
+    }
+    return tempName;
+}
+
+void WriteInitialization::enableSorting(DomWidget *w, const QString &varName, const QString &tempName)
+{
+    if (!w->elementItem().isEmpty()) {
+        m_refreshOut << "\n";
+        m_refreshOut << m_option.indent << varName << ".setSortingEnabled(" << tempName << ");\n";
+    }
+}
+
+void WriteInitialization::initializeListWidget(DomWidget *w)
+{
+    const QString varName = m_driver->findOrInsertWidget(w);
+    const QString className = w->attributeClass();
+
+    const QList<DomItem*> items = w->elementItem();
+
+    if (items.isEmpty())
+        return;
+
+    QString tempName = disableSorting(w, varName);
+    // items
+    for (int i = 0; i < items.size(); ++i) {
+        const DomItem *item = items.at(i);
+
+        const DomPropertyMap properties = propertyMap(item->elementProperty());
+        const DomProperty *text = properties.value(QLatin1String("text"));
+        const DomProperty *icon = properties.value(QLatin1String("icon"));
+
+        QString itemCreation = QLatin1String("new QListWidgetItem(") + varName + QLatin1String(");\n");
+        if (icon) {
+            const QString iconValue = iconCall(icon);
+            const QString itemName = m_driver->unique(QLatin1String("__listItem"));
+            m_output << m_option.indent << "QListWidgetItem *" << itemName << " = " << itemCreation;
+            m_output << m_option.indent << itemName << ".setIcon(" << iconValue << ");\n";
+        } else {
+            m_output << m_option.indent << itemCreation;
+        }
+
+        if (!toString(text->elementString()).isEmpty()) {
+            m_refreshOut << m_option.indent << varName << ".item(" << i << ")->setText(" << trCall(text->elementString()) << ");\n";
+        }
+    }
+    enableSorting(w, varName, tempName);
+}
+
+void WriteInitialization::initializeTreeWidget(DomWidget *w)
+{
+    const QString varName = m_driver->findOrInsertWidget(w);
+    const QString className = w->attributeClass();
+
+    // columns
+    const QList<DomColumn*> columns = w->elementColumn();
+    for (int i = 0; i < columns.size(); ++i) {
+        const DomColumn *column = columns.at(i);
+
+        const DomPropertyMap properties = propertyMap(column->elementProperty());
+        const DomProperty *text = properties.value(QLatin1String("text"));
+        const DomProperty *icon = properties.value(QLatin1String("icon"));
+
+        if (!toString(text->elementString()).isEmpty()) {
+            const QString txt = trCall(text->elementString());
+            m_refreshOut << m_option.indent << varName << ".headerItem()->setText(" << i << ", " << txt << ");\n";
+        }
+
+        if (icon) {
+            const QString iconValue = iconCall(icon);
+            m_output << m_option.indent << varName << ".headerItem()->setIcon("
+                   << i << ", " << iconValue << ");\n";
+        }
+    }
+
+    if (w->elementItem().size()) {
+        QString tempName = disableSorting(w, varName);
+
+        initializeTreeWidgetItems(className, varName, w->elementItem(), varName + QLatin1String(".topLevelItem("));
+
+        enableSorting(w, varName, tempName);
+    }
+}
+
+void WriteInitialization::initializeTreeWidgetItems(const QString &className, const QString &varName, const QList<DomItem *> &items, const QString &parentPath)
+{
+    if (items.isEmpty())
+        return;
+
+    // items
+    for (int i = 0; i < items.size(); ++i) {
+        const DomItem *item = items.at(i);
+
+        int textCount = 0;
+        const DomPropertyList properties = item->elementProperty();
+        QStringList icons;
+        for (int j = 0; j < properties.size(); ++j) {
+            const DomProperty *p = properties.at(j);
+            if (p->attributeName() == QLatin1String("text")) {
+                if (!toString(p->elementString()).isEmpty()) {
+                    m_refreshOut << m_option.indent << parentPath << i << ")->setText(" << textCount << ", "
+                        << trCall(p->elementString()) << ");\n";
+                }
+                textCount++;
+            }
+
+            if (p->attributeName() == QLatin1String("icon")) {
+                const QString iconValue = iconCall(p);
+                icons << QLatin1String(".setIcon(")
+                       + QString::number(textCount - 1)
+                       + QLatin1String(", ") + iconValue + QLatin1String(");\n");
+            }
+        }
+        if (icons.isEmpty() && (item->elementItem().size() == 0)) {
+            m_output << m_option.indent << "new QTreeWidgetItem(" << varName << ");\n";
+        } else {
+            const QString itemName = m_driver->unique(QLatin1String("__treeItem"));
+            m_output << m_option.indent << "QTreeWidgetItem *" << itemName << " = new QTreeWidgetItem(" << varName << ");\n";
+
+            QStringListIterator it(icons);
+            while (it.hasNext())
+                m_output << m_option.indent << itemName << it.next();
+
+            if (item->elementItem().size()) {
+                const QString childPath = parentPath + QString::number(i) + QLatin1String(")->child(");
+                initializeTreeWidgetItems(className, itemName, item->elementItem(), childPath);
+            }
+        }
+
+    }
+    m_output << "\n";
+}
+
+void WriteInitialization::initializeTableWidget(DomWidget *w)
+{
+    const QString varName = m_driver->findOrInsertWidget(w);
+    const QString className = w->attributeClass();
+
+    // columns
+    const QList<DomColumn *> columns = w->elementColumn();
+
+    if (columns.size() != 0) {
+        m_output << m_option.indent << "if (" << varName << ".columnCount() < " << columns.size() << ")\n"
+            << m_option.indent << m_option.indent << varName << ".setColumnCount(" << columns.size() << ");\n";
+    }
+
+    for (int i = 0; i < columns.size(); ++i) {
+        const DomColumn *column = columns.at(i);
+
+        const DomPropertyMap properties = propertyMap(column->elementProperty());
+        const DomProperty *text = properties.value(QLatin1String("text"));
+        const DomProperty *icon = properties.value(QLatin1String("icon"));
+        if (text || icon) {
+            const QString itemName = m_driver->unique(QLatin1String("__colItem"));
+            m_output << m_option.indent << "QTableWidgetItem *"
+                           << itemName << " = new QTableWidgetItem();\n";
+
+            if (text && text->attributeName() == QLatin1String("text") && !toString(text->elementString()).isEmpty())
+                m_refreshOut << m_option.indent << varName << ".horizontalHeaderItem(" << i << ")->setText("
+                           << trCall(text->elementString()) << ");\n";
+
+            if (icon && icon->attributeName() == QLatin1String("icon")) {
+                const QString iconValue = iconCall(icon);
+                m_output << m_option.indent << itemName << ".setIcon("
+                           << iconValue << ");\n";
+            }
+            m_output << m_option.indent << varName << ".setHorizontalHeaderItem("
+                           << i << ", " << itemName << ");\n";
+        }
+    }
+
+    // rows
+    const QList<DomRow *> rows = w->elementRow();
+
+    if (rows.size() != 0) {
+        m_output << m_option.indent << "if (" << varName << ".rowCount() < " << rows.size() << ")\n"
+            << m_option.indent << m_option.indent << varName << ".setRowCount(" << rows.size() << ");\n";
+    }
+
+    for (int i = 0; i < rows.size(); ++i) {
+        const DomRow *row = rows.at(i);
+
+        const DomPropertyMap properties = propertyMap(row->elementProperty());
+        const DomProperty *text = properties.value(QLatin1String("text"));
+        const DomProperty *icon = properties.value(QLatin1String("icon"));
+        if (text || icon) {
+            const QString itemName = m_driver->unique(QLatin1String("__rowItem"));
+            m_output << m_option.indent << "QTableWidgetItem *"
+                           << itemName << " = new QTableWidgetItem();\n";
+
+            if (text && text->attributeName() == QLatin1String("text") && !toString(text->elementString()).isEmpty())
+                m_refreshOut << m_option.indent << varName << ".verticalHeaderItem(" << i << ")->setText("
+                           << trCall(text->elementString()) << ");\n";
+
+            if (icon && icon->attributeName() == QLatin1String("icon")) {
+                const QString iconValue = iconCall(icon);
+                m_output << m_option.indent << itemName << ".setIcon("
+                           << iconValue << ");\n";
+            }
+            m_output << m_option.indent << varName << ".setVerticalHeaderItem("
+                           << i << ", " << itemName << ");\n";
+        }
+    }
+
+    // items
+    QString tempName = disableSorting(w, varName);
+
+    const QList<DomItem *> items = w->elementItem();
+    for (int i = 0; i < items.size(); ++i) {
+        const DomItem *item = items.at(i);
+        if (item->hasAttributeRow() && item->hasAttributeColumn()) {
+            const DomPropertyMap properties = propertyMap(item->elementProperty());
+            const DomProperty *text = properties.value(QLatin1String("text"));
+            const DomProperty *icon = properties.value(QLatin1String("icon"));
+            if (text || icon) {
+                const QString itemName = m_driver->unique(QLatin1String("__tableItem"));
+                m_output << m_option.indent << "QTableWidgetItem *"
+                    << itemName << " = new QTableWidgetItem();\n";
+
+                if (text && text->attributeName() == QLatin1String("text") && !toString(text->elementString()).isEmpty())
+                    m_refreshOut << m_option.indent << varName << ".item(" << item->attributeRow()
+                        << ", " << item->attributeColumn() << ")->setText("
+                        << trCall(text->elementString()) << ");\n";
+
+                if (icon && icon->attributeName() == QLatin1String("icon")) {
+                    const QString iconValue = iconCall(icon);
+                    m_output << m_option.indent << itemName << ".setIcon("
+                        << iconValue << ");\n";
+                }
+
+                m_output << m_option.indent << varName << ".setItem("
+                    << item->attributeRow() << ", "
+                    << item->attributeColumn() << ", "
+                    << itemName << ");\n";
+            }
+        }
+    }
+    enableSorting(w, varName, tempName);
+}
+
+QString WriteInitialization::trCall(const QString &str, const QString &commentHint) const
+{
+    if (str.isEmpty())
+        return QLatin1String("QString()");
+
+    QString result;
+    const QString comment = commentHint.isEmpty() ? QString(QLatin1Char('0')) : fixString(commentHint, m_option.indent);
+
+    if (m_option.translateFunction.isEmpty()) {
+        result = QLatin1String("qt.gui.QApplication.translate(\"");
+        result += m_generatedClass;
+        result += QLatin1Char('"');
+        result += QLatin1String(", ");
+    } else {
+        result = m_option.translateFunction;
+        result += QLatin1Char('(');
+    }
+
+    result += fixString(str, m_option.indent);
+    result += QLatin1String(", ");
+    result += comment;
+
+    if (m_option.translateFunction.isEmpty()) {
+        result += QLatin1String(", ");
+        result += QLatin1String("qt.gui.QApplication.UnicodeUTF8");
+    }
+
+    result += QLatin1Char(')');
+    return result;
+}
+
+void WriteInitialization::initializeQ3SqlDataTable(DomWidget *w)
+{
+    const DomPropertyMap properties = propertyMap(w->elementProperty());
+
+    const DomProperty *frameworkCode = properties.value(QLatin1String("frameworkCode"), 0);
+    if (frameworkCode && toBool(frameworkCode->elementBool()) == false)
+        return;
+
+    QString connection;
+    QString table;
+    QString field;
+
+    const DomProperty *db = properties.value(QLatin1String("database"), 0);
+    if (db && db->elementStringList()) {
+        const QStringList info = db->elementStringList()->elementString();
+        connection = info.size() > 0 ? info.at(0) : QString();
+        table = info.size() > 1 ? info.at(1) : QString();
+        field = info.size() > 2 ? info.at(2) : QString();
+    }
+
+    if (table.isEmpty() || connection.isEmpty()) {
+        fprintf(stderr, "invalid database connection\n");
+        return;
+    }
+
+   const QString varName = m_driver->findOrInsertWidget(w);
+
+    m_output << m_option.indent << "if (!" << varName << ".sqlCursor()) {\n";
+
+    m_output << m_option.indent << m_option.indent << varName << ".setSqlCursor(";
+
+    if (connection == QLatin1String("(default)")) {
+        m_output << "new Q3SqlCursor(" << fixString(table, m_option.indent) << "), false, true);\n";
+    } else {
+        m_output << "new Q3SqlCursor(" << fixString(table, m_option.indent) << ", true, " << connection << "Connection" << "), false, true);\n";
+    }
+    m_output << m_option.indent << m_option.indent << varName << ".refresh(qt.qt3support.Q3DataTable.RefreshAll);\n";
+    m_output << m_option.indent << "}\n";
+}
+
+void WriteInitialization::initializeQ3SqlDataBrowser(DomWidget *w)
+{
+    const DomPropertyMap properties = propertyMap(w->elementProperty());
+
+    const DomProperty *frameworkCode = properties.value(QLatin1String("frameworkCode"), 0);
+    if (frameworkCode && toBool(frameworkCode->elementBool()) == false)
+        return;
+
+    QString connection;
+    QString table;
+    QString field;
+
+    const DomProperty *db = properties.value(QLatin1String("database"), 0);
+    if (db && db->elementStringList()) {
+        const QStringList info = db->elementStringList()->elementString();
+        connection = info.size() > 0 ? info.at(0) : QString();
+        table = info.size() > 1 ? info.at(1) : QString();
+        field = info.size() > 2 ? info.at(2) : QString();
+    }
+
+    if (table.isEmpty() || connection.isEmpty()) {
+        fprintf(stderr, "invalid database connection\n");
+        return;
+    }
+
+    const QString varName = m_driver->findOrInsertWidget(w);
+
+    m_output << m_option.indent << "if (!" << varName << ".sqlCursor()) {\n";
+
+    m_output << m_option.indent << m_option.indent << varName << ".setSqlCursor(";
+
+    if (connection == QLatin1String("(default)")) {
+        m_output << "new Q3SqlCursor(" << fixString(table, m_option.indent) << "), true);\n";
+    } else {
+        m_output << "new Q3SqlCursor(" << fixString(table, m_option.indent) << ", true, " << connection << "Connection" << "), false, true);\n";
+    }
+    m_output << m_option.indent << m_option.indent << varName << ".refresh();\n";
+    m_output << m_option.indent << "}\n";
+}
+
+void WriteInitialization::initializeMenu(DomWidget *w, const QString &/*parentWidget*/)
+{
+    const QString menuName = m_driver->findOrInsertWidget(w);
+    const QString menuAction = menuName + QLatin1String("Action");
+
+    const DomAction *action = m_driver->actionByName(menuAction);
+    if (action && action->hasAttributeMenu()) {
+        m_output << m_option.indent << menuAction << " = " << menuName << ".menuAction();\n";
+    }
+}
+
+QString WriteInitialization::trCall(DomString *str) const
+{
+    return trCall(toString(str), str->attributeComment());
+}
+
+bool WriteInitialization::isValidObject(const QString &name) const
+{
+    return m_registeredWidgets.contains(name)
+        || m_registeredActions.contains(name);
+}
+
+QString WriteInitialization::findDeclaration(const QString &name)
+{
+    const QString normalized = Driver::normalizedName(name);
+
+    if (DomWidget *widget = m_driver->widgetByName(normalized))
+        return m_driver->findOrInsertWidget(widget);
+    else if (DomAction *action = m_driver->actionByName(normalized))
+        return m_driver->findOrInsertAction(action);
+
+    return QString();
+}
+
+void WriteInitialization::acceptConnection(DomConnection *connection)
+{
+    const QString sender = findDeclaration(connection->elementSender());
+    const QString receiver = findDeclaration(connection->elementReceiver());
+
+    if (sender.isEmpty() || receiver.isEmpty())
+        return;
+
+    m_output << m_option.indent << "QObject.connect("
+        << sender
+        << ", "
+        << "SIGNAL(" << connection->elementSignal() << ')'
+        << ", "
+        << receiver
+        << ", "
+        << "SLOT(" << connection->elementSlot() << ')'
+        << ");\n";
+}
+
+DomImage *WriteInitialization::findImage(const QString &name) const
+{
+    return m_registeredImages.value(name);
+}
+
+DomWidget *WriteInitialization::findWidget(const QString &widgetClass)
+{
+    for (int i = m_widgetChain.count() - 1; i >= 0; --i) {
+        DomWidget *widget = m_widgetChain.at(i);
+
+        if (widget && m_uic->customWidgetsInfo()->extends(widget->attributeClass(), widgetClass))
+            return widget;
+    }
+
+    return 0;
+}
+
+void WriteInitialization::acceptImage(DomImage *image)
+{
+    if (!image->hasAttributeName())
+        return;
+
+    m_registeredImages.insert(image->attributeName(), image);
+}
+
+void WriteInitialization::acceptWidgetScripts(const DomScripts &widgetScripts, DomWidget *node, const  DomWidgets &childWidgets)
+{
+    // Add the per-class custom scripts to the per-widget ones.
+    DomScripts scripts(widgetScripts);
+
+    if (DomScript *customWidgetScript = m_uic->customWidgetsInfo()->customWidgetScript(node->attributeClass()))
+        scripts.push_front(customWidgetScript);
+
+    if (scripts.empty())
+        return;
+
+    // concatenate script snippets
+    QString script;
+    foreach (const DomScript *domScript, scripts) {
+        const QString snippet = domScript->text();
+        if (!snippet.isEmpty()) {
+            script += snippet.trimmed();
+            script += QLatin1Char('\n');
+        }
+    }
+    if (script.isEmpty())
+        return;
+
+    // Build the list of children and insert call
+    m_output << m_option.indent << "childWidgets.clear();\n";
+    if (!childWidgets.empty()) {
+        m_output << m_option.indent <<  "childWidgets";
+        foreach (DomWidget *child, childWidgets) {
+            m_output << " << " << m_driver->findOrInsertWidget(child);
+        }
+        m_output << ";\n";
+    }
+    m_output << m_option.indent << "scriptContext.run(qt.core.QString.fromUtf8("
+             << fixString(script, m_option.indent) << "), "
+             << m_driver->findOrInsertWidget(node) << ", childWidgets);\n";
+}
+
+} // namespace D
+
+QT_END_NAMESPACE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/duic/d/dwriteinitialization.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,304 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+** exception, Nokia gives you certain additional rights. These rights
+** are described in the Nokia Qt GPL Exception version 1.3, included in
+** the file GPL_EXCEPTION.txt in this package.
+**
+** Qt for Windows(R) Licensees
+** As a special exception, Nokia, as the sole copyright holder for Qt
+** Designer, grants users of the Qt/Eclipse Integration plug-in the
+** right for the Qt/Eclipse Integration to link to functionality
+** provided by Qt Designer and its related libraries.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+****************************************************************************/
+
+#ifndef DWRITEINITIALIZATION_H
+#define DWRITEINITIALIZATION_H
+
+#include "treewalker.h"
+#include <QtCore/QPair>
+#include <QtCore/QHash>
+#include <QtCore/QMap>
+#include <QtCore/QStack>
+#include <QtCore/QTextStream>
+
+QT_BEGIN_NAMESPACE
+
+class Driver;
+class Uic;
+class DomBrush;
+class DomFont;
+class DomResourceIcon;
+class DomSizePolicy;
+struct Option;
+
+namespace D {
+    // Handle for a flat DOM font to get comparison functionality required for maps
+    class FontHandle {
+    public:
+        FontHandle(const DomFont *domFont);
+        int compare(const FontHandle &) const;
+    private:
+        const DomFont *m_domFont;
+#if defined(Q_OS_MAC) && defined(Q_CC_GNU) && (__GNUC__ == 3 && __GNUC_MINOR__ == 3)
+        friend uint qHash(const FontHandle &);
+#endif
+    };
+    inline bool operator ==(const FontHandle &f1, const FontHandle &f2) { return f1.compare(f2) == 0; }
+    inline bool operator  <(const FontHandle &f1, const FontHandle &f2) { return f1.compare(f2) < 0; }
+
+    // Handle for a flat DOM icon to get comparison functionality required for maps
+    class IconHandle {
+    public:
+        IconHandle(const DomResourceIcon *domIcon);
+        int compare(const IconHandle &) const;
+    private:
+        const DomResourceIcon *m_domIcon;
+#if defined(Q_OS_MAC) && defined(Q_CC_GNU) && (__GNUC__ == 3 && __GNUC_MINOR__ == 3)
+        friend uint qHash(const IconHandle &);
+#endif
+    };
+    inline bool operator ==(const IconHandle &i1, const IconHandle &i2) { return i1.compare(i2) == 0; }
+    inline bool operator  <(const IconHandle &i1, const IconHandle &i2) { return i1.compare(i2) < 0; }
+
+    // Handle for a flat DOM size policy to get comparison functionality required for maps
+    class SizePolicyHandle {
+    public:
+        SizePolicyHandle(const DomSizePolicy *domSizePolicy);
+        int compare(const SizePolicyHandle &) const;
+    private:
+        const DomSizePolicy *m_domSizePolicy;
+#if defined(Q_OS_MAC) && defined(Q_CC_GNU) && (__GNUC__ == 3 && __GNUC_MINOR__ == 3)
+        friend uint qHash(const SizePolicyHandle &);
+#endif
+    };
+    inline bool operator ==(const SizePolicyHandle &f1, const SizePolicyHandle &f2) { return f1.compare(f2) == 0; }
+#if !(defined(Q_OS_MAC) && defined(Q_CC_GNU) && (__GNUC__ == 3 && __GNUC_MINOR__ == 3))
+    inline bool operator  <(const SizePolicyHandle &f1, const SizePolicyHandle &f2) { return f1.compare(f2) < 0; }
+#endif
+
+
+
+struct WriteInitialization : public TreeWalker
+{
+    typedef QList<DomProperty*> DomPropertyList;
+    typedef QHash<QString, DomProperty*> DomPropertyMap;
+
+    WriteInitialization(Uic *uic, bool activateScripts);
+
+//
+// widgets
+//
+    void acceptUI(DomUI *node);
+    void acceptWidget(DomWidget *node);
+    void acceptWidgetScripts(const DomScripts &, DomWidget *node, const  DomWidgets &childWidgets);
+
+    void acceptLayout(DomLayout *node);
+    void acceptSpacer(DomSpacer *node);
+    void acceptLayoutItem(DomLayoutItem *node);
+
+//
+// actions
+//
+    void acceptActionGroup(DomActionGroup *node);
+    void acceptAction(DomAction *node);
+    void acceptActionRef(DomActionRef *node);
+
+//
+// tab stops
+//
+    void acceptTabStops(DomTabStops *tabStops);
+
+//
+// custom widgets
+//
+    void acceptCustomWidgets(DomCustomWidgets *node);
+    void acceptCustomWidget(DomCustomWidget *node);
+
+//
+// layout defaults/functions
+//
+    void acceptLayoutDefault(DomLayoutDefault *node)   { m_LayoutDefaultHandler.acceptLayoutDefault(node); }
+    void acceptLayoutFunction(DomLayoutFunction *node) { m_LayoutDefaultHandler.acceptLayoutFunction(node); }
+
+//
+// signal/slot connections
+//
+    void acceptConnection(DomConnection *connection);
+
+//
+// images
+//
+    void acceptImage(DomImage *image);
+
+    enum {
+        Use43UiFile = 0,
+        TopLevelMargin,
+        ChildMargin,
+        SubLayoutMargin
+    };
+
+private:
+    static QString domColor2QString(const DomColor *c);
+
+    QString iconCall(const DomProperty *prop);
+    QString pixCall(const DomProperty *prop) const;
+    QString pixCall(const QString &type, const QString &text) const;
+    QString trCall(const QString &str, const QString &comment = QString()) const;
+    QString trCall(DomString *str) const;
+
+    enum { WritePropertyIgnoreMargin = 1, WritePropertyIgnoreSpacing = 2 };
+    void writeProperties(const QString &varName, const QString &className, const DomPropertyList &lst, unsigned flags = 0);
+    void writeColorGroup(DomColorGroup *colorGroup, const QString &group, const QString &paletteName);
+    void writeBrush(const DomBrush *brush, const QString &brushName);
+
+//
+// special initialization
+//
+    void initializeMenu(DomWidget *w, const QString &parentWidget);
+    void initializeComboBox(DomWidget *w);
+    void initializeListWidget(DomWidget *w);
+    void initializeTreeWidget(DomWidget *w);
+    void initializeTreeWidgetItems(const QString &className, const QString &varName, const QList<DomItem *> &items, const QString &parentPath);
+    void initializeTableWidget(DomWidget *w);
+
+    QString disableSorting(DomWidget *w, const QString &varName);
+    void enableSorting(DomWidget *w, const QString &varName, const QString &tempName);
+
+//
+// special initialization for the Q3 support classes
+//
+    void initializeQ3ListBox(DomWidget *w);
+    void initializeQ3IconView(DomWidget *w);
+    void initializeQ3ListView(DomWidget *w);
+    void initializeQ3ListViewItems(const QString &className, const QString &varName, const QList<DomItem*> &items);
+    void initializeQ3Table(DomWidget *w);
+    void initializeQ3TableItems(const QString &className, const QString &varName, const QList<DomItem*> &items);
+
+//
+// Sql
+//
+    void initializeQ3SqlDataTable(DomWidget *w);
+    void initializeQ3SqlDataBrowser(DomWidget *w);
+
+    QString findDeclaration(const QString &name);
+    DomWidget *findWidget(const QString &widgetClass);
+    DomImage *findImage(const QString &name) const;
+
+    bool isValidObject(const QString &name) const;
+
+private:
+    QString writeFontProperties(const DomFont *f);
+    QString writeIconProperties(const DomResourceIcon *i);
+    QString writeSizePolicy(const DomSizePolicy *sp);
+    QString writeBrushInitialization(const DomBrush *brush);
+
+    const Uic *m_uic;
+    Driver *m_driver;
+    QTextStream &m_output;
+    const Option &m_option;
+    bool m_stdsetdef;
+
+    struct Buddy
+    {
+        Buddy(const QString &oN, const QString &b)
+            : objName(oN), buddy(b) {}
+        QString objName;
+        QString buddy;
+    };
+
+    QStack<DomWidget*> m_widgetChain;
+    QStack<DomLayout*> m_layoutChain;
+    QStack<DomActionGroup*> m_actionGroupChain;
+    QList<Buddy> m_buddies;
+
+    QHash<QString, QString> m_buttonGroups;
+    QHash<QString, DomWidget*> m_registeredWidgets;
+    QHash<QString, DomImage*> m_registeredImages;
+    QHash<QString, DomAction*> m_registeredActions;
+    typedef QHash<uint, QString> ColorBrushHash;
+    ColorBrushHash m_colorBrushHash;
+    // Map from font properties to  font variable name for reuse
+    // Map from size policy to  variable for reuse
+#if defined(Q_OS_MAC) && defined(Q_CC_GNU) && (__GNUC__ == 3 && __GNUC_MINOR__ == 3)
+    typedef QHash<FontHandle, QString> FontPropertiesNameMap;
+    typedef QHash<IconHandle, QString> IconPropertiesNameMap;
+    typedef QHash<SizePolicyHandle, QString> SizePolicyNameMap;
+#else
+    typedef QMap<FontHandle, QString> FontPropertiesNameMap;
+    typedef QMap<IconHandle, QString> IconPropertiesNameMap;
+    typedef QMap<SizePolicyHandle, QString> SizePolicyNameMap;
+#endif
+    FontPropertiesNameMap m_fontPropertiesNameMap;
+    IconPropertiesNameMap m_iconPropertiesNameMap;
+    SizePolicyNameMap     m_sizePolicyNameMap;
+
+    class LayoutDefaultHandler {
+    public:
+        LayoutDefaultHandler();
+        void acceptLayoutDefault(DomLayoutDefault *node);
+        void acceptLayoutFunction(DomLayoutFunction *node);
+
+        // Write out the layout margin and spacing properties applying the defaults.
+        void writeProperties(const QString &indent, const QString &varName,
+                             const DomPropertyMap &pm, int marginType,
+                             bool suppressMarginDefault, QTextStream &str) const;
+    private:
+        void writeProperty(int p, const QString &indent, const QString &objectName, const DomPropertyMap &pm,
+                           const QString &propertyName, const QString &setter, int defaultStyleValue,
+                           bool suppressDefault, QTextStream &str) const;
+
+        enum Properties { Margin, Spacing, NumProperties };
+        enum StateFlags { HasDefaultValue = 1, HasDefaultFunction = 2};
+        unsigned m_state[NumProperties];
+        int m_defaultValues[NumProperties];
+        QString m_functions[NumProperties];
+    };
+
+    // layout defaults
+    LayoutDefaultHandler m_LayoutDefaultHandler;
+    int m_layoutMarginType;
+
+    QString m_generatedClass;
+
+    QString m_delayedInitialization;
+    QTextStream m_delayedOut;
+
+    QString m_refreshInitialization;
+    QTextStream m_refreshOut;
+
+    QString m_delayedActionInitialization;
+    QTextStream m_actionOut;
+    const bool m_activateScripts;
+
+    bool m_layoutWidget;
+};
+
+} // namespace D
+
+QT_END_NAMESPACE
+
+#endif // DWRITEINITIALIZATION_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/duic/databaseinfo.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,92 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+** exception, Nokia gives you certain additional rights. These rights
+** are described in the Nokia Qt GPL Exception version 1.3, included in
+** the file GPL_EXCEPTION.txt in this package.
+**
+** Qt for Windows(R) Licensees
+** As a special exception, Nokia, as the sole copyright holder for Qt
+** Designer, grants users of the Qt/Eclipse Integration plug-in the
+** right for the Qt/Eclipse Integration to link to functionality
+** provided by Qt Designer and its related libraries.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+****************************************************************************/
+
+#include "databaseinfo.h"
+#include "driver.h"
+#include "ui4.h"
+#include "utils.h"
+
+QT_BEGIN_NAMESPACE
+
+DatabaseInfo::DatabaseInfo(Driver *drv)
+    : driver(drv)
+{
+}
+
+void DatabaseInfo::acceptUI(DomUI *node)
+{
+    m_connections.clear();
+    m_cursors.clear();
+    m_fields.clear();
+
+    TreeWalker::acceptUI(node);
+
+    m_connections = unique(m_connections);
+}
+
+void DatabaseInfo::acceptWidget(DomWidget *node)
+{
+    QHash<QString, DomProperty*> properties = propertyMap(node->elementProperty());
+
+    DomProperty *frameworkCode = properties.value(QLatin1String("frameworkCode"), 0);
+    if (frameworkCode && toBool(frameworkCode->elementBool()) == false)
+        return;
+
+    DomProperty *db = properties.value(QLatin1String("database"), 0);
+    if (db && db->elementStringList()) {
+        QStringList info = db->elementStringList()->elementString();
+
+        QString connection = info.size() > 0 ? info.at(0) : QString();
+        if (connection.isEmpty())
+            return;
+        m_connections.append(connection);
+
+        QString table = info.size() > 1 ? info.at(1) : QString();
+        if (table.isEmpty())
+            return;
+        m_cursors[connection].append(table);
+
+        QString field = info.size() > 2 ? info.at(2) : QString();
+        if (field.isEmpty())
+            return;
+        m_fields[connection].append(field);
+    }
+
+    TreeWalker::acceptWidget(node);
+}
+
+QT_END_NAMESPACE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/duic/databaseinfo.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+** exception, Nokia gives you certain additional rights. These rights
+** are described in the Nokia Qt GPL Exception version 1.3, included in
+** the file GPL_EXCEPTION.txt in this package.
+**
+** Qt for Windows(R) Licensees
+** As a special exception, Nokia, as the sole copyright holder for Qt
+** Designer, grants users of the Qt/Eclipse Integration plug-in the
+** right for the Qt/Eclipse Integration to link to functionality
+** provided by Qt Designer and its related libraries.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+****************************************************************************/
+
+#ifndef DATABASEINFO_H
+#define DATABASEINFO_H
+
+#include "treewalker.h"
+#include <QtCore/QStringList>
+#include <QtCore/QMap>
+
+QT_BEGIN_NAMESPACE
+
+class Driver;
+
+class DatabaseInfo : public TreeWalker
+{
+public:
+    DatabaseInfo(Driver *driver);
+
+    void acceptUI(DomUI *node);
+    void acceptWidget(DomWidget *node);
+
+    inline QStringList connections() const
+    { return m_connections; }
+
+    inline QStringList cursors(const QString &connection) const
+    { return m_cursors.value(connection); }
+
+    inline QStringList fields(const QString &connection) const
+    { return m_fields.value(connection); }
+
+private:
+    Driver *driver;
+    QStringList m_connections;
+    QMap<QString, QStringList> m_cursors;
+    QMap<QString, QStringList> m_fields;
+};
+
+QT_END_NAMESPACE
+
+#endif // DATABASEINFO_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/duic/driver.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,351 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+** exception, Nokia gives you certain additional rights. These rights
+** are described in the Nokia Qt GPL Exception version 1.3, included in
+** the file GPL_EXCEPTION.txt in this package.
+**
+** Qt for Windows(R) Licensees
+** As a special exception, Nokia, as the sole copyright holder for Qt
+** Designer, grants users of the Qt/Eclipse Integration plug-in the
+** right for the Qt/Eclipse Integration to link to functionality
+** provided by Qt Designer and its related libraries.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+****************************************************************************/
+
+#include "driver.h"
+#include "uic.h"
+#include "ui4.h"
+
+#include <QtCore/QRegExp>
+#include <QtCore/QFileInfo>
+#include <QtCore/QDebug>
+
+QT_BEGIN_NAMESPACE
+
+Driver::Driver()
+    : m_stdout(stdout, QFile::WriteOnly | QFile::Text)
+{
+    m_output = &m_stdout;
+}
+
+Driver::~Driver()
+{
+}
+
+QString Driver::findOrInsertWidget(DomWidget *ui_widget)
+{
+    if (!m_widgets.contains(ui_widget))
+        m_widgets.insert(ui_widget, unique(ui_widget->attributeName(), ui_widget->attributeClass()));
+
+    return m_widgets.value(ui_widget);
+}
+
+QString Driver::findOrInsertSpacer(DomSpacer *ui_spacer)
+{
+    if (!m_spacers.contains(ui_spacer)) {
+        const QString name = ui_spacer->hasAttributeName() ? ui_spacer->attributeName() : QString();
+        m_spacers.insert(ui_spacer, unique(name, QLatin1String("QSpacerItem")));
+    }
+
+    return m_spacers.value(ui_spacer);
+}
+
+QString Driver::findOrInsertLayout(DomLayout *ui_layout)
+{
+    if (!m_layouts.contains(ui_layout)) {
+        const QString name = ui_layout->hasAttributeName() ? ui_layout->attributeName() : QString();
+        m_layouts.insert(ui_layout, unique(name, ui_layout->attributeClass()));
+    }
+
+    return m_layouts.value(ui_layout);
+}
+
+QString Driver::findOrInsertLayoutItem(DomLayoutItem *ui_layoutItem)
+{
+    switch (ui_layoutItem->kind()) {
+        case DomLayoutItem::Widget:
+            return findOrInsertWidget(ui_layoutItem->elementWidget());
+        case DomLayoutItem::Spacer:
+            return findOrInsertSpacer(ui_layoutItem->elementSpacer());
+        case DomLayoutItem::Layout:
+            return findOrInsertLayout(ui_layoutItem->elementLayout());
+        case DomLayoutItem::Unknown:
+            break;
+    }
+
+    Q_ASSERT( 0 );
+
+    return QString();
+}
+
+QString Driver::findOrInsertActionGroup(DomActionGroup *ui_group)
+{
+    if (!m_actionGroups.contains(ui_group))
+        m_actionGroups.insert(ui_group, unique(ui_group->attributeName(), QLatin1String("QActionGroup")));
+
+    return m_actionGroups.value(ui_group);
+}
+
+QString Driver::findOrInsertAction(DomAction *ui_action)
+{
+    if (!m_actions.contains(ui_action))
+        m_actions.insert(ui_action, unique(ui_action->attributeName(), QLatin1String("QAction")));
+
+    return m_actions.value(ui_action);
+}
+
+QString Driver::findOrInsertName(const QString &name)
+{
+    return unique(name);
+}
+
+QString Driver::normalizedName(const QString &name)
+{
+    QString result = name;
+    result.replace(QRegExp(QLatin1String("[^a-zA-Z_0-9]")), QString(QLatin1Char('_')));
+    return result;
+}
+
+QString Driver::unique(const QString &instanceName, const QString &className)
+{
+    QString name;
+    bool alreadyUsed = false;
+
+    if (instanceName.size()) {
+        int id = 1;
+        name = instanceName;
+        name = normalizedName(name);
+        QString base = name;
+
+        while (m_nameRepository.contains(name)) {
+            alreadyUsed = true;
+            name = base + QString::number(id++);
+        }
+    } else if (className.size()) {
+        name = unique(qtify(className));
+    } else {
+        name = unique(QLatin1String("var"));
+    }
+
+    if (alreadyUsed && className.size()) {
+        fprintf(stderr, "Warning: name %s is already used\n", qPrintable(instanceName));
+    }
+
+    m_nameRepository.insert(name, true);
+    return name;
+}
+
+QString Driver::qtify(const QString &name)
+{
+    QString qname = name;
+
+    if (qname.at(0) == QLatin1Char('Q') || qname.at(0) == QLatin1Char('K'))
+        qname = qname.mid(1);
+
+    int i=0;
+    while (i < qname.length()) {
+        if (qname.at(i).toLower() != qname.at(i))
+            qname[i] = qname.at(i).toLower();
+        else
+            break;
+
+        ++i;
+    }
+
+    return qname;
+}
+
+static bool isAnsiCCharacter(const QChar& c)
+{
+    return (c.toUpper() >= QLatin1Char('A') && c.toUpper() <= QLatin1Char('Z'))
+           || c.isDigit() || c == QLatin1Char('_');
+}
+
+QString Driver::headerFileName() const
+{
+    QString name = m_option.outputFile;
+
+    if (name.isEmpty()) {
+        name = QLatin1String("ui_"); // ### use ui_ as prefix.
+        name.append(m_option.inputFile);
+    }
+
+    return headerFileName(name);
+}
+
+QString Driver::headerFileName(const QString &fileName)
+{
+    if (fileName.isEmpty())
+        return headerFileName(QLatin1String("noname"));
+
+    QFileInfo info(fileName);
+    QString baseName = info.baseName();
+    // Transform into a valid C++ identifier
+    if (!baseName.isEmpty() && baseName.at(0).isDigit())
+        baseName.prepend(QLatin1Char('_'));
+    for (int i = 0; i < baseName.size(); ++i) {
+        QChar c = baseName.at(i);
+        if (!isAnsiCCharacter(c)) {
+            // Replace character by its unicode value
+            QString hex = QString::number(c.unicode(), 16);
+            baseName.replace(i, 1, QLatin1Char('_') + hex + QLatin1Char('_'));
+            i += hex.size() + 1;
+        }
+    }
+    return baseName.toUpper() + QLatin1String("_H");
+}
+
+bool Driver::printDependencies(const QString &fileName)
+{
+    Q_ASSERT(m_option.dependencies == true);
+
+    m_option.inputFile = fileName;
+
+    Uic tool(this);
+    return tool.printDependencies();
+}
+
+bool Driver::uic(const QString &fileName, DomUI *ui, QTextStream *out)
+{
+    m_option.inputFile = fileName;
+
+    QTextStream *oldOutput = m_output;
+
+    m_output = out != 0 ? out : &m_stdout;
+
+    Uic tool(this);
+    bool rtn = false;
+#ifdef QT_UIC_D_GENERATOR
+    rtn = tool.write(ui);
+#else
+    Q_UNUSED(ui);
+    fprintf(stderr, "uic: option to generate d code not compiled in [%s:%d]\n",
+            __FILE__, __LINE__);
+#endif
+
+    m_output = oldOutput;
+
+    return rtn;
+}
+
+bool Driver::uic(const QString &fileName, QTextStream *out)
+{
+    QFile f;
+    if (fileName.isEmpty())
+        f.open(stdin, QIODevice::ReadOnly);
+    else {
+        f.setFileName(fileName);
+        if (!f.open(QIODevice::ReadOnly))
+            return false;
+    }
+
+    m_option.inputFile = fileName;
+
+    QTextStream *oldOutput = m_output;
+    bool deleteOutput = false;
+
+    if (out) {
+        m_output = out;
+    } else {
+#ifdef Q_WS_WIN
+        // As one might also redirect the output to a file on win,
+        // we should not create the textstream with QFile::Text flag.
+        // The redirected file is opened in TextMode and this will
+        // result in broken line endings as writing will replace \n again.
+        m_output = new QTextStream(stdout, QIODevice::WriteOnly);
+#else
+        m_output = new QTextStream(stdout, QIODevice::WriteOnly | QFile::Text);
+#endif
+        deleteOutput = true;
+    }
+
+    Uic tool(this);
+    bool rtn = tool.write(&f);
+    f.close();
+
+    if (deleteOutput)
+        delete m_output;
+
+    m_output = oldOutput;
+
+    return rtn;
+}
+
+void Driver::reset()
+{
+    Q_ASSERT( m_output == 0 );
+
+    m_option = Option();
+    m_output = 0;
+    m_problems.clear();
+
+    QStringList m_problems;
+
+    m_widgets.clear();
+    m_spacers.clear();
+    m_layouts.clear();
+    m_actionGroups.clear();
+    m_actions.clear();
+    m_nameRepository.clear();
+    m_pixmaps.clear();
+}
+
+void Driver::insertPixmap(const QString &pixmap)
+{
+    m_pixmaps.insert(pixmap, true);
+}
+
+bool Driver::containsPixmap(const QString &pixmap) const
+{
+    return m_pixmaps.contains(pixmap);
+}
+
+DomWidget *Driver::widgetByName(const QString &name) const
+{
+    return m_widgets.key(name);
+}
+
+DomSpacer *Driver::spacerByName(const QString &name) const
+{
+    return m_spacers.key(name);
+}
+
+DomLayout *Driver::layoutByName(const QString &name) const
+{
+    return m_layouts.key(name);
+}
+
+DomActionGroup *Driver::actionGroupByName(const QString &name) const
+{
+    return m_actionGroups.key(name);
+}
+
+DomAction *Driver::actionByName(const QString &name) const
+{
+    return m_actions.key(name);
+}
+
+QT_END_NAMESPACE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/duic/driver.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,130 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+** exception, Nokia gives you certain additional rights. These rights
+** are described in the Nokia Qt GPL Exception version 1.3, included in
+** the file GPL_EXCEPTION.txt in this package.
+**
+** Qt for Windows(R) Licensees
+** As a special exception, Nokia, as the sole copyright holder for Qt
+** Designer, grants users of the Qt/Eclipse Integration plug-in the
+** right for the Qt/Eclipse Integration to link to functionality
+** provided by Qt Designer and its related libraries.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+****************************************************************************/
+
+#ifndef DRIVER_H
+#define DRIVER_H
+
+#include "option.h"
+#include <QtCore/QHash>
+#include <QtCore/QString>
+#include <QtCore/QStringList>
+#include <QtCore/QTextStream>
+
+QT_BEGIN_NAMESPACE
+
+class QTextStream;
+class DomUI;
+class DomWidget;
+class DomSpacer;
+class DomLayout;
+class DomLayoutItem;
+class DomActionGroup;
+class DomAction;
+
+class Driver
+{
+public:
+    Driver();
+    virtual ~Driver();
+
+    // tools
+    bool printDependencies(const QString &fileName);
+    bool uic(const QString &fileName, QTextStream *output = 0);
+    bool uic(const QString &fileName, DomUI *ui, QTextStream *output = 0);
+
+    // configuration
+    inline QTextStream &output() const { return *m_output; }
+    inline Option &option() { return m_option; }
+
+    // initialization
+    void reset();
+
+    // error
+    inline QStringList problems() { return m_problems; }
+    inline void addProblem(const QString &problem) { m_problems.append(problem); }
+
+    // utils
+    static QString headerFileName(const QString &fileName);
+    QString headerFileName() const;
+
+    static QString normalizedName(const QString &name);
+    static QString qtify(const QString &name);
+    QString unique(const QString &instanceName=QString(),
+                   const QString &className=QString());
+
+    // symbol table
+    QString findOrInsertWidget(DomWidget *ui_widget);
+    QString findOrInsertSpacer(DomSpacer *ui_spacer);
+    QString findOrInsertLayout(DomLayout *ui_layout);
+    QString findOrInsertLayoutItem(DomLayoutItem *ui_layoutItem);
+    QString findOrInsertName(const QString &name);
+    QString findOrInsertActionGroup(DomActionGroup *ui_group);
+    QString findOrInsertAction(DomAction *ui_action);
+
+    inline bool hasName(const QString &name) const
+    { return m_nameRepository.contains(name); }
+
+    DomWidget *widgetByName(const QString &name) const;
+    DomSpacer *spacerByName(const QString &name) const;
+    DomLayout *layoutByName(const QString &name) const;
+    DomActionGroup *actionGroupByName(const QString &name) const;
+    DomAction *actionByName(const QString &name) const;
+
+    // pixmap
+    void insertPixmap(const QString &pixmap);
+    bool containsPixmap(const QString &pixmap) const;
+
+private:
+    Option m_option;
+    QTextStream m_stdout;
+    QTextStream *m_output;
+
+    QStringList m_problems;
+
+    // symbol tables
+    QHash<DomWidget*, QString> m_widgets;
+    QHash<DomSpacer*, QString> m_spacers;
+    QHash<DomLayout*, QString> m_layouts;
+    QHash<DomActionGroup*, QString> m_actionGroups;
+    QHash<DomAction*, QString> m_actions;
+    QHash<QString, bool> m_nameRepository;
+    QHash<QString, bool> m_pixmaps;
+};
+
+QT_END_NAMESPACE
+
+#endif // DRIVER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/duic/globaldefs.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,50 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+** exception, Nokia gives you certain additional rights. These rights
+** are described in the Nokia Qt GPL Exception version 1.3, included in
+** the file GPL_EXCEPTION.txt in this package.
+**
+** Qt for Windows(R) Licensees
+** As a special exception, Nokia, as the sole copyright holder for Qt
+** Designer, grants users of the Qt/Eclipse Integration plug-in the
+** right for the Qt/Eclipse Integration to link to functionality
+** provided by Qt Designer and its related libraries.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+****************************************************************************/
+
+#ifndef GLOBALDEFS_H
+#define GLOBALDEFS_H
+
+#include <QtCore/qglobal.h>
+
+QT_BEGIN_NAMESPACE
+
+enum { BOXLAYOUT_DEFAULT_MARGIN = 11 };
+enum { BOXLAYOUT_DEFAULT_SPACING = 6 };
+
+QT_END_NAMESPACE
+
+#endif // GLOBALDEFS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/duic/main.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,193 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+** exception, Nokia gives you certain additional rights. These rights
+** are described in the Nokia Qt GPL Exception version 1.3, included in
+** the file GPL_EXCEPTION.txt in this package.
+**
+** Qt for Windows(R) Licensees
+** As a special exception, Nokia, as the sole copyright holder for Qt
+** Designer, grants users of the Qt/Eclipse Integration plug-in the
+** right for the Qt/Eclipse Integration to link to functionality
+** provided by Qt Designer and its related libraries.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+****************************************************************************/
+
+#include "uic.h"
+#include "option.h"
+#include "driver.h"
+#include <QtCore/QFile>
+#include <QtCore/QDir>
+#include <QtCore/QTextStream>
+#include <QtCore/QTextCodec>
+#include <QtCore/QObject>
+
+QT_BEGIN_NAMESPACE
+
+static const char *error = 0;
+
+void showHelp(const char *appName)
+{
+    fprintf(stderr, "QtD User Interface Compiler version %s\n", QT_VERSION_STR);
+    if (error)
+        fprintf(stderr, "%s: %s\n", appName, error);
+
+    fprintf(stderr, "Usage: %s [options] <uifile>\n\n"
+            "  -h, -help                 display this help and exit\n"
+            "  -v, -version              display version\n"
+            "  -d, -dependencies         display the dependencies\n"
+            "  -o <file>                 place the output into <file>\n"
+            "  -tr <func>                use func() for i18n\n"
+            "  -p, -no-protection        disable header protection\n"
+            "  -n, -no-implicit-includes disable generation of #include-directives\n"
+            "                            for forms generated by uic3\n"
+            "  -g <name>                 change generator\n"
+            "\n", appName);
+}
+
+int runUic(int argc, char *argv[])
+{
+    Driver driver;
+
+    const char *fileName = 0;
+
+    int arg = 1;
+    while (arg < argc) {
+        QString opt = QString::fromLocal8Bit(argv[arg]);
+        if (opt == QLatin1String("-h") || opt == QLatin1String("-help")) {
+            showHelp(argv[0]);
+            return 0;
+        } else if (opt == QLatin1String("-d") || opt == QLatin1String("-dependencies")) {
+            driver.option().dependencies = true;
+        } else if (opt == QLatin1String("-v") || opt == QLatin1String("-version")) {
+            fprintf(stderr, "Qt User Interface Compiler version %s\n", QT_VERSION_STR);
+            return 0;
+        } else if (opt == QLatin1String("-o") || opt == QLatin1String("-output")) {
+            ++arg;
+            if (!argv[arg]) {
+                showHelp(argv[0]);
+                return 1;
+            }
+            driver.option().outputFile = QFile::decodeName(argv[arg]);
+        } else if (opt == QLatin1String("-p") || opt == QLatin1String("-no-protection")) {
+            driver.option().headerProtection = false;
+        } else if (opt == QLatin1String("-n") || opt == QLatin1String("-no-implicit-includes")) {
+            driver.option().implicitIncludes = false;
+        } else if (opt == QLatin1String("-postfix")) {
+            ++arg;
+            if (!argv[arg]) {
+                showHelp(argv[0]);
+                return 1;
+            }
+            driver.option().postfix = QLatin1String(argv[arg]);
+        } else if (opt == QLatin1String("-3")) {
+            ++arg;
+            if (!argv[arg]) {
+                showHelp(argv[0]);
+                return 1;
+            }
+            driver.option().uic3 = QFile::decodeName(argv[arg]);
+        } else if (opt == QLatin1String("-tr") || opt == QLatin1String("-translate")) {
+            ++arg;
+            if (!argv[arg]) {
+                showHelp(argv[0]);
+                return 1;
+            }
+            driver.option().translateFunction = QLatin1String(argv[arg]);
+        } else if (opt == QLatin1String("-g") || opt == QLatin1String("-generator")) {
+            ++arg;
+            if (!argv[arg]) {
+                showHelp(argv[0]);
+                return 1;
+            }
+            QString name = QString::fromLocal8Bit(argv[arg]).toLower ();
+            driver.option().generator = (name == QLatin1String ("java")) ? Option::JavaGenerator : Option::DGenerator;
+        } else if (!fileName) {
+            fileName = argv[arg];
+        } else {
+            showHelp(argv[0]);
+            return 1;
+        }
+
+        ++arg;
+    }
+
+    // report Qt usage for commercial customers with a "metered license" (currently experimental)
+#if QT_EDITION != QT_EDITION_OPENSOURCE
+#ifdef QT_CONFIGURE_BINARIES_PATH
+    const char *binariesPath = QT_CONFIGURE_BINARIES_PATH;
+    QString reporterPath = QString::fromLocal8Bit(binariesPath);
+    reporterPath += QDir::separator();
+    reporterPath += QLatin1String("qtusagereporter");
+#if defined(Q_OS_WIN)
+    reporterPath += QLatin1String(".exe");
+#endif
+    if (QFile::exists(reporterPath))
+        system(qPrintable(reporterPath + QLatin1String(" uic")));
+#endif
+#endif
+
+    QString inputFile;
+    if (fileName)
+        inputFile = QString::fromLocal8Bit(fileName);
+    else
+        driver.option().headerProtection = false;
+
+    if (driver.option().dependencies) {
+        return !driver.printDependencies(inputFile);
+    }
+
+    QTextStream *out = 0;
+    QFile f;
+    if (driver.option().outputFile.size()) {
+        f.setFileName(driver.option().outputFile);
+        if (!f.open(QIODevice::WriteOnly | QFile::Text)) {
+            fprintf(stderr, "Could not create output file\n");
+            return 1;
+        }
+        out = new QTextStream(&f);
+        out->setCodec(QTextCodec::codecForName("UTF-8"));
+    }
+
+    bool rtn = driver.uic(inputFile, out);
+    delete out;
+
+    if (!rtn) {
+        if (driver.option().outputFile.size()) {
+            f.close();
+            f.remove();
+        }
+        fprintf(stderr, "File '%s' is not valid\n", inputFile.isEmpty() ? "<stdin>" : inputFile.toLocal8Bit().constData());
+    }
+
+    return !rtn;
+}
+
+QT_END_NAMESPACE
+
+int main(int argc, char *argv[])
+{
+    return QT_PREPEND_NAMESPACE(runUic)(argc, argv);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/duic/option.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,92 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+** exception, Nokia gives you certain additional rights. These rights
+** are described in the Nokia Qt GPL Exception version 1.3, included in
+** the file GPL_EXCEPTION.txt in this package.
+**
+** Qt for Windows(R) Licensees
+** As a special exception, Nokia, as the sole copyright holder for Qt
+** Designer, grants users of the Qt/Eclipse Integration plug-in the
+** right for the Qt/Eclipse Integration to link to functionality
+** provided by Qt Designer and its related libraries.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+****************************************************************************/
+
+#ifndef OPTION_H
+#define OPTION_H
+
+#include <QtCore/QString>
+
+QT_BEGIN_NAMESPACE
+
+struct Option
+{
+    enum Generator
+    {
+        DGenerator,
+        JavaGenerator
+    };
+
+    unsigned int headerProtection : 1;
+    unsigned int copyrightHeader : 1;
+    unsigned int generateImplemetation : 1;
+    unsigned int generateNamespace : 1;
+    unsigned int autoConnection : 1;
+    unsigned int dependencies : 1;
+    unsigned int extractImages : 1;
+    unsigned int implicitIncludes: 1;
+    Generator generator;
+
+    QString inputFile;
+    QString outputFile;
+    QString qrcOutputFile;
+    QString indent;
+    QString prefix;
+    QString postfix;
+    QString translateFunction;
+    QString uic3;
+#ifdef QT_UIC_JAVA_GENERATOR
+    QString javaPackage;
+    QString javaOutputDirectory;
+#endif
+
+    Option()
+        : headerProtection(1),
+          copyrightHeader(1),
+          generateImplemetation(0),
+          generateNamespace(0),
+          autoConnection(1),
+          dependencies(0),
+          extractImages(0),
+          implicitIncludes(1),
+          generator(DGenerator),
+          prefix(QLatin1String("Ui_"))
+    { indent.fill(QLatin1Char(' '), 4); }
+};
+
+QT_END_NAMESPACE
+
+#endif // OPTION_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/duic/qclass_lib_map.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,1079 @@
+QT_CLASS_LIB(QTextCodec, QtCore, qtextcodec.h)
+QT_CLASS_LIB(QTextEncoder, QtCore, qtextcodec.h)
+QT_CLASS_LIB(QTextDecoder, QtCore, qtextcodec.h)
+QT_CLASS_LIB(QTextCodecFactoryInterface, QtCore, qtextcodecplugin.h)
+QT_CLASS_LIB(QTextCodecPlugin, QtCore, qtextcodecplugin.h)
+QT_CLASS_LIB(QFuture, QtCore, qfuture.h)
+QT_CLASS_LIB(QFutureIterator, QtCore, qfuture.h)
+QT_CLASS_LIB(QMutableFutureIterator, QtCore, qfuture.h)
+QT_CLASS_LIB(QFuture, QtCore, qfuture.h)
+QT_CLASS_LIB(QFutureInterfaceBase, QtCore, qfutureinterface.h)
+QT_CLASS_LIB(QFutureInterface, QtCore, qfutureinterface.h)
+QT_CLASS_LIB(QFutureInterface, QtCore, qfutureinterface.h)
+QT_CLASS_LIB(QFutureSynchronizer, QtCore, qfuturesynchronizer.h)
+QT_CLASS_LIB(QFutureWatcherBase, QtCore, qfuturewatcher.h)
+QT_CLASS_LIB(QFutureWatcher, QtCore, qfuturewatcher.h)
+QT_CLASS_LIB(QFutureWatcher, QtCore, qfuturewatcher.h)
+QT_CLASS_LIB(QRunnable, QtCore, qrunnable.h)
+QT_CLASS_LIB(QtConcurrentFilter, QtCore, qtconcurrentfilter.h)
+QT_CLASS_LIB(QtConcurrentMap, QtCore, qtconcurrentmap.h)
+QT_CLASS_LIB(QtConcurrentRun, QtCore, qtconcurrentrun.h)
+QT_CLASS_LIB(QThreadPool, QtCore, qthreadpool.h)
+QT_CLASS_LIB(QtEndian, QtCore, qendian.h)
+QT_CLASS_LIB(QtGlobal, QtCore, qglobal.h)
+QT_CLASS_LIB(QUintForSize, QtCore, qglobal.h)
+QT_CLASS_LIB(QUintForSize, QtCore, qglobal.h)
+QT_CLASS_LIB(QUintForSize, QtCore, qglobal.h)
+QT_CLASS_LIB(QUintForType, QtCore, qglobal.h)
+QT_CLASS_LIB(QIntForSize, QtCore, qglobal.h)
+QT_CLASS_LIB(QIntForSize, QtCore, qglobal.h)
+QT_CLASS_LIB(QIntForSize, QtCore, qglobal.h)
+QT_CLASS_LIB(QIntForType, QtCore, qglobal.h)
+QT_CLASS_LIB(QNoImplicitBoolCast, QtCore, qglobal.h)
+QT_CLASS_LIB(Q_INT8, QtCore, qglobal.h)
+QT_CLASS_LIB(Q_UINT8, QtCore, qglobal.h)
+QT_CLASS_LIB(Q_INT16, QtCore, qglobal.h)
+QT_CLASS_LIB(Q_UINT16, QtCore, qglobal.h)
+QT_CLASS_LIB(Q_INT32, QtCore, qglobal.h)
+QT_CLASS_LIB(Q_UINT32, QtCore, qglobal.h)
+QT_CLASS_LIB(Q_INT64, QtCore, qglobal.h)
+QT_CLASS_LIB(Q_UINT64, QtCore, qglobal.h)
+QT_CLASS_LIB(Q_LLONG, QtCore, qglobal.h)
+QT_CLASS_LIB(Q_ULLONG, QtCore, qglobal.h)
+QT_CLASS_LIB(Q_LONG, QtCore, qglobal.h)
+QT_CLASS_LIB(Q_ULONG, QtCore, qglobal.h)
+QT_CLASS_LIB(Q_LONG, QtCore, qglobal.h)
+QT_CLASS_LIB(Q_ULONG, QtCore, qglobal.h)
+QT_CLASS_LIB(QSysInfo, QtCore, qglobal.h)
+QT_CLASS_LIB(QtMsgHandler, QtCore, qglobal.h)
+QT_CLASS_LIB(QGlobalStatic, QtCore, qglobal.h)
+QT_CLASS_LIB(QGlobalStatic, QtCore, qglobal.h)
+QT_CLASS_LIB(QGlobalStaticDeleter, QtCore, qglobal.h)
+QT_CLASS_LIB(QBool, QtCore, qglobal.h)
+QT_CLASS_LIB(QTypeInfo, QtCore, qglobal.h)
+QT_CLASS_LIB(QTypeInfo, QtCore, qglobal.h)
+QT_CLASS_LIB(QTypeInfo, QtCore, qglobal.h)
+QT_CLASS_LIB(QFlag, QtCore, qglobal.h)
+QT_CLASS_LIB(QFlags, QtCore, qglobal.h)
+QT_CLASS_LIB(QForeachContainer, QtCore, qglobal.h)
+QT_CLASS_LIB(QForeachContainerBase, QtCore, qglobal.h)
+QT_CLASS_LIB(QForeachContainer, QtCore, qglobal.h)
+QT_CLASS_LIB(QLibraryInfo, QtCore, qlibraryinfo.h)
+QT_CLASS_LIB(Qt, QtCore, qnamespace.h)
+QT_CLASS_LIB(QInternal, QtCore, qnamespace.h)
+QT_CLASS_LIB(QCOORD, QtCore, qnamespace.h)
+QT_CLASS_LIB(QAbstractFileEngine, QtCore, qabstractfileengine.h)
+QT_CLASS_LIB(QAbstractFileEngineHandler, QtCore, qabstractfileengine.h)
+QT_CLASS_LIB(QAbstractFileEngineIterator, QtCore, qabstractfileengine.h)
+QT_CLASS_LIB(QBuffer, QtCore, qbuffer.h)
+QT_CLASS_LIB(QDataStream, QtCore, qdatastream.h)
+QT_CLASS_LIB(QtDebug, QtCore, qdebug.h)
+QT_CLASS_LIB(QDebug, QtCore, qdebug.h)
+QT_CLASS_LIB(QNoDebug, QtCore, qdebug.h)
+QT_CLASS_LIB(QDir, QtCore, qdir.h)
+QT_CLASS_LIB(QDirIterator, QtCore, qdiriterator.h)
+QT_CLASS_LIB(QFile, QtCore, qfile.h)
+QT_CLASS_LIB(QFileInfo, QtCore, qfileinfo.h)
+QT_CLASS_LIB(QFileInfoList, QtCore, qfileinfo.h)
+QT_CLASS_LIB(QFileInfoListIterator, QtCore, qfileinfo.h)
+QT_CLASS_LIB(QFileSystemWatcher, QtCore, qfilesystemwatcher.h)
+QT_CLASS_LIB(QFSFileEngine, QtCore, qfsfileengine.h)
+QT_CLASS_LIB(QIODevice, QtCore, qiodevice.h)
+QT_CLASS_LIB(Q_PID, QtCore, qprocess.h)
+QT_CLASS_LIB(QProcess, QtCore, qprocess.h)
+QT_CLASS_LIB(QResource, QtCore, qresource.h)
+QT_CLASS_LIB(QSettings, QtCore, qsettings.h)
+QT_CLASS_LIB(QTemporaryFile, QtCore, qtemporaryfile.h)
+QT_CLASS_LIB(QTextStream, QtCore, qtextstream.h)
+QT_CLASS_LIB(QTextStreamFunction, QtCore, qtextstream.h)
+QT_CLASS_LIB(QTextStreamManipulator, QtCore, qtextstream.h)
+QT_CLASS_LIB(QTS, QtCore, qtextstream.h)
+QT_CLASS_LIB(QTextIStream, QtCore, qtextstream.h)
+QT_CLASS_LIB(QTextOStream, QtCore, qtextstream.h)
+QT_CLASS_LIB(QUrl, QtCore, qurl.h)
+QT_CLASS_LIB(QAbstractEventDispatcher, QtCore, qabstracteventdispatcher.h)
+QT_CLASS_LIB(QModelIndex, QtCore, qabstractitemmodel.h)
+QT_CLASS_LIB(QPersistentModelIndex, QtCore, qabstractitemmodel.h)
+QT_CLASS_LIB(QModelIndexList, QtCore, qabstractitemmodel.h)
+QT_CLASS_LIB(QAbstractItemModel, QtCore, qabstractitemmodel.h)
+QT_CLASS_LIB(QAbstractTableModel, QtCore, qabstractitemmodel.h)
+QT_CLASS_LIB(QAbstractListModel, QtCore, qabstractitemmodel.h)
+QT_CLASS_LIB(QBasicTimer, QtCore, qbasictimer.h)
+QT_CLASS_LIB(QCoreApplication, QtCore, qcoreapplication.h)
+QT_CLASS_LIB(QtCleanUpFunction, QtCore, qcoreapplication.h)
+QT_CLASS_LIB(QEvent, QtCore, qcoreevent.h)
+QT_CLASS_LIB(QTimerEvent, QtCore, qcoreevent.h)
+QT_CLASS_LIB(QChildEvent, QtCore, qcoreevent.h)
+QT_CLASS_LIB(QCustomEvent, QtCore, qcoreevent.h)
+QT_CLASS_LIB(QDynamicPropertyChangeEvent, QtCore, qcoreevent.h)
+QT_CLASS_LIB(QEventLoop, QtCore, qeventloop.h)
+QT_CLASS_LIB(QMetaMethod, QtCore, qmetaobject.h)
+QT_CLASS_LIB(QMetaEnum, QtCore, qmetaobject.h)
+QT_CLASS_LIB(QMetaProperty, QtCore, qmetaobject.h)
+QT_CLASS_LIB(QMetaClassInfo, QtCore, qmetaobject.h)
+QT_CLASS_LIB(QMetaType, QtCore, qmetatype.h)
+QT_CLASS_LIB(QMetaTypeId, QtCore, qmetatype.h)
+QT_CLASS_LIB(QMetaTypeId2, QtCore, qmetatype.h)
+QT_CLASS_LIB(QMimeData, QtCore, qmimedata.h)
+QT_CLASS_LIB(QObjectList, QtCore, qobject.h)
+QT_CLASS_LIB(QObjectData, QtCore, qobject.h)
+QT_CLASS_LIB(QObject, QtCore, qobject.h)
+QT_CLASS_LIB(QObjectUserData, QtCore, qobject.h)
+QT_CLASS_LIB(QObjectCleanupHandler, QtCore, qobjectcleanuphandler.h)
+QT_CLASS_LIB(QGenericArgument, QtCore, qobjectdefs.h)
+QT_CLASS_LIB(QGenericReturnArgument, QtCore, qobjectdefs.h)
+QT_CLASS_LIB(QArgument, QtCore, qobjectdefs.h)
+QT_CLASS_LIB(QReturnArgument, QtCore, qobjectdefs.h)
+QT_CLASS_LIB(QMetaObject, QtCore, qobjectdefs.h)
+QT_CLASS_LIB(QPointer, QtCore, qpointer.h)
+QT_CLASS_LIB(QSharedMemory, QtCore, qsharedmemory.h)
+QT_CLASS_LIB(QSignalMapper, QtCore, qsignalmapper.h)
+QT_CLASS_LIB(QSocketNotifier, QtCore, qsocketnotifier.h)
+QT_CLASS_LIB(QSystemSemaphore, QtCore, qsystemsemaphore.h)
+QT_CLASS_LIB(QTimer, QtCore, qtimer.h)
+QT_CLASS_LIB(QTranslator, QtCore, qtranslator.h)
+QT_CLASS_LIB(QVariant, QtCore, qvariant.h)
+QT_CLASS_LIB(QVariantList, QtCore, qvariant.h)
+QT_CLASS_LIB(QVariantMap, QtCore, qvariant.h)
+QT_CLASS_LIB(QVariantComparisonHelper, QtCore, qvariant.h)
+QT_CLASS_LIB(QFactoryInterface, QtCore, qfactoryinterface.h)
+QT_CLASS_LIB(QLibrary, QtCore, qlibrary.h)
+QT_CLASS_LIB(QtPlugin, QtCore, qplugin.h)
+QT_CLASS_LIB(QtPluginInstanceFunction, QtCore, qplugin.h)
+QT_CLASS_LIB(QPluginLoader, QtCore, qpluginloader.h)
+QT_CLASS_LIB(QUuid, QtCore, quuid.h)
+QT_CLASS_LIB(QAtomicInt, QtCore, qatomic.h)
+QT_CLASS_LIB(QAtomicPointer, QtCore, qatomic.h)
+QT_CLASS_LIB(QBasicAtomicInt, QtCore, qbasicatomic.h)
+QT_CLASS_LIB(QBasicAtomicPointer, QtCore, qbasicatomic.h)
+QT_CLASS_LIB(QMutex, QtCore, qmutex.h)
+QT_CLASS_LIB(QMutexLocker, QtCore, qmutex.h)
+QT_CLASS_LIB(QMutex, QtCore, qmutex.h)
+QT_CLASS_LIB(QMutexLocker, QtCore, qmutex.h)
+QT_CLASS_LIB(QReadWriteLock, QtCore, qreadwritelock.h)
+QT_CLASS_LIB(QReadLocker, QtCore, qreadwritelock.h)
+QT_CLASS_LIB(QWriteLocker, QtCore, qreadwritelock.h)
+QT_CLASS_LIB(QReadWriteLock, QtCore, qreadwritelock.h)
+QT_CLASS_LIB(QReadLocker, QtCore, qreadwritelock.h)
+QT_CLASS_LIB(QWriteLocker, QtCore, qreadwritelock.h)
+QT_CLASS_LIB(QSemaphore, QtCore, qsemaphore.h)
+QT_CLASS_LIB(QThread, QtCore, qthread.h)
+QT_CLASS_LIB(QThread, QtCore, qthread.h)
+QT_CLASS_LIB(QThreadStorageData, QtCore, qthreadstorage.h)
+QT_CLASS_LIB(QThreadStorage, QtCore, qthreadstorage.h)
+QT_CLASS_LIB(QWaitCondition, QtCore, qwaitcondition.h)
+QT_CLASS_LIB(QWaitCondition, QtCore, qwaitcondition.h)
+QT_CLASS_LIB(QtAlgorithms, QtCore, qalgorithms.h)
+QT_CLASS_LIB(QBitArray, QtCore, qbitarray.h)
+QT_CLASS_LIB(QBitRef, QtCore, qbitarray.h)
+QT_CLASS_LIB(QByteArray, QtCore, qbytearray.h)
+QT_CLASS_LIB(QByteRef, QtCore, qbytearray.h)
+QT_CLASS_LIB(QByteArrayMatcher, QtCore, qbytearraymatcher.h)
+QT_CLASS_LIB(QCache, QtCore, qcache.h)
+QT_CLASS_LIB(QLatin1Char, QtCore, qchar.h)
+QT_CLASS_LIB(QChar, QtCore, qchar.h)
+QT_CLASS_LIB(QtContainerFwd, QtCore, qcontainerfwd.h)
+QT_CLASS_LIB(QCryptographicHash, QtCore, qcryptographichash.h)
+QT_CLASS_LIB(QDate, QtCore, qdatetime.h)
+QT_CLASS_LIB(QTime, QtCore, qdatetime.h)
+QT_CLASS_LIB(QDateTime, QtCore, qdatetime.h)
+QT_CLASS_LIB(QHashData, QtCore, qhash.h)
+QT_CLASS_LIB(QHashDummyValue, QtCore, qhash.h)
+QT_CLASS_LIB(QHashDummyNode, QtCore, qhash.h)
+QT_CLASS_LIB(QHashNode, QtCore, qhash.h)
+QT_CLASS_LIB(QHash, QtCore, qhash.h)
+QT_CLASS_LIB(QMultiHash, QtCore, qhash.h)
+QT_CLASS_LIB(QHashIterator, QtCore, qhash.h)
+QT_CLASS_LIB(QMutableHashIterator, QtCore, qhash.h)
+QT_CLASS_LIB(QHashIterator, QtCore, qhash.h)
+QT_CLASS_LIB(QMutableHashIterator, QtCore, qhash.h)
+QT_CLASS_LIB(QLine, QtCore, qline.h)
+QT_CLASS_LIB(QLineF, QtCore, qline.h)
+QT_CLASS_LIB(QLinkedListData, QtCore, qlinkedlist.h)
+QT_CLASS_LIB(QLinkedListNode, QtCore, qlinkedlist.h)
+QT_CLASS_LIB(QLinkedList, QtCore, qlinkedlist.h)
+QT_CLASS_LIB(QLinkedListIterator, QtCore, qlinkedlist.h)
+QT_CLASS_LIB(QMutableLinkedListIterator, QtCore, qlinkedlist.h)
+QT_CLASS_LIB(QLinkedListIterator, QtCore, qlinkedlist.h)
+QT_CLASS_LIB(QMutableLinkedListIterator, QtCore, qlinkedlist.h)
+QT_CLASS_LIB(QListData, QtCore, qlist.h)
+QT_CLASS_LIB(QList, QtCore, qlist.h)
+QT_CLASS_LIB(QListIterator, QtCore, qlist.h)
+QT_CLASS_LIB(QMutableListIterator, QtCore, qlist.h)
+QT_CLASS_LIB(QListIterator, QtCore, qlist.h)
+QT_CLASS_LIB(QMutableListIterator, QtCore, qlist.h)
+QT_CLASS_LIB(QSystemLocale, QtCore, qlocale.h)
+QT_CLASS_LIB(QLocale, QtCore, qlocale.h)
+QT_CLASS_LIB(QMapData, QtCore, qmap.h)
+QT_CLASS_LIB(QMap, QtCore, qmap.h)
+QT_CLASS_LIB(QMultiMap, QtCore, qmap.h)
+QT_CLASS_LIB(QMapIterator, QtCore, qmap.h)
+QT_CLASS_LIB(QMutableMapIterator, QtCore, qmap.h)
+QT_CLASS_LIB(QMapIterator, QtCore, qmap.h)
+QT_CLASS_LIB(QMutableMapIterator, QtCore, qmap.h)
+QT_CLASS_LIB(QPair, QtCore, qpair.h)
+QT_CLASS_LIB(QPoint, QtCore, qpoint.h)
+QT_CLASS_LIB(QPointF, QtCore, qpoint.h)
+QT_CLASS_LIB(QQueue, QtCore, qqueue.h)
+QT_CLASS_LIB(QRect, QtCore, qrect.h)
+QT_CLASS_LIB(QRectF, QtCore, qrect.h)
+QT_CLASS_LIB(QRegExp, QtCore, qregexp.h)
+QT_CLASS_LIB(QSet, QtCore, qset.h)
+QT_CLASS_LIB(QSetIterator, QtCore, qset.h)
+QT_CLASS_LIB(QMutableSetIterator, QtCore, qset.h)
+QT_CLASS_LIB(QMutableSetIterator, QtCore, qset.h)
+QT_CLASS_LIB(QSharedData, QtCore, qshareddata.h)
+QT_CLASS_LIB(QSharedDataPointer, QtCore, qshareddata.h)
+QT_CLASS_LIB(QExplicitlySharedDataPointer, QtCore, qshareddata.h)
+QT_CLASS_LIB(QSize, QtCore, qsize.h)
+QT_CLASS_LIB(QSizeF, QtCore, qsize.h)
+QT_CLASS_LIB(QStack, QtCore, qstack.h)
+QT_CLASS_LIB(QStdWString, QtCore, qstring.h)
+QT_CLASS_LIB(QString, QtCore, qstring.h)
+QT_CLASS_LIB(QLatin1String, QtCore, qstring.h)
+QT_CLASS_LIB(QCharRef, QtCore, qstring.h)
+QT_CLASS_LIB(QConstString, QtCore, qstring.h)
+QT_CLASS_LIB(QStringRef, QtCore, qstring.h)
+QT_CLASS_LIB(QStringListIterator, QtCore, qstringlist.h)
+QT_CLASS_LIB(QMutableStringListIterator, QtCore, qstringlist.h)
+QT_CLASS_LIB(QStringList, QtCore, qstringlist.h)
+QT_CLASS_LIB(QStringMatcher, QtCore, qstringmatcher.h)
+QT_CLASS_LIB(QTextBoundaryFinder, QtCore, qtextboundaryfinder.h)
+QT_CLASS_LIB(QTimeLine, QtCore, qtimeline.h)
+QT_CLASS_LIB(QVarLengthArray, QtCore, qvarlengtharray.h)
+QT_CLASS_LIB(QVectorData, QtCore, qvector.h)
+QT_CLASS_LIB(QVectorTypedData, QtCore, qvector.h)
+QT_CLASS_LIB(QVector, QtCore, qvector.h)
+QT_CLASS_LIB(QVectorIterator, QtCore, qvector.h)
+QT_CLASS_LIB(QMutableVectorIterator, QtCore, qvector.h)
+QT_CLASS_LIB(QVectorIterator, QtCore, qvector.h)
+QT_CLASS_LIB(QMutableVectorIterator, QtCore, qvector.h)
+QT_CLASS_LIB(QXmlStreamStringRef, QtCore, qxmlstream.h)
+QT_CLASS_LIB(QXmlStreamAttribute, QtCore, qxmlstream.h)
+QT_CLASS_LIB(QXmlStreamAttributes, QtCore, qxmlstream.h)
+QT_CLASS_LIB(QXmlStreamNamespaceDeclaration, QtCore, qxmlstream.h)
+QT_CLASS_LIB(QXmlStreamNamespaceDeclarations, QtCore, qxmlstream.h)
+QT_CLASS_LIB(QXmlStreamNotationDeclaration, QtCore, qxmlstream.h)
+QT_CLASS_LIB(QXmlStreamNotationDeclarations, QtCore, qxmlstream.h)
+QT_CLASS_LIB(QXmlStreamEntityDeclaration, QtCore, qxmlstream.h)
+QT_CLASS_LIB(QXmlStreamEntityDeclarations, QtCore, qxmlstream.h)
+QT_CLASS_LIB(QXmlStreamEntityResolver, QtCore, qxmlstream.h)
+QT_CLASS_LIB(QXmlStreamReader, QtCore, qxmlstream.h)
+QT_CLASS_LIB(QXmlStreamWriter, QtCore, qxmlstream.h)
+QT_CLASS_LIB(QMacGLCompatTypes, QtOpenGL, qgl.h)
+QT_CLASS_LIB(QMacGLCompatTypes, QtOpenGL, qgl.h)
+QT_CLASS_LIB(QMacCompatGLint, QtOpenGL, qgl.h)
+QT_CLASS_LIB(QMacCompatGLuint, QtOpenGL, qgl.h)
+QT_CLASS_LIB(QMacCompatGLenum, QtOpenGL, qgl.h)
+QT_CLASS_LIB(QGLFormat, QtOpenGL, qgl.h)
+QT_CLASS_LIB(QGLContext, QtOpenGL, qgl.h)
+QT_CLASS_LIB(QGLWidget, QtOpenGL, qgl.h)
+QT_CLASS_LIB(QGLColormap, QtOpenGL, qglcolormap.h)
+QT_CLASS_LIB(QGLFramebufferObject, QtOpenGL, qglframebufferobject.h)
+QT_CLASS_LIB(QGLPixelBuffer, QtOpenGL, qglpixelbuffer.h)
+QT_CLASS_LIB(QDomImplementation, QtXml, qdom.h)
+QT_CLASS_LIB(QDomNode, QtXml, qdom.h)
+QT_CLASS_LIB(QDomNodeList, QtXml, qdom.h)
+QT_CLASS_LIB(QDomDocumentType, QtXml, qdom.h)
+QT_CLASS_LIB(QDomDocument, QtXml, qdom.h)
+QT_CLASS_LIB(QDomNamedNodeMap, QtXml, qdom.h)
+QT_CLASS_LIB(QDomDocumentFragment, QtXml, qdom.h)
+QT_CLASS_LIB(QDomCharacterData, QtXml, qdom.h)
+QT_CLASS_LIB(QDomAttr, QtXml, qdom.h)
+QT_CLASS_LIB(QDomElement, QtXml, qdom.h)
+QT_CLASS_LIB(QDomText, QtXml, qdom.h)
+QT_CLASS_LIB(QDomComment, QtXml, qdom.h)
+QT_CLASS_LIB(QDomCDATASection, QtXml, qdom.h)
+QT_CLASS_LIB(QDomNotation, QtXml, qdom.h)
+QT_CLASS_LIB(QDomEntity, QtXml, qdom.h)
+QT_CLASS_LIB(QDomEntityReference, QtXml, qdom.h)
+QT_CLASS_LIB(QDomProcessingInstruction, QtXml, qdom.h)
+QT_CLASS_LIB(QXmlNamespaceSupport, QtXml, qxml.h)
+QT_CLASS_LIB(QXmlAttributes, QtXml, qxml.h)
+QT_CLASS_LIB(QXmlInputSource, QtXml, qxml.h)
+QT_CLASS_LIB(QXmlParseException, QtXml, qxml.h)
+QT_CLASS_LIB(QXmlReader, QtXml, qxml.h)
+QT_CLASS_LIB(QXmlSimpleReader, QtXml, qxml.h)
+QT_CLASS_LIB(QXmlLocator, QtXml, qxml.h)
+QT_CLASS_LIB(QXmlContentHandler, QtXml, qxml.h)
+QT_CLASS_LIB(QXmlErrorHandler, QtXml, qxml.h)
+QT_CLASS_LIB(QXmlDTDHandler, QtXml, qxml.h)
+QT_CLASS_LIB(QXmlEntityResolver, QtXml, qxml.h)
+QT_CLASS_LIB(QXmlLexicalHandler, QtXml, qxml.h)
+QT_CLASS_LIB(QXmlDeclHandler, QtXml, qxml.h)
+QT_CLASS_LIB(QXmlDefaultHandler, QtXml, qxml.h)
+QT_CLASS_LIB(QXmlStreamAttribute, QtXml, qxmlstream.h)
+QT_CLASS_LIB(QXmlStreamAttributes, QtXml, qxmlstream.h)
+QT_CLASS_LIB(QXmlStreamEntityDeclaration, QtXml, qxmlstream.h)
+QT_CLASS_LIB(QXmlStreamEntityDeclarations, QtXml, qxmlstream.h)
+QT_CLASS_LIB(QXmlStreamEntityResolver, QtXml, qxmlstream.h)
+QT_CLASS_LIB(QXmlStreamNamespaceDeclaration, QtXml, qxmlstream.h)
+QT_CLASS_LIB(QXmlStreamNamespaceDeclarations, QtXml, qxmlstream.h)
+QT_CLASS_LIB(QXmlStreamNotationDeclaration, QtXml, qxmlstream.h)
+QT_CLASS_LIB(QXmlStreamNotationDeclarations, QtXml, qxmlstream.h)
+QT_CLASS_LIB(QXmlStreamReader, QtXml, qxmlstream.h)
+QT_CLASS_LIB(QXmlStreamStringRef, QtXml, qxmlstream.h)
+QT_CLASS_LIB(QXmlStreamWriter, QtXml, qxmlstream.h)
+QT_CLASS_LIB(QFtp, QtNetwork, qftp.h)
+QT_CLASS_LIB(QHttpHeader, QtNetwork, qhttp.h)
+QT_CLASS_LIB(QHttpResponseHeader, QtNetwork, qhttp.h)
+QT_CLASS_LIB(QHttpRequestHeader, QtNetwork, qhttp.h)
+QT_CLASS_LIB(QHttp, QtNetwork, qhttp.h)
+QT_CLASS_LIB(QNetworkAccessManager, QtNetwork, qnetworkaccessmanager.h)
+QT_CLASS_LIB(QNetworkCookie, QtNetwork, qnetworkcookie.h)
+QT_CLASS_LIB(QNetworkCookieJar, QtNetwork, qnetworkcookie.h)
+QT_CLASS_LIB(QNetworkReply, QtNetwork, qnetworkreply.h)
+QT_CLASS_LIB(QNetworkRequest, QtNetwork, qnetworkrequest.h)
+QT_CLASS_LIB(QAuthenticator, QtNetwork, qauthenticator.h)
+QT_CLASS_LIB(QIPv6Address, QtNetwork, qhostaddress.h)
+QT_CLASS_LIB(Q_IPV6ADDR, QtNetwork, qhostaddress.h)
+QT_CLASS_LIB(QHostAddress, QtNetwork, qhostaddress.h)
+QT_CLASS_LIB(QHostInfo, QtNetwork, qhostinfo.h)
+QT_CLASS_LIB(QNetworkAddressEntry, QtNetwork, qnetworkinterface.h)
+QT_CLASS_LIB(QNetworkInterface, QtNetwork, qnetworkinterface.h)
+QT_CLASS_LIB(QNetworkProxy, QtNetwork, qnetworkproxy.h)
+QT_CLASS_LIB(QUrlInfo, QtNetwork, qurlinfo.h)
+QT_CLASS_LIB(QAbstractSocket, QtNetwork, qabstractsocket.h)
+QT_CLASS_LIB(QLocalServer, QtNetwork, qlocalserver.h)
+QT_CLASS_LIB(QLocalSocket, QtNetwork, qlocalsocket.h)
+QT_CLASS_LIB(QTcpServer, QtNetwork, qtcpserver.h)
+QT_CLASS_LIB(QTcpSocket, QtNetwork, qtcpsocket.h)
+QT_CLASS_LIB(QUdpSocket, QtNetwork, qudpsocket.h)
+QT_CLASS_LIB(QSsl, QtNetwork, qssl.h)
+QT_CLASS_LIB(QSslCertificate, QtNetwork, qsslcertificate.h)
+QT_CLASS_LIB(QSslCipher, QtNetwork, qsslcipher.h)
+QT_CLASS_LIB(QSslConfiguration, QtNetwork, qsslconfiguration.h)
+QT_CLASS_LIB(QSslError, QtNetwork, qsslerror.h)
+QT_CLASS_LIB(QSslKey, QtNetwork, qsslkey.h)
+QT_CLASS_LIB(QSslSocket, QtNetwork, qsslsocket.h)
+QT_CLASS_LIB(QHelpGlobal, QtHelp, qhelp_global.h)
+QT_CLASS_LIB(QHelpContentItem, QtHelp, qhelpcontentwidget.h)
+QT_CLASS_LIB(QHelpContentModel, QtHelp, qhelpcontentwidget.h)
+QT_CLASS_LIB(QHelpContentWidget, QtHelp, qhelpcontentwidget.h)
+QT_CLASS_LIB(QHelpEngine, QtHelp, qhelpengine.h)
+QT_CLASS_LIB(QHelpEngineCore, QtHelp, qhelpenginecore.h)
+QT_CLASS_LIB(QHelpIndexModel, QtHelp, qhelpindexwidget.h)
+QT_CLASS_LIB(QHelpIndexWidget, QtHelp, qhelpindexwidget.h)
+QT_CLASS_LIB(QHelpSearchQuery, QtHelp, qhelpsearchengine.h)
+QT_CLASS_LIB(QHelpSearchEngine, QtHelp, qhelpsearchengine.h)
+QT_CLASS_LIB(QHelpSearchQueryWidget, QtHelp, qhelpsearchquerywidget.h)
+QT_CLASS_LIB(QHelpSearchResultWidget, QtHelp, qhelpsearchresultwidget.h)
+QT_CLASS_LIB(QAssistantClient, QtAssistant, qassistantclient.h)
+QT_CLASS_LIB(QAbstractMessageHandler, QtXmlPatterns, qabstractmessagehandler.h)
+QT_CLASS_LIB(QAbstractUriResolver, QtXmlPatterns, qabstracturiresolver.h)
+QT_CLASS_LIB(QXmlNodeModelIndex, QtXmlPatterns, qabstractxmlnodemodel.h)
+QT_CLASS_LIB(QAbstractXmlNodeModel, QtXmlPatterns, qabstractxmlnodemodel.h)
+QT_CLASS_LIB(QXmlItem, QtXmlPatterns, qabstractxmlnodemodel.h)
+QT_CLASS_LIB(QAbstractXmlReceiver, QtXmlPatterns, qabstractxmlreceiver.h)
+QT_CLASS_LIB(QSimpleXmlNodeModel, QtXmlPatterns, qsimplexmlnodemodel.h)
+QT_CLASS_LIB(QSourceLocation, QtXmlPatterns, qsourcelocation.h)
+QT_CLASS_LIB(QXmlFormatter, QtXmlPatterns, qxmlformatter.h)
+QT_CLASS_LIB(QXmlName, QtXmlPatterns, qxmlname.h)
+QT_CLASS_LIB(QXmlNamePool, QtXmlPatterns, qxmlnamepool.h)
+QT_CLASS_LIB(QXmlQuery, QtXmlPatterns, qxmlquery.h)
+QT_CLASS_LIB(QXmlResultItems, QtXmlPatterns, qxmlresultitems.h)
+QT_CLASS_LIB(QXmlSerializer, QtXmlPatterns, qxmlserializer.h)
+QT_CLASS_LIB(QWebHitTestResult, QtWebKit, qwebframe.h)
+QT_CLASS_LIB(QWebFrame, QtWebKit, qwebframe.h)
+QT_CLASS_LIB(QWebHistoryItem, QtWebKit, qwebhistory.h)
+QT_CLASS_LIB(QWebHistory, QtWebKit, qwebhistory.h)
+QT_CLASS_LIB(QWebHistoryInterface, QtWebKit, qwebhistoryinterface.h)
+QT_CLASS_LIB(QWebPage, QtWebKit, qwebpage.h)
+QT_CLASS_LIB(QWebPluginFactory, QtWebKit, qwebpluginfactory.h)
+QT_CLASS_LIB(QWebSettings, QtWebKit, qwebsettings.h)
+QT_CLASS_LIB(QWebView, QtWebKit, qwebview.h)
+QT_CLASS_LIB(QSignalSpy, QtTest, qsignalspy.h)
+QT_CLASS_LIB(QTest, QtTest, qtest.h)
+QT_CLASS_LIB(QTestAccessibilityEvent, QtTest, qtestaccessible.h)
+QT_CLASS_LIB(QTestAccessibility, QtTest, qtestaccessible.h)
+QT_CLASS_LIB(QTestData, QtTest, qtestdata.h)
+QT_CLASS_LIB(QTestEvent, QtTest, qtestevent.h)
+QT_CLASS_LIB(QTestKeyEvent, QtTest, qtestevent.h)
+QT_CLASS_LIB(QTestKeyClicksEvent, QtTest, qtestevent.h)
+QT_CLASS_LIB(QTestMouseEvent, QtTest, qtestevent.h)
+QT_CLASS_LIB(QTestDelayEvent, QtTest, qtestevent.h)
+QT_CLASS_LIB(QTestEventList, QtTest, qtestevent.h)
+QT_CLASS_LIB(QTestEventLoop, QtTest, qtesteventloop.h)
+QT_CLASS_LIB(QEventSizeOfChecker, QtTest, qtestspontaneevent.h)
+QT_CLASS_LIB(QEventSizeOfChecker, QtTest, qtestspontaneevent.h)
+QT_CLASS_LIB(QSpontaneKeyEvent, QtTest, qtestspontaneevent.h)
+QT_CLASS_LIB(QDBusAbstractAdaptor, QtDBus, qdbusabstractadaptor.h)
+QT_CLASS_LIB(QDBusAbstractInterface, QtDBus, qdbusabstractinterface.h)
+QT_CLASS_LIB(QDBusArgument, QtDBus, qdbusargument.h)
+QT_CLASS_LIB(QDBusConnection, QtDBus, qdbusconnection.h)
+QT_CLASS_LIB(QDBusConnectionInterface, QtDBus, qdbusconnectioninterface.h)
+QT_CLASS_LIB(QDBusContext, QtDBus, qdbuscontext.h)
+QT_CLASS_LIB(QDBusError, QtDBus, qdbuserror.h)
+QT_CLASS_LIB(QDBusObjectPath, QtDBus, qdbusextratypes.h)
+QT_CLASS_LIB(QDBusSignature, QtDBus, qdbusextratypes.h)
+QT_CLASS_LIB(QDBusVariant, QtDBus, qdbusextratypes.h)
+QT_CLASS_LIB(QDBusInterface, QtDBus, qdbusinterface.h)
+QT_CLASS_LIB(QDBusMessage, QtDBus, qdbusmessage.h)
+QT_CLASS_LIB(QDBusMetaType, QtDBus, qdbusmetatype.h)
+QT_CLASS_LIB(QDBusReply, QtDBus, qdbusreply.h)
+QT_CLASS_LIB(QDBusReply, QtDBus, qdbusreply.h)
+QT_CLASS_LIB(QDBusServer, QtDBus, qdbusserver.h)
+QT_CLASS_LIB(QScriptable, QtScript, qscriptable.h)
+QT_CLASS_LIB(QScriptClass, QtScript, qscriptclass.h)
+QT_CLASS_LIB(QScriptClassPropertyIterator, QtScript, qscriptclasspropertyiterator.h)
+QT_CLASS_LIB(QScriptContext, QtScript, qscriptcontext.h)
+QT_CLASS_LIB(QScriptContextInfo, QtScript, qscriptcontextinfo.h)
+QT_CLASS_LIB(QScriptContextInfoList, QtScript, qscriptcontextinfo.h)
+QT_CLASS_LIB(QScriptEngine, QtScript, qscriptengine.h)
+QT_CLASS_LIB(QScriptEngineAgent, QtScript, qscriptengineagent.h)
+QT_CLASS_LIB(QScriptExtensionInterface, QtScript, qscriptextensioninterface.h)
+QT_CLASS_LIB(QScriptExtensionPlugin, QtScript, qscriptextensionplugin.h)
+QT_CLASS_LIB(QScriptString, QtScript, qscriptstring.h)
+QT_CLASS_LIB(QScriptValueList, QtScript, qscriptvalue.h)
+QT_CLASS_LIB(QScriptValue, QtScript, qscriptvalue.h)
+QT_CLASS_LIB(QScriptValueIterator, QtScript, qscriptvalueiterator.h)
+QT_CLASS_LIB(QSqlDriverCreatorBase, QtSql, qsqldatabase.h)
+QT_CLASS_LIB(QSqlDriverCreator, QtSql, qsqldatabase.h)
+QT_CLASS_LIB(QSqlDatabase, QtSql, qsqldatabase.h)
+QT_CLASS_LIB(QSqlDriver, QtSql, qsqldriver.h)
+QT_CLASS_LIB(QSqlDriverFactoryInterface, QtSql, qsqldriverplugin.h)
+QT_CLASS_LIB(QSqlDriverPlugin, QtSql, qsqldriverplugin.h)
+QT_CLASS_LIB(QSqlError, QtSql, qsqlerror.h)
+QT_CLASS_LIB(QSqlField, QtSql, qsqlfield.h)
+QT_CLASS_LIB(QSqlIndex, QtSql, qsqlindex.h)
+QT_CLASS_LIB(QSqlQuery, QtSql, qsqlquery.h)
+QT_CLASS_LIB(QSqlRecord, QtSql, qsqlrecord.h)
+QT_CLASS_LIB(QSqlResult, QtSql, qsqlresult.h)
+QT_CLASS_LIB(QSqlQueryModel, QtSql, qsqlquerymodel.h)
+QT_CLASS_LIB(QSqlRelationalDelegate, QtSql, qsqlrelationaldelegate.h)
+QT_CLASS_LIB(QSqlRelation, QtSql, qsqlrelationaltablemodel.h)
+QT_CLASS_LIB(QSqlRelationalTableModel, QtSql, qsqlrelationaltablemodel.h)
+QT_CLASS_LIB(QSqlTableModel, QtSql, qsqltablemodel.h)
+QT_CLASS_LIB(QDB2Result, QtSql, qsql_db2.h)
+QT_CLASS_LIB(QDB2Driver, QtSql, qsql_db2.h)
+QT_CLASS_LIB(QIBaseResult, QtSql, qsql_ibase.h)
+QT_CLASS_LIB(QIBaseDriver, QtSql, qsql_ibase.h)
+QT_CLASS_LIB(QMYSQLResult, QtSql, qsql_mysql.h)
+QT_CLASS_LIB(QMYSQLDriver, QtSql, qsql_mysql.h)
+QT_CLASS_LIB(QOCIResult, QtSql, qsql_oci.h)
+QT_CLASS_LIB(QOCIDriver, QtSql, qsql_oci.h)
+QT_CLASS_LIB(QODBCResult, QtSql, qsql_odbc.h)
+QT_CLASS_LIB(QODBCDriver, QtSql, qsql_odbc.h)
+QT_CLASS_LIB(QPSQLResult, QtSql, qsql_psql.h)
+QT_CLASS_LIB(QPSQLDriver, QtSql, qsql_psql.h)
+QT_CLASS_LIB(QSQLiteResult, QtSql, qsql_sqlite.h)
+QT_CLASS_LIB(QSQLiteDriver, QtSql, qsql_sqlite.h)
+QT_CLASS_LIB(QSQLite2Result, QtSql, qsql_sqlite2.h)
+QT_CLASS_LIB(QSQLite2Driver, QtSql, qsql_sqlite2.h)
+QT_CLASS_LIB(QTDSResult, QtSql, qsql_tds.h)
+QT_CLASS_LIB(QTDSDriver, QtSql, qsql_tds.h)
+QT_CLASS_LIB(QAccessible, QtGui, qaccessible.h)
+QT_CLASS_LIB(QAccessibleInterface, QtGui, qaccessible.h)
+QT_CLASS_LIB(QAccessibleInterfaceEx, QtGui, qaccessible.h)
+QT_CLASS_LIB(QAccessibleEvent, QtGui, qaccessible.h)
+QT_CLASS_LIB(QAccessible2Interface, QtGui, qaccessible2.h)
+QT_CLASS_LIB(QAccessibleTextInterface, QtGui, qaccessible2.h)
+QT_CLASS_LIB(QAccessibleEditableTextInterface, QtGui, qaccessible2.h)
+QT_CLASS_LIB(QAccessibleSimpleEditableTextInterface, QtGui, qaccessible2.h)
+QT_CLASS_LIB(QAccessibleValueInterface, QtGui, qaccessible2.h)
+QT_CLASS_LIB(QAccessibleTableInterface, QtGui, qaccessible2.h)
+QT_CLASS_LIB(QAccessibleBridge, QtGui, qaccessiblebridge.h)
+QT_CLASS_LIB(QAccessibleBridgeFactoryInterface, QtGui, qaccessiblebridge.h)
+QT_CLASS_LIB(QAccessibleBridgePlugin, QtGui, qaccessiblebridge.h)
+QT_CLASS_LIB(QAccessibleObject, QtGui, qaccessibleobject.h)
+QT_CLASS_LIB(QAccessibleObjectEx, QtGui, qaccessibleobject.h)
+QT_CLASS_LIB(QAccessibleApplication, QtGui, qaccessibleobject.h)
+QT_CLASS_LIB(QAccessibleFactoryInterface, QtGui, qaccessibleplugin.h)
+QT_CLASS_LIB(QAccessiblePlugin, QtGui, qaccessibleplugin.h)
+QT_CLASS_LIB(QAccessibleWidget, QtGui, qaccessiblewidget.h)
+QT_CLASS_LIB(QAccessibleWidgetEx, QtGui, qaccessiblewidget.h)
+QT_CLASS_LIB(QAbstractPageSetupDialog, QtGui, qabstractpagesetupdialog.h)
+QT_CLASS_LIB(QAbstractPrintDialog, QtGui, qabstractprintdialog.h)
+QT_CLASS_LIB(QColorDialog, QtGui, qcolordialog.h)
+QT_CLASS_LIB(QDialog, QtGui, qdialog.h)
+QT_CLASS_LIB(QErrorMessage, QtGui, qerrormessage.h)
+QT_CLASS_LIB(QFileDialog, QtGui, qfiledialog.h)
+QT_CLASS_LIB(QFileSystemModel, QtGui, qfilesystemmodel.h)
+QT_CLASS_LIB(QFontDialog, QtGui, qfontdialog.h)
+QT_CLASS_LIB(QInputDialog, QtGui, qinputdialog.h)
+QT_CLASS_LIB(QMessageBox, QtGui, qmessagebox.h)
+QT_CLASS_LIB(QPageSetupDialog, QtGui, qpagesetupdialog.h)
+QT_CLASS_LIB(QUnixPrintWidget, QtGui, qprintdialog.h)
+QT_CLASS_LIB(QPrintDialog, QtGui, qprintdialog.h)
+QT_CLASS_LIB(QPrintPreviewDialog, QtGui, qprintpreviewdialog.h)
+QT_CLASS_LIB(QProgressDialog, QtGui, qprogressdialog.h)
+QT_CLASS_LIB(QWizard, QtGui, qwizard.h)
+QT_CLASS_LIB(QWizardPage, QtGui, qwizard.h)
+QT_CLASS_LIB(QGraphicsGridLayout, QtGui, qgraphicsgridlayout.h)
+QT_CLASS_LIB(QGraphicsItem, QtGui, qgraphicsitem.h)
+QT_CLASS_LIB(QAbstractGraphicsShapeItem, QtGui, qgraphicsitem.h)
+QT_CLASS_LIB(QGraphicsPathItem, QtGui, qgraphicsitem.h)
+QT_CLASS_LIB(QGraphicsRectItem, QtGui, qgraphicsitem.h)
+QT_CLASS_LIB(QGraphicsEllipseItem, QtGui, qgraphicsitem.h)
+QT_CLASS_LIB(QGraphicsPolygonItem, QtGui, qgraphicsitem.h)
+QT_CLASS_LIB(QGraphicsLineItem, QtGui, qgraphicsitem.h)
+QT_CLASS_LIB(QGraphicsPixmapItem, QtGui, qgraphicsitem.h)
+QT_CLASS_LIB(QGraphicsTextItem, QtGui, qgraphicsitem.h)
+QT_CLASS_LIB(QGraphicsSimpleTextItem, QtGui, qgraphicsitem.h)
+QT_CLASS_LIB(QGraphicsItemGroup, QtGui, qgraphicsitem.h)
+QT_CLASS_LIB(QGraphicsItemAnimation, QtGui, qgraphicsitemanimation.h)
+QT_CLASS_LIB(QGraphicsLayout, QtGui, qgraphicslayout.h)
+QT_CLASS_LIB(QGraphicsLayoutItem, QtGui, qgraphicslayoutitem.h)
+QT_CLASS_LIB(QGraphicsLinearLayout, QtGui, qgraphicslinearlayout.h)
+QT_CLASS_LIB(QGraphicsProxyWidget, QtGui, qgraphicsproxywidget.h)
+QT_CLASS_LIB(QGraphicsScene, QtGui, qgraphicsscene.h)
+QT_CLASS_LIB(QGraphicsSceneEvent, QtGui, qgraphicssceneevent.h)
+QT_CLASS_LIB(QGraphicsSceneMouseEvent, QtGui, qgraphicssceneevent.h)
+QT_CLASS_LIB(QGraphicsSceneWheelEvent, QtGui, qgraphicssceneevent.h)
+QT_CLASS_LIB(QGraphicsSceneContextMenuEvent, QtGui, qgraphicssceneevent.h)
+QT_CLASS_LIB(QGraphicsSceneHoverEvent, QtGui, qgraphicssceneevent.h)
+QT_CLASS_LIB(QGraphicsSceneHelpEvent, QtGui, qgraphicssceneevent.h)
+QT_CLASS_LIB(QGraphicsSceneDragDropEvent, QtGui, qgraphicssceneevent.h)
+QT_CLASS_LIB(QGraphicsSceneResizeEvent, QtGui, qgraphicssceneevent.h)
+QT_CLASS_LIB(QGraphicsSceneMoveEvent, QtGui, qgraphicssceneevent.h)
+QT_CLASS_LIB(QGraphicsView, QtGui, qgraphicsview.h)
+QT_CLASS_LIB(QGraphicsWidget, QtGui, qgraphicswidget.h)
+QT_CLASS_LIB(QBitmap, QtGui, qbitmap.h)
+QT_CLASS_LIB(QIcon, QtGui, qicon.h)
+QT_CLASS_LIB(QIconSet, QtGui, qicon.h)
+QT_CLASS_LIB(QIconEngine, QtGui, qiconengine.h)
+QT_CLASS_LIB(QIconEngineV2, QtGui, qiconengine.h)
+QT_CLASS_LIB(QIconEngineFactoryInterface, QtGui, qiconengineplugin.h)
+QT_CLASS_LIB(QIconEnginePlugin, QtGui, qiconengineplugin.h)
+QT_CLASS_LIB(QIconEngineFactoryInterfaceV2, QtGui, qiconengineplugin.h)
+QT_CLASS_LIB(QIconEnginePluginV2, QtGui, qiconengineplugin.h)
+QT_CLASS_LIB(QImageTextKeyLang, QtGui, qimage.h)
+QT_CLASS_LIB(QImage, QtGui, qimage.h)
+QT_CLASS_LIB(QImageIOHandler, QtGui, qimageiohandler.h)
+QT_CLASS_LIB(QImageIOHandlerFactoryInterface, QtGui, qimageiohandler.h)
+QT_CLASS_LIB(QImageIOPlugin, QtGui, qimageiohandler.h)
+QT_CLASS_LIB(QImageReader, QtGui, qimagereader.h)
+QT_CLASS_LIB(QImageWriter, QtGui, qimagewriter.h)
+QT_CLASS_LIB(QMovie, QtGui, qmovie.h)
+QT_CLASS_LIB(QPicture, QtGui, qpicture.h)
+QT_CLASS_LIB(QPictureIO, QtGui, qpicture.h)
+QT_CLASS_LIB(QPictureFormatInterface, QtGui, qpictureformatplugin.h)
+QT_CLASS_LIB(QPictureFormatPlugin, QtGui, qpictureformatplugin.h)
+QT_CLASS_LIB(QPixmap, QtGui, qpixmap.h)
+QT_CLASS_LIB(QPixmapCache, QtGui, qpixmapcache.h)
+QT_CLASS_LIB(QInputContext, QtGui, qinputcontext.h)
+QT_CLASS_LIB(QInputContextFactory, QtGui, qinputcontextfactory.h)
+QT_CLASS_LIB(QInputContextFactoryInterface, QtGui, qinputcontextplugin.h)
+QT_CLASS_LIB(QInputContextPlugin, QtGui, qinputcontextplugin.h)
+QT_CLASS_LIB(QAbstractItemDelegate, QtGui, qabstractitemdelegate.h)
+QT_CLASS_LIB(QAbstractItemView, QtGui, qabstractitemview.h)
+QT_CLASS_LIB(QAbstractProxyModel, QtGui, qabstractproxymodel.h)
+QT_CLASS_LIB(QColumnView, QtGui, qcolumnview.h)
+QT_CLASS_LIB(QDataWidgetMapper, QtGui, qdatawidgetmapper.h)
+QT_CLASS_LIB(QDirModel, QtGui, qdirmodel.h)
+QT_CLASS_LIB(QFileIconProvider, QtGui, qfileiconprovider.h)
+QT_CLASS_LIB(QHeaderView, QtGui, qheaderview.h)
+QT_CLASS_LIB(QItemDelegate, QtGui, qitemdelegate.h)
+QT_CLASS_LIB(QItemEditorCreatorBase, QtGui, qitemeditorfactory.h)
+QT_CLASS_LIB(QItemEditorCreator, QtGui, qitemeditorfactory.h)
+QT_CLASS_LIB(QStandardItemEditorCreator, QtGui, qitemeditorfactory.h)
+QT_CLASS_LIB(QItemEditorFactory, QtGui, qitemeditorfactory.h)
+QT_CLASS_LIB(QItemSelectionRange, QtGui, qitemselectionmodel.h)
+QT_CLASS_LIB(QItemSelectionModel, QtGui, qitemselectionmodel.h)
+QT_CLASS_LIB(QItemSelection, QtGui, qitemselectionmodel.h)
+QT_CLASS_LIB(QListView, QtGui, qlistview.h)
+QT_CLASS_LIB(QListWidgetItem, QtGui, qlistwidget.h)
+QT_CLASS_LIB(QListWidget, QtGui, qlistwidget.h)
+QT_CLASS_LIB(QProxyModel, QtGui, qproxymodel.h)
+QT_CLASS_LIB(QSortFilterProxyModel, QtGui, qsortfilterproxymodel.h)
+QT_CLASS_LIB(QStandardItem, QtGui, qstandarditemmodel.h)
+QT_CLASS_LIB(QStandardItemModel, QtGui, qstandarditemmodel.h)
+QT_CLASS_LIB(QStringListModel, QtGui, qstringlistmodel.h)
+QT_CLASS_LIB(QStyledItemDelegate, QtGui, qstyleditemdelegate.h)
+QT_CLASS_LIB(QTableView, QtGui, qtableview.h)
+QT_CLASS_LIB(QTableWidgetSelectionRange, QtGui, qtablewidget.h)
+QT_CLASS_LIB(QTableWidgetItem, QtGui, qtablewidget.h)
+QT_CLASS_LIB(QTableWidget, QtGui, qtablewidget.h)
+QT_CLASS_LIB(QTreeView, QtGui, qtreeview.h)
+QT_CLASS_LIB(QTreeWidgetItem, QtGui, qtreewidget.h)
+QT_CLASS_LIB(QTreeWidget, QtGui, qtreewidget.h)
+QT_CLASS_LIB(QTreeWidgetItemIterator, QtGui, qtreewidgetitemiterator.h)
+QT_CLASS_LIB(QAction, QtGui, qaction.h)
+QT_CLASS_LIB(QActionGroup, QtGui, qactiongroup.h)
+QT_CLASS_LIB(QApplication, QtGui, qapplication.h)
+QT_CLASS_LIB(QBoxLayout, QtGui, qboxlayout.h)
+QT_CLASS_LIB(QHBoxLayout, QtGui, qboxlayout.h)
+QT_CLASS_LIB(QVBoxLayout, QtGui, qboxlayout.h)
+QT_CLASS_LIB(QClipboard, QtGui, qclipboard.h)
+QT_CLASS_LIB(QCursor, QtGui, qcursor.h)
+QT_CLASS_LIB(QCursor, QtGui, qcursor.h)
+QT_CLASS_LIB(QCursorShape, QtGui, qcursor.h)
+QT_CLASS_LIB(QDesktopWidget, QtGui, qdesktopwidget.h)
+QT_CLASS_LIB(QDrag, QtGui, qdrag.h)
+QT_CLASS_LIB(QtEvents, QtGui, qevent.h)
+QT_CLASS_LIB(QInputEvent, QtGui, qevent.h)
+QT_CLASS_LIB(QMouseEvent, QtGui, qevent.h)
+QT_CLASS_LIB(QHoverEvent, QtGui, qevent.h)
+QT_CLASS_LIB(QWheelEvent, QtGui, qevent.h)
+QT_CLASS_LIB(QTabletEvent, QtGui, qevent.h)
+QT_CLASS_LIB(QKeyEvent, QtGui, qevent.h)
+QT_CLASS_LIB(QFocusEvent, QtGui, qevent.h)
+QT_CLASS_LIB(QPaintEvent, QtGui, qevent.h)
+QT_CLASS_LIB(QUpdateLaterEvent, QtGui, qevent.h)
+QT_CLASS_LIB(QMoveEvent, QtGui, qevent.h)
+QT_CLASS_LIB(QResizeEvent, QtGui, qevent.h)
+QT_CLASS_LIB(QCloseEvent, QtGui, qevent.h)
+QT_CLASS_LIB(QIconDragEvent, QtGui, qevent.h)
+QT_CLASS_LIB(QShowEvent, QtGui, qevent.h)
+QT_CLASS_LIB(QHideEvent, QtGui, qevent.h)
+QT_CLASS_LIB(QContextMenuEvent, QtGui, qevent.h)
+QT_CLASS_LIB(QInputMethodEvent, QtGui, qevent.h)
+QT_CLASS_LIB(QDropEvent, QtGui, qevent.h)
+QT_CLASS_LIB(QDragMoveEvent, QtGui, qevent.h)
+QT_CLASS_LIB(QDragEnterEvent, QtGui, qevent.h)
+QT_CLASS_LIB(QDragResponseEvent, QtGui, qevent.h)
+QT_CLASS_LIB(QDragLeaveEvent, QtGui, qevent.h)
+QT_CLASS_LIB(QHelpEvent, QtGui, qevent.h)
+QT_CLASS_LIB(QStatusTipEvent, QtGui, qevent.h)
+QT_CLASS_LIB(QWhatsThisClickedEvent, QtGui, qevent.h)
+QT_CLASS_LIB(QActionEvent, QtGui, qevent.h)
+QT_CLASS_LIB(QFileOpenEvent, QtGui, qevent.h)
+QT_CLASS_LIB(QToolBarChangeEvent, QtGui, qevent.h)
+QT_CLASS_LIB(QShortcutEvent, QtGui, qevent.h)
+QT_CLASS_LIB(QClipboardEvent, QtGui, qevent.h)
+QT_CLASS_LIB(QWindowStateChangeEvent, QtGui, qevent.h)
+QT_CLASS_LIB(QMenubarUpdatedEvent, QtGui, qevent.h)
+QT_CLASS_LIB(QFormLayout, QtGui, qformlayout.h)
+QT_CLASS_LIB(QGridLayout, QtGui, qgridlayout.h)
+QT_CLASS_LIB(QKeySequence, QtGui, qkeysequence.h)
+QT_CLASS_LIB(QKeySequence, QtGui, qkeysequence.h)
+QT_CLASS_LIB(QLayoutIterator, QtGui, qlayout.h)
+QT_CLASS_LIB(QLayout, QtGui, qlayout.h)
+QT_CLASS_LIB(QLayoutItem, QtGui, qlayoutitem.h)
+QT_CLASS_LIB(QSpacerItem, QtGui, qlayoutitem.h)
+QT_CLASS_LIB(QWidgetItem, QtGui, qlayoutitem.h)
+QT_CLASS_LIB(QWidgetItemV2, QtGui, qlayoutitem.h)
+QT_CLASS_LIB(QMimeSource, QtGui, qmime.h)
+QT_CLASS_LIB(QWindowsMime, QtGui, qmime.h)
+QT_CLASS_LIB(QMacMime, QtGui, qmime.h)
+QT_CLASS_LIB(QMacPasteboardMime, QtGui, qmime.h)
+QT_CLASS_LIB(QPalette, QtGui, qpalette.h)
+QT_CLASS_LIB(QColorGroup, QtGui, qpalette.h)
+QT_CLASS_LIB(QSessionManager, QtGui, qsessionmanager.h)
+QT_CLASS_LIB(QShortcut, QtGui, qshortcut.h)
+QT_CLASS_LIB(QSizePolicy, QtGui, qsizepolicy.h)
+QT_CLASS_LIB(QSound, QtGui, qsound.h)
+QT_CLASS_LIB(QStackedLayout, QtGui, qstackedlayout.h)
+QT_CLASS_LIB(QToolTip, QtGui, qtooltip.h)
+QT_CLASS_LIB(QWhatsThis, QtGui, qwhatsthis.h)
+QT_CLASS_LIB(QWidgetData, QtGui, qwidget.h)
+QT_CLASS_LIB(QWidget, QtGui, qwidget.h)
+QT_CLASS_LIB(QWidgetAction, QtGui, qwidgetaction.h)
+QT_CLASS_LIB(QWidgetList, QtGui, qwindowdefs.h)
+QT_CLASS_LIB(QWidgetMapper, QtGui, qwindowdefs.h)
+QT_CLASS_LIB(QWidgetSet, QtGui, qwindowdefs.h)
+QT_CLASS_LIB(QX11EmbedWidget, QtGui, qx11embed_x11.h)
+QT_CLASS_LIB(QX11EmbedContainer, QtGui, qx11embed_x11.h)
+QT_CLASS_LIB(QX11Info, QtGui, qx11info_x11.h)
+QT_CLASS_LIB(QBrush, QtGui, qbrush.h)
+QT_CLASS_LIB(QBrushData, QtGui, qbrush.h)
+QT_CLASS_LIB(QGradientStop, QtGui, qbrush.h)
+QT_CLASS_LIB(QGradientStops, QtGui, qbrush.h)
+QT_CLASS_LIB(QGradient, QtGui, qbrush.h)
+QT_CLASS_LIB(QLinearGradient, QtGui, qbrush.h)
+QT_CLASS_LIB(QRadialGradient, QtGui, qbrush.h)
+QT_CLASS_LIB(QConicalGradient, QtGui, qbrush.h)
+QT_CLASS_LIB(QColor, QtGui, qcolor.h)
+QT_CLASS_LIB(QColormap, QtGui, qcolormap.h)
+QT_CLASS_LIB(QMatrix, QtGui, qmatrix.h)
+QT_CLASS_LIB(QPaintDevice, QtGui, qpaintdevice.h)
+QT_CLASS_LIB(QTextItem, QtGui, qpaintengine.h)
+QT_CLASS_LIB(QPaintEngine, QtGui, qpaintengine.h)
+QT_CLASS_LIB(QPaintEngineState, QtGui, qpaintengine.h)
+QT_CLASS_LIB(QPainter, QtGui, qpainter.h)
+QT_CLASS_LIB(QPainterPath, QtGui, qpainterpath.h)
+QT_CLASS_LIB(QPainterPathPrivate, QtGui, qpainterpath.h)
+QT_CLASS_LIB(QPainterPathStroker, QtGui, qpainterpath.h)
+QT_CLASS_LIB(QPen, QtGui, qpen.h)
+QT_CLASS_LIB(QPolygon, QtGui, qpolygon.h)
+QT_CLASS_LIB(QPolygonF, QtGui, qpolygon.h)
+QT_CLASS_LIB(QPrintEngine, QtGui, qprintengine.h)
+QT_CLASS_LIB(QPrinter, QtGui, qprinter.h)
+QT_CLASS_LIB(QPrinterInfo, QtGui, qprinterinfo.h)
+QT_CLASS_LIB(QRegion, QtGui, qregion.h)
+QT_CLASS_LIB(QRgb, QtGui, qrgb.h)
+QT_CLASS_LIB(QStylePainter, QtGui, qstylepainter.h)
+QT_CLASS_LIB(QTransform, QtGui, qtransform.h)
+QT_CLASS_LIB(QWMatrix, QtGui, qwmatrix.h)
+QT_CLASS_LIB(QCDEStyle, QtGui, qcdestyle.h)
+QT_CLASS_LIB(QCleanlooksStyle, QtGui, qcleanlooksstyle.h)
+QT_CLASS_LIB(QCommonStyle, QtGui, qcommonstyle.h)
+QT_CLASS_LIB(QMotifStyle, QtGui, qmotifstyle.h)
+QT_CLASS_LIB(QPlastiqueStyle, QtGui, qplastiquestyle.h)
+QT_CLASS_LIB(QStyle, QtGui, qstyle.h)
+QT_CLASS_LIB(QStyleFactory, QtGui, qstylefactory.h)
+QT_CLASS_LIB(QStyleOption, QtGui, qstyleoption.h)
+QT_CLASS_LIB(QStyleOptionFocusRect, QtGui, qstyleoption.h)
+QT_CLASS_LIB(QStyleOptionFrame, QtGui, qstyleoption.h)
+QT_CLASS_LIB(QStyleOptionFrameV2, QtGui, qstyleoption.h)
+QT_CLASS_LIB(QStyleOptionTabWidgetFrame, QtGui, qstyleoption.h)
+QT_CLASS_LIB(QStyleOptionTabBarBase, QtGui, qstyleoption.h)
+QT_CLASS_LIB(QStyleOptionHeader, QtGui, qstyleoption.h)
+QT_CLASS_LIB(QStyleOptionButton, QtGui, qstyleoption.h)
+QT_CLASS_LIB(QStyleOptionTab, QtGui, qstyleoption.h)
+QT_CLASS_LIB(QStyleOptionTabV2, QtGui, qstyleoption.h)
+QT_CLASS_LIB(QStyleOptionToolBar, QtGui, qstyleoption.h)
+QT_CLASS_LIB(QStyleOptionProgressBar, QtGui, qstyleoption.h)
+QT_CLASS_LIB(QStyleOptionProgressBarV2, QtGui, qstyleoption.h)
+QT_CLASS_LIB(QStyleOptionMenuItem, QtGui, qstyleoption.h)
+QT_CLASS_LIB(QStyleOptionQ3ListViewItem, QtGui, qstyleoption.h)
+QT_CLASS_LIB(QStyleOptionQ3DockWindow, QtGui, qstyleoption.h)
+QT_CLASS_LIB(QStyleOptionDockWidget, QtGui, qstyleoption.h)
+QT_CLASS_LIB(QStyleOptionDockWidgetV2, QtGui, qstyleoption.h)
+QT_CLASS_LIB(QStyleOptionViewItem, QtGui, qstyleoption.h)
+QT_CLASS_LIB(QStyleOptionViewItemV2, QtGui, qstyleoption.h)
+QT_CLASS_LIB(QStyleOptionViewItemV3, QtGui, qstyleoption.h)
+QT_CLASS_LIB(QStyleOptionViewItemV4, QtGui, qstyleoption.h)
+QT_CLASS_LIB(QStyleOptionToolBox, QtGui, qstyleoption.h)
+QT_CLASS_LIB(QStyleOptionToolBoxV2, QtGui, qstyleoption.h)
+QT_CLASS_LIB(QStyleOptionRubberBand, QtGui, qstyleoption.h)
+QT_CLASS_LIB(QStyleOptionComplex, QtGui, qstyleoption.h)
+QT_CLASS_LIB(QStyleOptionSlider, QtGui, qstyleoption.h)
+QT_CLASS_LIB(QStyleOptionSpinBox, QtGui, qstyleoption.h)
+QT_CLASS_LIB(QStyleOptionQ3ListView, QtGui, qstyleoption.h)
+QT_CLASS_LIB(QStyleOptionToolButton, QtGui, qstyleoption.h)
+QT_CLASS_LIB(QStyleOptionComboBox, QtGui, qstyleoption.h)
+QT_CLASS_LIB(QStyleOptionTitleBar, QtGui, qstyleoption.h)
+QT_CLASS_LIB(QStyleOptionGroupBox, QtGui, qstyleoption.h)
+QT_CLASS_LIB(QStyleOptionSizeGrip, QtGui, qstyleoption.h)
+QT_CLASS_LIB(QStyleOptionGraphicsItem, QtGui, qstyleoption.h)
+QT_CLASS_LIB(QStyleHintReturn, QtGui, qstyleoption.h)
+QT_CLASS_LIB(QStyleHintReturnMask, QtGui, qstyleoption.h)
+QT_CLASS_LIB(QStyleHintReturnVariant, QtGui, qstyleoption.h)
+QT_CLASS_LIB(QStyleFactoryInterface, QtGui, qstyleplugin.h)
+QT_CLASS_LIB(QStylePlugin, QtGui, qstyleplugin.h)
+QT_CLASS_LIB(QWindowsCEStyle, QtGui, qwindowscestyle.h)
+QT_CLASS_LIB(QWindowsMobileStyle, QtGui, qwindowsmobilestyle.h)
+QT_CLASS_LIB(QWindowsStyle, QtGui, qwindowsstyle.h)
+QT_CLASS_LIB(QWindowsVistaStyle, QtGui, qwindowsvistastyle.h)
+QT_CLASS_LIB(QWindowsXPStyle, QtGui, qwindowsxpstyle.h)
+QT_CLASS_LIB(QAbstractTextDocumentLayout, QtGui, qabstracttextdocumentlayout.h)
+QT_CLASS_LIB(QTextObjectInterface, QtGui, qabstracttextdocumentlayout.h)
+QT_CLASS_LIB(QFont, QtGui, qfont.h)
+QT_CLASS_LIB(QFontDatabase, QtGui, qfontdatabase.h)
+QT_CLASS_LIB(QFontInfo, QtGui, qfontinfo.h)
+QT_CLASS_LIB(QFontMetrics, QtGui, qfontmetrics.h)
+QT_CLASS_LIB(QFontMetricsF, QtGui, qfontmetrics.h)
+QT_CLASS_LIB(QSyntaxHighlighter, QtGui, qsyntaxhighlighter.h)
+QT_CLASS_LIB(QTextCursor, QtGui, qtextcursor.h)
+QT_CLASS_LIB(QAbstractUndoItem, QtGui, qtextdocument.h)
+QT_CLASS_LIB(QTextDocument, QtGui, qtextdocument.h)
+QT_CLASS_LIB(QTextDocumentFragment, QtGui, qtextdocumentfragment.h)
+QT_CLASS_LIB(QTextLength, QtGui, qtextformat.h)
+QT_CLASS_LIB(QTextFormat, QtGui, qtextformat.h)
+QT_CLASS_LIB(QTextCharFormat, QtGui, qtextformat.h)
+QT_CLASS_LIB(QTextBlockFormat, QtGui, qtextformat.h)
+QT_CLASS_LIB(QTextListFormat, QtGui, qtextformat.h)
+QT_CLASS_LIB(QTextImageFormat, QtGui, qtextformat.h)
+QT_CLASS_LIB(QTextFrameFormat, QtGui, qtextformat.h)
+QT_CLASS_LIB(QTextTableFormat, QtGui, qtextformat.h)
+QT_CLASS_LIB(QTextTableCellFormat, QtGui, qtextformat.h)
+QT_CLASS_LIB(QTextInlineObject, QtGui, qtextlayout.h)
+QT_CLASS_LIB(QTextLayout, QtGui, qtextlayout.h)
+QT_CLASS_LIB(QTextLine, QtGui, qtextlayout.h)
+QT_CLASS_LIB(QTextList, QtGui, qtextlist.h)
+QT_CLASS_LIB(QTextObject, QtGui, qtextobject.h)
+QT_CLASS_LIB(QTextBlockGroup, QtGui, qtextobject.h)
+QT_CLASS_LIB(QTextFrameLayoutData, QtGui, qtextobject.h)
+QT_CLASS_LIB(QTextFrame, QtGui, qtextobject.h)
+QT_CLASS_LIB(QTextBlockUserData, QtGui, qtextobject.h)
+QT_CLASS_LIB(QTextBlock, QtGui, qtextobject.h)
+QT_CLASS_LIB(QTextFragment, QtGui, qtextobject.h)
+QT_CLASS_LIB(QTextOption, QtGui, qtextoption.h)
+QT_CLASS_LIB(QTextTableCell, QtGui, qtexttable.h)
+QT_CLASS_LIB(QTextTable, QtGui, qtexttable.h)
+QT_CLASS_LIB(QCompleter, QtGui, qcompleter.h)
+QT_CLASS_LIB(QDesktopServices, QtGui, qdesktopservices.h)
+QT_CLASS_LIB(QSystemTrayIcon, QtGui, qsystemtrayicon.h)
+QT_CLASS_LIB(QUndoGroup, QtGui, qundogroup.h)
+QT_CLASS_LIB(QUndoCommand, QtGui, qundostack.h)
+QT_CLASS_LIB(QUndoStack, QtGui, qundostack.h)
+QT_CLASS_LIB(QUndoView, QtGui, qundoview.h)
+QT_CLASS_LIB(QAbstractButton, QtGui, qabstractbutton.h)
+QT_CLASS_LIB(QAbstractScrollArea, QtGui, qabstractscrollarea.h)
+QT_CLASS_LIB(QAbstractSlider, QtGui, qabstractslider.h)
+QT_CLASS_LIB(QAbstractSpinBox, QtGui, qabstractspinbox.h)
+QT_CLASS_LIB(QButtonGroup, QtGui, qbuttongroup.h)
+QT_CLASS_LIB(QCalendarWidget, QtGui, qcalendarwidget.h)
+QT_CLASS_LIB(QCheckBox, QtGui, qcheckbox.h)
+QT_CLASS_LIB(QComboBox, QtGui, qcombobox.h)
+QT_CLASS_LIB(QCommandLinkButton, QtGui, qcommandlinkbutton.h)
+QT_CLASS_LIB(QDateTimeEdit, QtGui, qdatetimeedit.h)
+QT_CLASS_LIB(QTimeEdit, QtGui, qdatetimeedit.h)
+QT_CLASS_LIB(QDateEdit, QtGui, qdatetimeedit.h)
+QT_CLASS_LIB(QDial, QtGui, qdial.h)
+QT_CLASS_LIB(QDialogButtonBox, QtGui, qdialogbuttonbox.h)
+QT_CLASS_LIB(QDockWidget, QtGui, qdockwidget.h)
+QT_CLASS_LIB(QFocusFrame, QtGui, qfocusframe.h)
+QT_CLASS_LIB(QFontComboBox, QtGui, qfontcombobox.h)
+QT_CLASS_LIB(QFrame, QtGui, qframe.h)
+QT_CLASS_LIB(QGroupBox, QtGui, qgroupbox.h)
+QT_CLASS_LIB(QLabel, QtGui, qlabel.h)
+QT_CLASS_LIB(QLCDNumber, QtGui, qlcdnumber.h)
+QT_CLASS_LIB(QLineEdit, QtGui, qlineedit.h)
+QT_CLASS_LIB(QMainWindow, QtGui, qmainwindow.h)
+QT_CLASS_LIB(QMdiArea, QtGui, qmdiarea.h)
+QT_CLASS_LIB(QMdiSubWindow, QtGui, qmdisubwindow.h)
+QT_CLASS_LIB(QMenu, QtGui, qmenu.h)
+QT_CLASS_LIB(QMenuBar, QtGui, qmenubar.h)
+QT_CLASS_LIB(QMenuItem, QtGui, qmenudata.h)
+QT_CLASS_LIB(QPlainTextEdit, QtGui, qplaintextedit.h)
+QT_CLASS_LIB(QPlainTextDocumentLayout, QtGui, qplaintextedit.h)
+QT_CLASS_LIB(QPrintPreviewWidget, QtGui, qprintpreviewwidget.h)
+QT_CLASS_LIB(QProgressBar, QtGui, qprogressbar.h)
+QT_CLASS_LIB(QPushButton, QtGui, qpushbutton.h)
+QT_CLASS_LIB(QRadioButton, QtGui, qradiobutton.h)
+QT_CLASS_LIB(QRubberBand, QtGui, qrubberband.h)
+QT_CLASS_LIB(QScrollArea, QtGui, qscrollarea.h)
+QT_CLASS_LIB(QScrollBar, QtGui, qscrollbar.h)
+QT_CLASS_LIB(QSizeGrip, QtGui, qsizegrip.h)
+QT_CLASS_LIB(QSlider, QtGui, qslider.h)
+QT_CLASS_LIB(QSpinBox, QtGui, qspinbox.h)
+QT_CLASS_LIB(QDoubleSpinBox, QtGui, qspinbox.h)
+QT_CLASS_LIB(QSplashScreen, QtGui, qsplashscreen.h)
+QT_CLASS_LIB(QSplitter, QtGui, qsplitter.h)
+QT_CLASS_LIB(QSplitterHandle, QtGui, qsplitter.h)
+QT_CLASS_LIB(QStackedWidget, QtGui, qstackedwidget.h)
+QT_CLASS_LIB(QStatusBar, QtGui, qstatusbar.h)
+QT_CLASS_LIB(QTabBar, QtGui, qtabbar.h)
+QT_CLASS_LIB(QTabWidget, QtGui, qtabwidget.h)
+QT_CLASS_LIB(QTextBrowser, QtGui, qtextbrowser.h)
+QT_CLASS_LIB(QTextEdit, QtGui, qtextedit.h)
+QT_CLASS_LIB(QToolBar, QtGui, qtoolbar.h)
+QT_CLASS_LIB(QToolBox, QtGui, qtoolbox.h)
+QT_CLASS_LIB(QToolButton, QtGui, qtoolbutton.h)
+QT_CLASS_LIB(QValidator, QtGui, qvalidator.h)
+QT_CLASS_LIB(QIntValidator, QtGui, qvalidator.h)
+QT_CLASS_LIB(QDoubleValidator, QtGui, qvalidator.h)
+QT_CLASS_LIB(QRegExpValidator, QtGui, qvalidator.h)
+QT_CLASS_LIB(QWorkspace, QtGui, qworkspace.h)
+QT_CLASS_LIB(QUiLoader, QtUiTools, quiloader.h)
+QT_CLASS_LIB(QDesignerComponents, QtDesigner, qdesigner_components.h)
+QT_CLASS_LIB(QExtensionFactory, QtDesigner, default_extensionfactory.h)
+QT_CLASS_LIB(QAbstractExtensionFactory, QtDesigner, extension.h)
+QT_CLASS_LIB(QAbstractExtensionManager, QtDesigner, extension.h)
+QT_CLASS_LIB(QExtensionManager, QtDesigner, qextensionmanager.h)
+QT_CLASS_LIB(QDesignerActionEditorInterface, QtDesigner, abstractactioneditor.h)
+QT_CLASS_LIB(QDesignerBrushManagerInterface, QtDesigner, abstractbrushmanager.h)
+QT_CLASS_LIB(QDesignerDnDItemInterface, QtDesigner, abstractdnditem.h)
+QT_CLASS_LIB(QDesignerFormEditorInterface, QtDesigner, abstractformeditor.h)
+QT_CLASS_LIB(QDesignerFormEditorPluginInterface, QtDesigner, abstractformeditorplugin.h)
+QT_CLASS_LIB(QDesignerFormWindowInterface, QtDesigner, abstractformwindow.h)
+QT_CLASS_LIB(QDesignerFormWindowCursorInterface, QtDesigner, abstractformwindowcursor.h)
+QT_CLASS_LIB(QDesignerFormWindowManagerInterface, QtDesigner, abstractformwindowmanager.h)
+QT_CLASS_LIB(QDesignerFormWindowToolInterface, QtDesigner, abstractformwindowtool.h)
+QT_CLASS_LIB(QDesignerIconCacheInterface, QtDesigner, abstracticoncache.h)
+QT_CLASS_LIB(QDesignerIntegrationInterface, QtDesigner, abstractintegration.h)
+QT_CLASS_LIB(QDesignerLanguageExtension, QtDesigner, abstractlanguage.h)
+QT_CLASS_LIB(QDesignerMetaDataBaseItemInterface, QtDesigner, abstractmetadatabase.h)
+QT_CLASS_LIB(QDesignerMetaDataBaseInterface, QtDesigner, abstractmetadatabase.h)
+QT_CLASS_LIB(QDesignerObjectInspectorInterface, QtDesigner, abstractobjectinspector.h)
+QT_CLASS_LIB(QDesignerPromotionInterface, QtDesigner, abstractpromotioninterface.h)
+QT_CLASS_LIB(QDesignerPropertyEditorInterface, QtDesigner, abstractpropertyeditor.h)
+QT_CLASS_LIB(QDesignerResourceBrowserInterface, QtDesigner, abstractresourcebrowser.h)
+QT_CLASS_LIB(QDesignerWidgetBoxInterface, QtDesigner, abstractwidgetbox.h)
+QT_CLASS_LIB(QDesignerWidgetDataBaseItemInterface, QtDesigner, abstractwidgetdatabase.h)
+QT_CLASS_LIB(QDesignerWidgetDataBaseInterface, QtDesigner, abstractwidgetdatabase.h)
+QT_CLASS_LIB(QDesignerWidgetFactoryInterface, QtDesigner, abstractwidgetfactory.h)
+QT_CLASS_LIB(QDesignerDynamicPropertySheetExtension, QtDesigner, dynamicpropertysheet.h)
+QT_CLASS_LIB(QDesignerExtraInfoExtension, QtDesigner, extrainfo.h)
+QT_CLASS_LIB(QDesignerLayoutDecorationExtension, QtDesigner, layoutdecoration.h)
+QT_CLASS_LIB(QDesignerMemberSheetExtension, QtDesigner, membersheet.h)
+QT_CLASS_LIB(QDesignerPropertySheetExtension, QtDesigner, propertysheet.h)
+QT_CLASS_LIB(QDesignerTaskMenuExtension, QtDesigner, taskmenu.h)
+QT_CLASS_LIB(QAbstractFormBuilder, QtDesigner, abstractformbuilder.h)
+QT_CLASS_LIB(QDesignerContainerExtension, QtDesigner, container.h)
+QT_CLASS_LIB(QDesignerCustomWidgetInterface, QtDesigner, customwidget.h)
+QT_CLASS_LIB(QDesignerCustomWidgetCollectionInterface, QtDesigner, customwidget.h)
+QT_CLASS_LIB(QFormBuilder, QtDesigner, formbuilder.h)
+QT_CLASS_LIB(QDesignerExportWidget, QtDesigner, qdesignerexportwidget.h)
+QT_CLASS_LIB(QGraphicsSvgItem, QtSvg, qgraphicssvgitem.h)
+QT_CLASS_LIB(QSvgGenerator, QtSvg, qsvggenerator.h)
+QT_CLASS_LIB(QSvgRenderer, QtSvg, qsvgrenderer.h)
+QT_CLASS_LIB(QSvgWidget, QtSvg, qsvgwidget.h)
+QT_CLASS_LIB(Q3CanvasItemList, Qt3Support, q3canvas.h)
+QT_CLASS_LIB(Q3CanvasItem, Qt3Support, q3canvas.h)
+QT_CLASS_LIB(Q3Canvas, Qt3Support, q3canvas.h)
+QT_CLASS_LIB(Q3CanvasView, Qt3Support, q3canvas.h)
+QT_CLASS_LIB(Q3CanvasPixmap, Qt3Support, q3canvas.h)
+QT_CLASS_LIB(Q3CanvasPixmapArray, Qt3Support, q3canvas.h)
+QT_CLASS_LIB(Q3CanvasSprite, Qt3Support, q3canvas.h)
+QT_CLASS_LIB(Q3CanvasPolygonalItem, Qt3Support, q3canvas.h)
+QT_CLASS_LIB(Q3CanvasRectangle, Qt3Support, q3canvas.h)
+QT_CLASS_LIB(Q3CanvasPolygon, Qt3Support, q3canvas.h)
+QT_CLASS_LIB(Q3CanvasSpline, Qt3Support, q3canvas.h)
+QT_CLASS_LIB(Q3CanvasLine, Qt3Support, q3canvas.h)
+QT_CLASS_LIB(Q3CanvasEllipse, Qt3Support, q3canvas.h)
+QT_CLASS_LIB(Q3CanvasText, Qt3Support, q3canvas.h)
+QT_CLASS_LIB(Q3FileIconProvider, Qt3Support, q3filedialog.h)
+QT_CLASS_LIB(Q3FilePreview, Qt3Support, q3filedialog.h)
+QT_CLASS_LIB(Q3FileDialog, Qt3Support, q3filedialog.h)
+QT_CLASS_LIB(Q3ProgressDialog, Qt3Support, q3progressdialog.h)
+QT_CLASS_LIB(Q3TabDialog, Qt3Support, q3tabdialog.h)
+QT_CLASS_LIB(Q3Wizard, Qt3Support, q3wizard.h)
+QT_CLASS_LIB(Q3IconDragItem, Qt3Support, q3iconview.h)
+QT_CLASS_LIB(Q3IconDrag, Qt3Support, q3iconview.h)
+QT_CLASS_LIB(Q3IconViewItem, Qt3Support, q3iconview.h)
+QT_CLASS_LIB(Q3IconView, Qt3Support, q3iconview.h)
+QT_CLASS_LIB(Q3ListBox, Qt3Support, q3listbox.h)
+QT_CLASS_LIB(Q3ListBoxItem, Qt3Support, q3listbox.h)
+QT_CLASS_LIB(Q3ListBoxText, Qt3Support, q3listbox.h)
+QT_CLASS_LIB(Q3ListBoxPixmap, Qt3Support, q3listbox.h)
+QT_CLASS_LIB(Q3ListViewItem, Qt3Support, q3listview.h)
+QT_CLASS_LIB(Q3ListView, Qt3Support, q3listview.h)
+QT_CLASS_LIB(Q3CheckListItem, Qt3Support, q3listview.h)
+QT_CLASS_LIB(Q3ListViewItemIterator, Qt3Support, q3listview.h)
+QT_CLASS_LIB(Q3TableSelection, Qt3Support, q3table.h)
+QT_CLASS_LIB(Q3TableItem, Qt3Support, q3table.h)
+QT_CLASS_LIB(Q3ComboTableItem, Qt3Support, q3table.h)
+QT_CLASS_LIB(Q3CheckTableItem, Qt3Support, q3table.h)
+QT_CLASS_LIB(Q3Table, Qt3Support, q3table.h)
+QT_CLASS_LIB(Q3Dns, Qt3Support, q3dns.h)
+QT_CLASS_LIB(Q3DnsSocket, Qt3Support, q3dns.h)
+QT_CLASS_LIB(Q3Ftp, Qt3Support, q3ftp.h)
+QT_CLASS_LIB(Q3HttpHeader, Qt3Support, q3http.h)
+QT_CLASS_LIB(Q3HttpResponseHeader, Qt3Support, q3http.h)
+QT_CLASS_LIB(Q3HttpRequestHeader, Qt3Support, q3http.h)
+QT_CLASS_LIB(Q3Http, Qt3Support, q3http.h)
+QT_CLASS_LIB(Q3LocalFs, Qt3Support, q3localfs.h)
+QT_CLASS_LIB(Q3NetworkProtocolFactoryBase, Qt3Support, q3networkprotocol.h)
+QT_CLASS_LIB(Q3NetworkProtocolFactory, Qt3Support, q3networkprotocol.h)
+QT_CLASS_LIB(Q3NetworkProtocolDict, Qt3Support, q3networkprotocol.h)
+QT_CLASS_LIB(Q3NetworkProtocol, Qt3Support, q3networkprotocol.h)
+QT_CLASS_LIB(Q3NetworkOperation, Qt3Support, q3networkprotocol.h)
+QT_CLASS_LIB(Q3ServerSocket, Qt3Support, q3serversocket.h)
+QT_CLASS_LIB(Q3Socket, Qt3Support, q3socket.h)
+QT_CLASS_LIB(Q3SocketDevice, Qt3Support, q3socketdevice.h)
+QT_CLASS_LIB(Q3Url, Qt3Support, q3url.h)
+QT_CLASS_LIB(Q3UrlOperator, Qt3Support, q3urloperator.h)
+QT_CLASS_LIB(Q3Accel, Qt3Support, q3accel.h)
+QT_CLASS_LIB(Q3BoxLayout, Qt3Support, q3boxlayout.h)
+QT_CLASS_LIB(Q3HBoxLayout, Qt3Support, q3boxlayout.h)
+QT_CLASS_LIB(Q3VBoxLayout, Qt3Support, q3boxlayout.h)
+QT_CLASS_LIB(Q3DragObject, Qt3Support, q3dragobject.h)
+QT_CLASS_LIB(Q3StoredDrag, Qt3Support, q3dragobject.h)
+QT_CLASS_LIB(Q3TextDrag, Qt3Support, q3dragobject.h)
+QT_CLASS_LIB(Q3ImageDrag, Qt3Support, q3dragobject.h)
+QT_CLASS_LIB(Q3UriDrag, Qt3Support, q3dragobject.h)
+QT_CLASS_LIB(Q3ColorDrag, Qt3Support, q3dragobject.h)
+QT_CLASS_LIB(Q3DropSite, Qt3Support, q3dropsite.h)
+QT_CLASS_LIB(Q3GridLayout, Qt3Support, q3gridlayout.h)
+QT_CLASS_LIB(Q3MimeSourceFactory, Qt3Support, q3mimefactory.h)
+QT_CLASS_LIB(Q3PolygonScanner, Qt3Support, q3polygonscanner.h)
+QT_CLASS_LIB(Q3Process, Qt3Support, q3process.h)
+QT_CLASS_LIB(Q3PaintDeviceMetrics, Qt3Support, q3paintdevicemetrics.h)
+QT_CLASS_LIB(Q3Painter, Qt3Support, q3painter.h)
+QT_CLASS_LIB(Q3Picture, Qt3Support, q3picture.h)
+QT_CLASS_LIB(Q3PointArray, Qt3Support, q3pointarray.h)
+QT_CLASS_LIB(Q3DataBrowser, Qt3Support, q3databrowser.h)
+QT_CLASS_LIB(Q3DataTable, Qt3Support, q3datatable.h)
+QT_CLASS_LIB(Q3DataView, Qt3Support, q3dataview.h)
+QT_CLASS_LIB(Q3EditorFactory, Qt3Support, q3editorfactory.h)
+QT_CLASS_LIB(Q3SqlCursor, Qt3Support, q3sqlcursor.h)
+QT_CLASS_LIB(Q3SqlEditorFactory, Qt3Support, q3sqleditorfactory.h)
+QT_CLASS_LIB(Q3SqlFieldInfo, Qt3Support, q3sqlfieldinfo.h)
+QT_CLASS_LIB(Q3SqlForm, Qt3Support, q3sqlform.h)
+QT_CLASS_LIB(Q3SqlPropertyMap, Qt3Support, q3sqlpropertymap.h)
+QT_CLASS_LIB(Q3SqlFieldInfoList, Qt3Support, q3sqlrecordinfo.h)
+QT_CLASS_LIB(Q3SqlRecordInfo, Qt3Support, q3sqlrecordinfo.h)
+QT_CLASS_LIB(Q3SqlSelectCursor, Qt3Support, q3sqlselectcursor.h)
+QT_CLASS_LIB(Q3MultiLineEdit, Qt3Support, q3multilineedit.h)
+QT_CLASS_LIB(Q3SimpleRichText, Qt3Support, q3simplerichtext.h)
+QT_CLASS_LIB(Q3StyleSheetItem, Qt3Support, q3stylesheet.h)
+QT_CLASS_LIB(Q3StyleSheet, Qt3Support, q3stylesheet.h)
+QT_CLASS_LIB(Q3SyntaxHighlighter, Qt3Support, q3syntaxhighlighter.h)
+QT_CLASS_LIB(Q3TextBrowser, Qt3Support, q3textbrowser.h)
+QT_CLASS_LIB(Q3TextEditOptimPrivate, Qt3Support, q3textedit.h)
+QT_CLASS_LIB(Q3TextEdit, Qt3Support, q3textedit.h)
+QT_CLASS_LIB(Q3TextStream, Qt3Support, q3textstream.h)
+QT_CLASS_LIB(Q3TSFUNC, Qt3Support, q3textstream.h)
+QT_CLASS_LIB(Q3TextView, Qt3Support, q3textview.h)
+QT_CLASS_LIB(Q3AsciiCache, Qt3Support, q3asciicache.h)
+QT_CLASS_LIB(Q3AsciiCacheIterator, Qt3Support, q3asciicache.h)
+QT_CLASS_LIB(Q3AsciiDict, Qt3Support, q3asciidict.h)
+QT_CLASS_LIB(Q3AsciiDictIterator, Qt3Support, q3asciidict.h)
+QT_CLASS_LIB(Q3Cache, Qt3Support, q3cache.h)
+QT_CLASS_LIB(Q3CacheIterator, Qt3Support, q3cache.h)
+QT_CLASS_LIB(Q3CleanupHandler, Qt3Support, q3cleanuphandler.h)
+QT_CLASS_LIB(Q3SingleCleanupHandler, Qt3Support, q3cleanuphandler.h)
+QT_CLASS_LIB(Q3CString, Qt3Support, q3cstring.h)
+QT_CLASS_LIB(Q3DeepCopy, Qt3Support, q3deepcopy.h)
+QT_CLASS_LIB(Q3Dict, Qt3Support, q3dict.h)
+QT_CLASS_LIB(Q3DictIterator, Qt3Support, q3dict.h)
+QT_CLASS_LIB(Q3GArray, Qt3Support, q3garray.h)
+QT_CLASS_LIB(Q3GCache, Qt3Support, q3gcache.h)
+QT_CLASS_LIB(Q3GCacheIterator, Qt3Support, q3gcache.h)
+QT_CLASS_LIB(Q3BaseBucket, Qt3Support, q3gdict.h)
+QT_CLASS_LIB(Q3StringBucket, Qt3Support, q3gdict.h)
+QT_CLASS_LIB(Q3AsciiBucket, Qt3Support, q3gdict.h)
+QT_CLASS_LIB(Q3IntBucket, Qt3Support, q3gdict.h)
+QT_CLASS_LIB(Q3PtrBucket, Qt3Support, q3gdict.h)
+QT_CLASS_LIB(Q3GDict, Qt3Support, q3gdict.h)
+QT_CLASS_LIB(Q3GDictIterator, Qt3Support, q3gdict.h)
+QT_CLASS_LIB(Q3LNode, Qt3Support, q3glist.h)
+QT_CLASS_LIB(Q3GList, Qt3Support, q3glist.h)
+QT_CLASS_LIB(Q3GListIterator, Qt3Support, q3glist.h)
+QT_CLASS_LIB(Q3GListStdIterator, Qt3Support, q3glist.h)
+QT_CLASS_LIB(Q3GVector, Qt3Support, q3gvector.h)
+QT_CLASS_LIB(Q3IntCache, Qt3Support, q3intcache.h)
+QT_CLASS_LIB(Q3IntCacheIterator, Qt3Support, q3intcache.h)
+QT_CLASS_LIB(Q3IntDict, Qt3Support, q3intdict.h)
+QT_CLASS_LIB(Q3IntDictIterator, Qt3Support, q3intdict.h)
+QT_CLASS_LIB(Q3MemArray, Qt3Support, q3memarray.h)
+QT_CLASS_LIB(Q3ObjectDictionary, Qt3Support, q3objectdict.h)
+QT_CLASS_LIB(Q3PtrCollection, Qt3Support, q3ptrcollection.h)
+QT_CLASS_LIB(Q3PtrDict, Qt3Support, q3ptrdict.h)
+QT_CLASS_LIB(Q3PtrDictIterator, Qt3Support, q3ptrdict.h)
+QT_CLASS_LIB(Q3PtrListStdIterator, Qt3Support, q3ptrlist.h)
+QT_CLASS_LIB(Q3PtrList, Qt3Support, q3ptrlist.h)
+QT_CLASS_LIB(Q3PtrListIterator, Qt3Support, q3ptrlist.h)
+QT_CLASS_LIB(Q3PtrQueue, Qt3Support, q3ptrqueue.h)
+QT_CLASS_LIB(Q3PtrStack, Qt3Support, q3ptrstack.h)
+QT_CLASS_LIB(Q3PtrVector, Qt3Support, q3ptrvector.h)
+QT_CLASS_LIB(Q3Semaphore, Qt3Support, q3semaphore.h)
+QT_CLASS_LIB(Q3Shared, Qt3Support, q3shared.h)
+QT_CLASS_LIB(Q3Signal, Qt3Support, q3signal.h)
+QT_CLASS_LIB(Q3SortedList, Qt3Support, q3sortedlist.h)
+QT_CLASS_LIB(Q3StrListIterator, Qt3Support, q3strlist.h)
+QT_CLASS_LIB(Q3StrListIterator, Qt3Support, q3strlist.h)
+QT_CLASS_LIB(Q3StrList, Qt3Support, q3strlist.h)
+QT_CLASS_LIB(Q3StrIList, Qt3Support, q3strlist.h)
+QT_CLASS_LIB(Q3StrVec, Qt3Support, q3strvec.h)
+QT_CLASS_LIB(Q3StrIVec, Qt3Support, q3strvec.h)
+QT_CLASS_LIB(Q3ValueListIterator, Qt3Support, q3valuelist.h)
+QT_CLASS_LIB(Q3ValueListConstIterator, Qt3Support, q3valuelist.h)
+QT_CLASS_LIB(Q3ValueList, Qt3Support, q3valuelist.h)
+QT_CLASS_LIB(Q3ValueStack, Qt3Support, q3valuestack.h)
+QT_CLASS_LIB(Q3ValueVector, Qt3Support, q3valuevector.h)
+QT_CLASS_LIB(Q3Action, Qt3Support, q3action.h)
+QT_CLASS_LIB(Q3ActionGroup, Qt3Support, q3action.h)
+QT_CLASS_LIB(Q3Button, Qt3Support, q3button.h)
+QT_CLASS_LIB(Q3ButtonGroup, Qt3Support, q3buttongroup.h)
+QT_CLASS_LIB(Q3VButtonGroup, Qt3Support, q3buttongroup.h)
+QT_CLASS_LIB(Q3HButtonGroup, Qt3Support, q3buttongroup.h)
+QT_CLASS_LIB(Q3ComboBox, Qt3Support, q3combobox.h)
+QT_CLASS_LIB(Q3DateTimeEditBase, Qt3Support, q3datetimeedit.h)
+QT_CLASS_LIB(Q3DateEdit, Qt3Support, q3datetimeedit.h)
+QT_CLASS_LIB(Q3TimeEdit, Qt3Support, q3datetimeedit.h)
+QT_CLASS_LIB(Q3DateTimeEdit, Qt3Support, q3datetimeedit.h)
+QT_CLASS_LIB(Q3DockAreaLayout, Qt3Support, q3dockarea.h)
+QT_CLASS_LIB(Q3DockArea, Qt3Support, q3dockarea.h)
+QT_CLASS_LIB(Q3DockWindow, Qt3Support, q3dockwindow.h)
+QT_CLASS_LIB(Q3Frame, Qt3Support, q3frame.h)
+QT_CLASS_LIB(Q3Grid, Qt3Support, q3grid.h)
+QT_CLASS_LIB(Q3GridView, Qt3Support, q3gridview.h)
+QT_CLASS_LIB(Q3GroupBox, Qt3Support, q3groupbox.h)
+QT_CLASS_LIB(Q3HBox, Qt3Support, q3hbox.h)
+QT_CLASS_LIB(Q3Header, Qt3Support, q3header.h)
+QT_CLASS_LIB(Q3HGroupBox, Qt3Support, q3hgroupbox.h)
+QT_CLASS_LIB(Q3MainWindow, Qt3Support, q3mainwindow.h)
+QT_CLASS_LIB(Q3PopupMenu, Qt3Support, q3popupmenu.h)
+QT_CLASS_LIB(Q3ProgressBar, Qt3Support, q3progressbar.h)
+QT_CLASS_LIB(Q3RangeControl, Qt3Support, q3rangecontrol.h)
+QT_CLASS_LIB(Q3SpinWidget, Qt3Support, q3rangecontrol.h)
+QT_CLASS_LIB(Q3ScrollView, Qt3Support, q3scrollview.h)
+QT_CLASS_LIB(Q3ToolBar, Qt3Support, q3toolbar.h)
+QT_CLASS_LIB(Q3VBox, Qt3Support, q3vbox.h)
+QT_CLASS_LIB(Q3VGroupBox, Qt3Support, q3vgroupbox.h)
+QT_CLASS_LIB(Q3WhatsThis, Qt3Support, q3whatsthis.h)
+QT_CLASS_LIB(Q3WidgetStack, Qt3Support, q3widgetstack.h)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/duic/tests/helloworld.ui	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,27 @@
+<ui version="4.0" >
+ <class>HelloWorldForm</class>
+ <widget class="QWidget" name="HelloWorldForm" >
+  <property name="geometry" >
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>96</width>
+    <height>48</height>
+   </rect>
+  </property>
+  <property name="windowTitle" >
+   <string>Form</string>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout" >
+   <item>
+    <widget class="QLabel" name="label" >
+     <property name="text" >
+      <string>Hello World!</string>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/duic/tests/mainwindow.ui	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,180 @@
+<ui version="4.0" >
+ <class>MainWindow</class>
+ <widget class="QMainWindow" name="MainWindow" >
+  <property name="geometry" >
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>800</width>
+    <height>600</height>
+   </rect>
+  </property>
+  <property name="windowTitle" >
+   <string>MainWindow</string>
+  </property>
+  <widget class="QWidget" name="centralwidget" >
+   <layout class="QVBoxLayout" name="verticalLayout_3" >
+    <item>
+     <widget class="QWidget" native="1" name="widget" >
+      <layout class="QHBoxLayout" name="horizontalLayout_2" >
+       <item>
+        <widget class="QFontComboBox" name="fontComboBox" />
+       </item>
+       <item>
+        <widget class="QDoubleSpinBox" name="doubleSpinBox" />
+       </item>
+      </layout>
+     </widget>
+    </item>
+    <item>
+     <widget class="QFrame" name="frame" >
+      <property name="frameShape" >
+       <enum>QFrame::StyledPanel</enum>
+      </property>
+      <property name="frameShadow" >
+       <enum>QFrame::Raised</enum>
+      </property>
+      <layout class="QVBoxLayout" name="verticalLayout_2" >
+       <item>
+        <widget class="QListView" name="listView" />
+       </item>
+       <item>
+        <widget class="QTreeView" name="treeView" />
+       </item>
+      </layout>
+     </widget>
+    </item>
+   </layout>
+  </widget>
+  <widget class="QMenuBar" name="menubar" >
+   <property name="geometry" >
+    <rect>
+     <x>0</x>
+     <y>0</y>
+     <width>800</width>
+     <height>27</height>
+    </rect>
+   </property>
+   <widget class="QMenu" name="menuFile" >
+    <property name="title" >
+     <string>File</string>
+    </property>
+    <addaction name="actionOpen" />
+    <addaction name="actionClose" />
+    <addaction name="actionQuit" />
+   </widget>
+   <widget class="QMenu" name="menuEdit" >
+    <property name="title" >
+     <string>Edit</string>
+    </property>
+    <addaction name="actionCopy" />
+    <addaction name="actionPaste" />
+    <addaction name="actionCut" />
+   </widget>
+   <addaction name="menuFile" />
+   <addaction name="menuEdit" />
+  </widget>
+  <widget class="QStatusBar" name="statusbar" />
+  <widget class="QToolBar" name="toolBar" >
+   <property name="windowTitle" >
+    <string>toolBar</string>
+   </property>
+   <attribute name="toolBarArea" >
+    <enum>TopToolBarArea</enum>
+   </attribute>
+   <attribute name="toolBarBreak" >
+    <bool>false</bool>
+   </attribute>
+   <addaction name="actionOpen" />
+   <addaction name="actionQuit" />
+  </widget>
+  <widget class="QDockWidget" name="dockWidget" >
+   <attribute name="dockWidgetArea" >
+    <number>2</number>
+   </attribute>
+   <widget class="QWidget" name="dockWidgetContents" >
+    <layout class="QHBoxLayout" name="horizontalLayout" >
+     <item>
+      <widget class="QGroupBox" name="groupBox" >
+       <property name="title" >
+        <string>Some options</string>
+       </property>
+       <layout class="QVBoxLayout" name="verticalLayout" >
+        <item>
+         <widget class="QRadioButton" name="radioButton" >
+          <property name="text" >
+           <string>Option 1</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QRadioButton" name="radioButton_2" >
+          <property name="text" >
+           <string>Option 2</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QRadioButton" name="radioButton_3" >
+          <property name="text" >
+           <string>Option 3</string>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </widget>
+     </item>
+    </layout>
+   </widget>
+  </widget>
+  <action name="actionOpen" >
+   <property name="text" >
+    <string>Open</string>
+   </property>
+  </action>
+  <action name="actionClose" >
+   <property name="text" >
+    <string>Close</string>
+   </property>
+  </action>
+  <action name="actionQuit" >
+   <property name="text" >
+    <string>Quit</string>
+   </property>
+  </action>
+  <action name="actionCopy" >
+   <property name="text" >
+    <string>Copy</string>
+   </property>
+  </action>
+  <action name="actionPaste" >
+   <property name="text" >
+    <string>Paste</string>
+   </property>
+  </action>
+  <action name="actionCut" >
+   <property name="text" >
+    <string>Cut</string>
+   </property>
+  </action>
+ </widget>
+ <resources/>
+ <connections>
+  <connection>
+   <sender>actionQuit</sender>
+   <signal>activated(int)</signal>
+   <receiver>MainWindow</receiver>
+   <slot>close()</slot>
+   <hints>
+    <hint type="sourcelabel" >
+     <x>-1</x>
+     <y>-1</y>
+    </hint>
+    <hint type="destinationlabel" >
+     <x>399</x>
+     <y>299</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+</ui>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/duic/tests/ui_helloworld.d	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,56 @@
+/********************************************************************************
+** Form generated from reading ui file 'helloworld.ui'
+**
+** Created: Wed Dec 17 23:20:28 2008
+**      by: QtD User Interface Compiler version 4.4.3
+**
+** WARNING! All changes made in this file will be lost when recompiling ui file!
+********************************************************************************/
+
+module ui.HelloWorldForm
+
+import qt.core.QVariant;
+import qt.gui.QAction;
+import qt.gui.QApplication;
+import qt.gui.QButtonGroup;
+import qt.gui.QLabel;
+import qt.gui.QVBoxLayout;
+import qt.gui.QWidget;
+
+mixin QT_BEGIN_NAMESPACE;
+
+class Ui_HelloWorldForm
+{
+public:
+    QVBoxLayout *verticalLayout;
+    QLabel *label;
+
+    void setupUi(QWidget *HelloWorldForm)
+    {
+    if (HelloWorldForm.objectName().isEmpty())
+        HelloWorldForm.setObjectName(qt.core.QString.fromUtf8("HelloWorldForm"));
+    HelloWorldForm.resize(96, 48);
+    verticalLayout = new QVBoxLayout(HelloWorldForm);
+    verticalLayout.setObjectName(qt.core.QString.fromUtf8("verticalLayout"));
+    label = new QLabel(HelloWorldForm);
+    label.setObjectName(qt.core.QString.fromUtf8("label"));
+
+    verticalLayout.addWidget(label);
+
+
+    retranslateUi(HelloWorldForm);
+
+    QMetaObject.connectSlotsByName(HelloWorldForm);
+    } // setupUi
+
+    void retranslateUi(QWidget *HelloWorldForm)
+    {
+    HelloWorldForm.setWindowTitle(qt.gui.QApplication.translate("HelloWorldForm", "Form", 0, qt.gui.QApplication.UnicodeUTF8));
+    label.setText(qt.gui.QApplication.translate("HelloWorldForm", "Hello World!", 0, qt.gui.QApplication.UnicodeUTF8));
+    Q_UNUSED(HelloWorldForm);
+    } // retranslateUi
+
+};
+
+mixin QT_END_NAMESPACE;
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/duic/tests/ui_mainwindow.d	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,209 @@
+/********************************************************************************
+** Form generated from reading ui file 'mainwindow.ui'
+**
+** Created: Wed Dec 17 23:30:55 2008
+**      by: QtD User Interface Compiler version 4.4.3
+**
+** WARNING! All changes made in this file will be lost when recompiling ui file!
+********************************************************************************/
+
+module ui.MainWindow
+
+import qt.core.QVariant;
+import qt.gui.QAction;
+import qt.gui.QApplication;
+import qt.gui.QButtonGroup;
+import qt.gui.QDockWidget;
+import qt.gui.QDoubleSpinBox;
+import qt.gui.QFontComboBox;
+import qt.gui.QFrame;
+import qt.gui.QGroupBox;
+import qt.gui.QHBoxLayout;
+import qt.gui.QListView;
+import qt.gui.QMainWindow;
+import qt.gui.QMenu;
+import qt.gui.QMenuBar;
+import qt.gui.QRadioButton;
+import qt.gui.QStatusBar;
+import qt.gui.QToolBar;
+import qt.gui.QTreeView;
+import qt.gui.QVBoxLayout;
+import qt.gui.QWidget;
+
+mixin QT_BEGIN_NAMESPACE;
+
+class Ui_MainWindow
+{
+public:
+    QAction *actionOpen;
+    QAction *actionClose;
+    QAction *actionQuit;
+    QAction *actionCopy;
+    QAction *actionPaste;
+    QAction *actionCut;
+    QWidget *centralwidget;
+    QVBoxLayout *verticalLayout_3;
+    QWidget *widget;
+    QHBoxLayout *horizontalLayout_2;
+    QFontComboBox *fontComboBox;
+    QDoubleSpinBox *doubleSpinBox;
+    QFrame *frame;
+    QVBoxLayout *verticalLayout_2;
+    QListView *listView;
+    QTreeView *treeView;
+    QMenuBar *menubar;
+    QMenu *menuFile;
+    QMenu *menuEdit;
+    QStatusBar *statusbar;
+    QToolBar *toolBar;
+    QDockWidget *dockWidget;
+    QWidget *dockWidgetContents;
+    QHBoxLayout *horizontalLayout;
+    QGroupBox *groupBox;
+    QVBoxLayout *verticalLayout;
+    QRadioButton *radioButton;
+    QRadioButton *radioButton_2;
+    QRadioButton *radioButton_3;
+
+    void setupUi(QMainWindow *MainWindow)
+    {
+    if (MainWindow.objectName().isEmpty())
+        MainWindow.setObjectName(qt.core.QString.fromUtf8("MainWindow"));
+    MainWindow.resize(800, 600);
+    actionOpen = new QAction(MainWindow);
+    actionOpen.setObjectName(qt.core.QString.fromUtf8("actionOpen"));
+    actionClose = new QAction(MainWindow);
+    actionClose.setObjectName(qt.core.QString.fromUtf8("actionClose"));
+    actionQuit = new QAction(MainWindow);
+    actionQuit.setObjectName(qt.core.QString.fromUtf8("actionQuit"));
+    actionCopy = new QAction(MainWindow);
+    actionCopy.setObjectName(qt.core.QString.fromUtf8("actionCopy"));
+    actionPaste = new QAction(MainWindow);
+    actionPaste.setObjectName(qt.core.QString.fromUtf8("actionPaste"));
+    actionCut = new QAction(MainWindow);
+    actionCut.setObjectName(qt.core.QString.fromUtf8("actionCut"));
+    centralwidget = new QWidget(MainWindow);
+    centralwidget.setObjectName(qt.core.QString.fromUtf8("centralwidget"));
+    verticalLayout_3 = new QVBoxLayout(centralwidget);
+    verticalLayout_3.setObjectName(qt.core.QString.fromUtf8("verticalLayout_3"));
+    widget = new QWidget(centralwidget);
+    widget.setObjectName(qt.core.QString.fromUtf8("widget"));
+    horizontalLayout_2 = new QHBoxLayout(widget);
+    horizontalLayout_2.setObjectName(qt.core.QString.fromUtf8("horizontalLayout_2"));
+    fontComboBox = new QFontComboBox(widget);
+    fontComboBox.setObjectName(qt.core.QString.fromUtf8("fontComboBox"));
+
+    horizontalLayout_2.addWidget(fontComboBox);
+
+    doubleSpinBox = new QDoubleSpinBox(widget);
+    doubleSpinBox.setObjectName(qt.core.QString.fromUtf8("doubleSpinBox"));
+
+    horizontalLayout_2.addWidget(doubleSpinBox);
+
+
+    verticalLayout_3.addWidget(widget);
+
+    frame = new QFrame(centralwidget);
+    frame.setObjectName(qt.core.QString.fromUtf8("frame"));
+    frame.setFrameShape(QFrame.QFrame::StyledPanel);
+    frame.setFrameShadow(QFrame.QFrame::Raised);
+    verticalLayout_2 = new QVBoxLayout(frame);
+    verticalLayout_2.setObjectName(qt.core.QString.fromUtf8("verticalLayout_2"));
+    listView = new QListView(frame);
+    listView.setObjectName(qt.core.QString.fromUtf8("listView"));
+
+    verticalLayout_2.addWidget(listView);
+
+    treeView = new QTreeView(frame);
+    treeView.setObjectName(qt.core.QString.fromUtf8("treeView"));
+
+    verticalLayout_2.addWidget(treeView);
+
+
+    verticalLayout_3.addWidget(frame);
+
+    MainWindow.setCentralWidget(centralwidget);
+    menubar = new QMenuBar(MainWindow);
+    menubar.setObjectName(qt.core.QString.fromUtf8("menubar"));
+    menubar.setGeometry(qt.core.QRect(0, 0, 800, 27));
+    menuFile = new QMenu(menubar);
+    menuFile.setObjectName(qt.core.QString.fromUtf8("menuFile"));
+    menuEdit = new QMenu(menubar);
+    menuEdit.setObjectName(qt.core.QString.fromUtf8("menuEdit"));
+    MainWindow.setMenuBar(menubar);
+    statusbar = new QStatusBar(MainWindow);
+    statusbar.setObjectName(qt.core.QString.fromUtf8("statusbar"));
+    MainWindow.setStatusBar(statusbar);
+    toolBar = new QToolBar(MainWindow);
+    toolBar.setObjectName(qt.core.QString.fromUtf8("toolBar"));
+    MainWindow.addToolBar(qt.core.Qt.TopToolBarArea, toolBar);
+    dockWidget = new QDockWidget(MainWindow);
+    dockWidget.setObjectName(qt.core.QString.fromUtf8("dockWidget"));
+    dockWidgetContents = new QWidget();
+    dockWidgetContents.setObjectName(qt.core.QString.fromUtf8("dockWidgetContents"));
+    horizontalLayout = new QHBoxLayout(dockWidgetContents);
+    horizontalLayout.setObjectName(qt.core.QString.fromUtf8("horizontalLayout"));
+    groupBox = new QGroupBox(dockWidgetContents);
+    groupBox.setObjectName(qt.core.QString.fromUtf8("groupBox"));
+    verticalLayout = new QVBoxLayout(groupBox);
+    verticalLayout.setObjectName(qt.core.QString.fromUtf8("verticalLayout"));
+    radioButton = new QRadioButton(groupBox);
+    radioButton.setObjectName(qt.core.QString.fromUtf8("radioButton"));
+
+    verticalLayout.addWidget(radioButton);
+
+    radioButton_2 = new QRadioButton(groupBox);
+    radioButton_2.setObjectName(qt.core.QString.fromUtf8("radioButton_2"));
+
+    verticalLayout.addWidget(radioButton_2);
+
+    radioButton_3 = new QRadioButton(groupBox);
+    radioButton_3.setObjectName(qt.core.QString.fromUtf8("radioButton_3"));
+
+    verticalLayout.addWidget(radioButton_3);
+
+
+    horizontalLayout.addWidget(groupBox);
+
+    dockWidget.setWidget(dockWidgetContents);
+    MainWindow.addDockWidget((cast(qt.core.Qt.DockWidgetArea)(2)), dockWidget);
+
+    menubar.addAction(menuFile.menuAction());
+    menubar.addAction(menuEdit.menuAction());
+    menuFile.addAction(actionOpen);
+    menuFile.addAction(actionClose);
+    menuFile.addAction(actionQuit);
+    menuEdit.addAction(actionCopy);
+    menuEdit.addAction(actionPaste);
+    menuEdit.addAction(actionCut);
+    toolBar.addAction(actionOpen);
+    toolBar.addAction(actionQuit);
+
+    retranslateUi(MainWindow);
+    QObject.connect(actionQuit, SIGNAL(activated(int)), MainWindow, SLOT(close()));
+
+    QMetaObject.connectSlotsByName(MainWindow);
+    } // setupUi
+
+    void retranslateUi(QMainWindow *MainWindow)
+    {
+    MainWindow.setWindowTitle(qt.gui.QApplication.translate("MainWindow", "MainWindow", 0, qt.gui.QApplication.UnicodeUTF8));
+    actionOpen.setText(qt.gui.QApplication.translate("MainWindow", "Open", 0, qt.gui.QApplication.UnicodeUTF8));
+    actionClose.setText(qt.gui.QApplication.translate("MainWindow", "Close", 0, qt.gui.QApplication.UnicodeUTF8));
+    actionQuit.setText(qt.gui.QApplication.translate("MainWindow", "Quit", 0, qt.gui.QApplication.UnicodeUTF8));
+    actionCopy.setText(qt.gui.QApplication.translate("MainWindow", "Copy", 0, qt.gui.QApplication.UnicodeUTF8));
+    actionPaste.setText(qt.gui.QApplication.translate("MainWindow", "Paste", 0, qt.gui.QApplication.UnicodeUTF8));
+    actionCut.setText(qt.gui.QApplication.translate("MainWindow", "Cut", 0, qt.gui.QApplication.UnicodeUTF8));
+    menuFile.setTitle(qt.gui.QApplication.translate("MainWindow", "File", 0, qt.gui.QApplication.UnicodeUTF8));
+    menuEdit.setTitle(qt.gui.QApplication.translate("MainWindow", "Edit", 0, qt.gui.QApplication.UnicodeUTF8));
+    toolBar.setWindowTitle(qt.gui.QApplication.translate("MainWindow", "toolBar", 0, qt.gui.QApplication.UnicodeUTF8));
+    groupBox.setTitle(qt.gui.QApplication.translate("MainWindow", "Some options", 0, qt.gui.QApplication.UnicodeUTF8));
+    radioButton.setText(qt.gui.QApplication.translate("MainWindow", "Option 1", 0, qt.gui.QApplication.UnicodeUTF8));
+    radioButton_2.setText(qt.gui.QApplication.translate("MainWindow", "Option 2", 0, qt.gui.QApplication.UnicodeUTF8));
+    radioButton_3.setText(qt.gui.QApplication.translate("MainWindow", "Option 3", 0, qt.gui.QApplication.UnicodeUTF8));
+    } // retranslateUi
+
+};
+
+mixin QT_END_NAMESPACE;
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/duic/treewalker.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,308 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+** exception, Nokia gives you certain additional rights. These rights
+** are described in the Nokia Qt GPL Exception version 1.3, included in
+** the file GPL_EXCEPTION.txt in this package.
+**
+** Qt for Windows(R) Licensees
+** As a special exception, Nokia, as the sole copyright holder for Qt
+** Designer, grants users of the Qt/Eclipse Integration plug-in the
+** right for the Qt/Eclipse Integration to link to functionality
+** provided by Qt Designer and its related libraries.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+****************************************************************************/
+
+#include "treewalker.h"
+#include "ui4.h"
+
+QT_BEGIN_NAMESPACE
+
+void TreeWalker::acceptUI(DomUI *ui)
+{
+    acceptWidget(ui->elementWidget());
+    acceptTabStops(ui->elementTabStops());
+
+    if (ui->elementImages())
+        acceptImages(ui->elementImages());
+}
+
+void TreeWalker::acceptLayoutDefault(DomLayoutDefault *layoutDefault)
+{
+    Q_UNUSED(layoutDefault);
+}
+
+void TreeWalker::acceptLayoutFunction(DomLayoutFunction *layoutFunction)
+{
+    Q_UNUSED(layoutFunction);
+}
+
+void TreeWalker::acceptTabStops(DomTabStops *tabStops)
+{
+    Q_UNUSED(tabStops);
+}
+
+void TreeWalker::acceptLayout(DomLayout *layout)
+{
+    for (int i=0; i<layout->elementProperty().size(); ++i)
+        acceptProperty(layout->elementProperty().at(i));
+
+    for (int i=0; i<layout->elementItem().size(); ++i)
+        acceptLayoutItem(layout->elementItem().at(i));
+}
+
+void TreeWalker::acceptLayoutItem(DomLayoutItem *layoutItem)
+{
+    switch (layoutItem->kind()) {
+        case DomLayoutItem::Widget:
+            acceptWidget(layoutItem->elementWidget());
+            return;
+        case DomLayoutItem::Layout:
+            acceptLayout(layoutItem->elementLayout());
+            return;
+        case DomLayoutItem::Spacer:
+            acceptSpacer(layoutItem->elementSpacer());
+            return;
+        case DomLayoutItem::Unknown:
+            break;
+    }
+
+    Q_ASSERT( 0 );
+}
+
+void TreeWalker::acceptWidget(DomWidget *widget)
+{
+    for (int i=0; i<widget->elementAction().size(); ++i)
+        acceptAction(widget->elementAction().at(i));
+
+    for (int i=0; i<widget->elementActionGroup().size(); ++i)
+        acceptActionGroup(widget->elementActionGroup().at(i));
+
+    for (int i=0; i<widget->elementAddAction().size(); ++i)
+        acceptActionRef(widget->elementAddAction().at(i));
+
+    for (int i=0; i<widget->elementProperty().size(); ++i)
+        acceptProperty(widget->elementProperty().at(i));
+
+
+
+    // recurse down
+    DomWidgets childWidgets;
+    for (int i=0; i<widget->elementWidget().size(); ++i) {
+        DomWidget *child = widget->elementWidget().at(i);
+        childWidgets += child;
+        acceptWidget(child);
+    }
+
+    if (!widget->elementLayout().isEmpty())
+        acceptLayout(widget->elementLayout().at(0));
+
+    const DomScripts scripts(widget->elementScript());
+    acceptWidgetScripts(scripts, widget, childWidgets);
+}
+
+void TreeWalker::acceptSpacer(DomSpacer *spacer)
+{
+    for (int i=0; i<spacer->elementProperty().size(); ++i)
+        acceptProperty(spacer->elementProperty().at(i));
+}
+
+void TreeWalker::acceptColor(DomColor *color)
+{
+    Q_UNUSED(color);
+}
+
+void TreeWalker::acceptColorGroup(DomColorGroup *colorGroup)
+{
+    Q_UNUSED(colorGroup);
+}
+
+void TreeWalker::acceptPalette(DomPalette *palette)
+{
+    acceptColorGroup(palette->elementActive());
+    acceptColorGroup(palette->elementInactive());
+    acceptColorGroup(palette->elementDisabled());
+}
+
+void TreeWalker::acceptFont(DomFont *font)
+{
+    Q_UNUSED(font);
+}
+
+void TreeWalker::acceptPoint(DomPoint *point)
+{
+    Q_UNUSED(point);
+}
+
+void TreeWalker::acceptRect(DomRect *rect)
+{
+    Q_UNUSED(rect);
+}
+
+void TreeWalker::acceptSizePolicy(DomSizePolicy *sizePolicy)
+{
+    Q_UNUSED(sizePolicy);
+}
+
+void TreeWalker::acceptSize(DomSize *size)
+{
+    Q_UNUSED(size);
+}
+
+void TreeWalker::acceptDate(DomDate *date)
+{
+    Q_UNUSED(date);
+}
+
+void TreeWalker::acceptTime(DomTime *time)
+{
+    Q_UNUSED(time);
+}
+
+void TreeWalker::acceptDateTime(DomDateTime *dateTime)
+{
+    Q_UNUSED(dateTime);
+}
+
+void TreeWalker::acceptProperty(DomProperty *property)
+{
+    switch (property->kind()) {
+        case DomProperty::Bool:
+        case DomProperty::Color:
+        case DomProperty::Cstring:
+        case DomProperty::Cursor:
+        case DomProperty::CursorShape:
+        case DomProperty::Enum:
+        case DomProperty::Font:
+        case DomProperty::Pixmap:
+        case DomProperty::IconSet:
+        case DomProperty::Palette:
+        case DomProperty::Point:
+        case DomProperty::PointF:
+        case DomProperty::Rect:
+        case DomProperty::RectF:
+        case DomProperty::Set:
+        case DomProperty::Locale:
+        case DomProperty::SizePolicy:
+        case DomProperty::Size:
+        case DomProperty::SizeF:
+        case DomProperty::String:
+        case DomProperty::Number:
+        case DomProperty::LongLong:
+        case DomProperty::Char:
+        case DomProperty::Date:
+        case DomProperty::Time:
+        case DomProperty::DateTime:
+        case DomProperty::Url:
+        case DomProperty::Unknown:
+        case DomProperty::StringList:
+        case DomProperty::Float:
+        case DomProperty::Double:
+        case DomProperty::UInt:
+        case DomProperty::ULongLong:
+        case DomProperty::Brush:
+            break;
+    }
+}
+
+void TreeWalker::acceptCustomWidgets(DomCustomWidgets *customWidgets)
+{
+    for (int i=0; i<customWidgets->elementCustomWidget().size(); ++i)
+        acceptCustomWidget(customWidgets->elementCustomWidget().at(i));
+}
+
+void TreeWalker::acceptCustomWidget(DomCustomWidget *customWidget)
+{
+    Q_UNUSED(customWidget);
+}
+
+void TreeWalker::acceptAction(DomAction *action)
+{
+    Q_UNUSED(action);
+}
+
+void TreeWalker::acceptActionGroup(DomActionGroup *actionGroup)
+{
+    for (int i=0; i<actionGroup->elementAction().size(); ++i)
+        acceptAction(actionGroup->elementAction().at(i));
+
+    for (int i=0; i<actionGroup->elementActionGroup().size(); ++i)
+        acceptActionGroup(actionGroup->elementActionGroup().at(i));
+}
+
+void TreeWalker::acceptActionRef(DomActionRef *actionRef)
+{
+    Q_UNUSED(actionRef);
+}
+
+void TreeWalker::acceptImages(DomImages *images)
+{
+    for (int i=0; i<images->elementImage().size(); ++i)
+        acceptImage(images->elementImage().at(i));
+}
+
+void TreeWalker::acceptImage(DomImage *image)
+{
+    Q_UNUSED(image);
+}
+
+void TreeWalker::acceptIncludes(DomIncludes *includes)
+{
+    for (int i=0; i<includes->elementInclude().size(); ++i)
+        acceptInclude(includes->elementInclude().at(i));
+}
+
+void TreeWalker::acceptInclude(DomInclude *incl)
+{
+    Q_UNUSED(incl);
+}
+
+void TreeWalker::acceptConnections(DomConnections *connections)
+{
+    for (int i=0; i<connections->elementConnection().size(); ++i)
+        acceptConnection(connections->elementConnection().at(i));
+}
+
+void TreeWalker::acceptConnection(DomConnection *connection)
+{
+    acceptConnectionHints(connection->elementHints());
+}
+
+void TreeWalker::acceptConnectionHints(DomConnectionHints *connectionHints)
+{
+    for (int i=0; i<connectionHints->elementHint().size(); ++i)
+        acceptConnectionHint(connectionHints->elementHint().at(i));
+}
+
+void TreeWalker::acceptConnectionHint(DomConnectionHint *connectionHint)
+{
+    Q_UNUSED(connectionHint);
+}
+
+void TreeWalker::acceptWidgetScripts(const DomScripts &, DomWidget *, const  DomWidgets &)
+{
+}
+
+QT_END_NAMESPACE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/duic/treewalker.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,129 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+** exception, Nokia gives you certain additional rights. These rights
+** are described in the Nokia Qt GPL Exception version 1.3, included in
+** the file GPL_EXCEPTION.txt in this package.
+**
+** Qt for Windows(R) Licensees
+** As a special exception, Nokia, as the sole copyright holder for Qt
+** Designer, grants users of the Qt/Eclipse Integration plug-in the
+** right for the Qt/Eclipse Integration to link to functionality
+** provided by Qt Designer and its related libraries.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+****************************************************************************/
+
+#ifndef TREEWALKER_H
+#define TREEWALKER_H
+
+#include <QtCore/QList>
+
+QT_BEGIN_NAMESPACE
+
+class DomUI;
+class DomLayoutDefault;
+class DomLayoutFunction;
+class DomTabStops;
+class DomLayout;
+class DomLayoutItem;
+class DomWidget;
+class DomSpacer;
+class DomColor;
+class DomColorGroup;
+class DomPalette;
+class DomFont;
+class DomPoint;
+class DomRect;
+class DomSizePolicy;
+class DomSize;
+class DomDate;
+class DomTime;
+class DomDateTime;
+class DomProperty;
+class DomCustomWidgets;
+class DomCustomWidget;
+class DomAction;
+class DomActionGroup;
+class DomActionRef;
+class DomImages;
+class DomImage;
+class DomItem;
+class DomIncludes;
+class DomInclude;
+class DomString;
+class DomResourcePixmap;
+class DomResources;
+class DomResource;
+class DomConnections;
+class DomConnection;
+class DomConnectionHints;
+class DomConnectionHint;
+class DomScript;
+
+struct TreeWalker
+{
+    inline virtual ~TreeWalker() {}
+
+    virtual void acceptUI(DomUI *ui);
+    virtual void acceptLayoutDefault(DomLayoutDefault *layoutDefault);
+    virtual void acceptLayoutFunction(DomLayoutFunction *layoutFunction);
+    virtual void acceptTabStops(DomTabStops *tabStops);
+    virtual void acceptCustomWidgets(DomCustomWidgets *customWidgets);
+    virtual void acceptCustomWidget(DomCustomWidget *customWidget);
+    virtual void acceptLayout(DomLayout *layout);
+    virtual void acceptLayoutItem(DomLayoutItem *layoutItem);
+    virtual void acceptWidget(DomWidget *widget);
+    virtual void acceptSpacer(DomSpacer *spacer);
+    virtual void acceptColor(DomColor *color);
+    virtual void acceptColorGroup(DomColorGroup *colorGroup);
+    virtual void acceptPalette(DomPalette *palette);
+    virtual void acceptFont(DomFont *font);
+    virtual void acceptPoint(DomPoint *point);
+    virtual void acceptRect(DomRect *rect);
+    virtual void acceptSizePolicy(DomSizePolicy *sizePolicy);
+    virtual void acceptSize(DomSize *size);
+    virtual void acceptDate(DomDate *date);
+    virtual void acceptTime(DomTime *time);
+    virtual void acceptDateTime(DomDateTime *dateTime);
+    virtual void acceptProperty(DomProperty *property);
+    typedef QList<DomScript *> DomScripts;
+    typedef QList<DomWidget *> DomWidgets;
+    virtual void acceptWidgetScripts(const DomScripts &, DomWidget *node, const  DomWidgets &childWidgets);
+    virtual void acceptImages(DomImages *images);
+    virtual void acceptImage(DomImage *image);
+    virtual void acceptIncludes(DomIncludes *includes);
+    virtual void acceptInclude(DomInclude *incl);
+    virtual void acceptAction(DomAction *action);
+    virtual void acceptActionGroup(DomActionGroup *actionGroup);
+    virtual void acceptActionRef(DomActionRef *actionRef);
+    virtual void acceptConnections(DomConnections *connections);
+    virtual void acceptConnection(DomConnection *connection);
+    virtual void acceptConnectionHints(DomConnectionHints *connectionHints);
+    virtual void acceptConnectionHint(DomConnectionHint *connectionHint);
+};
+
+QT_END_NAMESPACE
+
+#endif // TREEWALKER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/duic/ui4.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,7612 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+** exception, Nokia gives you certain additional rights. These rights
+** are described in the Nokia Qt GPL Exception version 1.3, included in
+** the file GPL_EXCEPTION.txt in this package.
+**
+** Qt for Windows(R) Licensees
+** As a special exception, Nokia, as the sole copyright holder for Qt
+** Designer, grants users of the Qt/Eclipse Integration plug-in the
+** right for the Qt/Eclipse Integration to link to functionality
+** provided by Qt Designer and its related libraries.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+****************************************************************************/
+#include "ui4.h"
+#include <QtXml/QDomDocument>
+
+QT_BEGIN_NAMESPACE
+#ifdef QFORMINTERNAL_NAMESPACE
+using namespace QFormInternal;
+#endif
+
+/*******************************************************************************
+** Implementations
+*/
+
+void DomUI::clear(bool clear_all)
+{
+    delete m_widget;
+    delete m_layoutDefault;
+    delete m_layoutFunction;
+    delete m_customWidgets;
+    delete m_tabStops;
+    delete m_images;
+    delete m_includes;
+    delete m_resources;
+    delete m_connections;
+    delete m_designerdata;
+    delete m_slots;
+
+    if (clear_all) {
+    m_text = QString();
+    m_has_attr_version = false;
+    m_has_attr_language = false;
+    m_has_attr_stdSetDef = false;
+    m_attr_stdSetDef = 0;
+    }
+
+    m_children = 0;
+    m_widget = 0;
+    m_layoutDefault = 0;
+    m_layoutFunction = 0;
+    m_customWidgets = 0;
+    m_tabStops = 0;
+    m_images = 0;
+    m_includes = 0;
+    m_resources = 0;
+    m_connections = 0;
+    m_designerdata = 0;
+    m_slots = 0;
+}
+
+DomUI::DomUI()
+{
+    m_children = 0;
+    m_has_attr_version = false;
+    m_has_attr_language = false;
+    m_has_attr_stdSetDef = false;
+    m_attr_stdSetDef = 0;
+    m_widget = 0;
+    m_layoutDefault = 0;
+    m_layoutFunction = 0;
+    m_customWidgets = 0;
+    m_tabStops = 0;
+    m_images = 0;
+    m_includes = 0;
+    m_resources = 0;
+    m_connections = 0;
+    m_designerdata = 0;
+    m_slots = 0;
+}
+
+DomUI::~DomUI()
+{
+    delete m_widget;
+    delete m_layoutDefault;
+    delete m_layoutFunction;
+    delete m_customWidgets;
+    delete m_tabStops;
+    delete m_images;
+    delete m_includes;
+    delete m_resources;
+    delete m_connections;
+    delete m_designerdata;
+    delete m_slots;
+}
+
+void DomUI::read(const QDomElement &node)
+{
+    if (node.hasAttribute(QLatin1String("version")))
+        setAttributeVersion(node.attribute(QLatin1String("version")));
+    if (node.hasAttribute(QLatin1String("language")))
+        setAttributeLanguage(node.attribute(QLatin1String("language")));
+    if (node.hasAttribute(QLatin1String("stdsetdef")))
+        setAttributeStdSetDef(node.attribute(QLatin1String("stdsetdef")).toInt());
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+        if (tag == QLatin1String("author")) {
+            setElementAuthor(e.text());
+            continue;
+        }
+        if (tag == QLatin1String("comment")) {
+            setElementComment(e.text());
+            continue;
+        }
+        if (tag == QLatin1String("exportmacro")) {
+            setElementExportMacro(e.text());
+            continue;
+        }
+        if (tag == QLatin1String("class")) {
+            setElementClass(e.text());
+            continue;
+        }
+        if (tag == QLatin1String("widget")) {
+            DomWidget *v = new DomWidget();
+            v->read(e);
+            setElementWidget(v);
+            continue;
+        }
+        if (tag == QLatin1String("layoutdefault")) {
+            DomLayoutDefault *v = new DomLayoutDefault();
+            v->read(e);
+            setElementLayoutDefault(v);
+            continue;
+        }
+        if (tag == QLatin1String("layoutfunction")) {
+            DomLayoutFunction *v = new DomLayoutFunction();
+            v->read(e);
+            setElementLayoutFunction(v);
+            continue;
+        }
+        if (tag == QLatin1String("pixmapfunction")) {
+            setElementPixmapFunction(e.text());
+            continue;
+        }
+        if (tag == QLatin1String("customwidgets")) {
+            DomCustomWidgets *v = new DomCustomWidgets();
+            v->read(e);
+            setElementCustomWidgets(v);
+            continue;
+        }
+        if (tag == QLatin1String("tabstops")) {
+            DomTabStops *v = new DomTabStops();
+            v->read(e);
+            setElementTabStops(v);
+            continue;
+        }
+        if (tag == QLatin1String("images")) {
+            DomImages *v = new DomImages();
+            v->read(e);
+            setElementImages(v);
+            continue;
+        }
+        if (tag == QLatin1String("includes")) {
+            DomIncludes *v = new DomIncludes();
+            v->read(e);
+            setElementIncludes(v);
+            continue;
+        }
+        if (tag == QLatin1String("resources")) {
+            DomResources *v = new DomResources();
+            v->read(e);
+            setElementResources(v);
+            continue;
+        }
+        if (tag == QLatin1String("connections")) {
+            DomConnections *v = new DomConnections();
+            v->read(e);
+            setElementConnections(v);
+            continue;
+        }
+        if (tag == QLatin1String("designerdata")) {
+            DomDesignerData *v = new DomDesignerData();
+            v->read(e);
+            setElementDesignerdata(v);
+            continue;
+        }
+        if (tag == QLatin1String("slots")) {
+            DomSlots *v = new DomSlots();
+            v->read(e);
+            setElementSlots(v);
+            continue;
+        }
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomUI::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("ui") : tagName.toLower());
+
+    QDomElement child;
+
+    if (hasAttributeVersion())
+        e.setAttribute(QLatin1String("version"), attributeVersion());
+
+    if (hasAttributeLanguage())
+        e.setAttribute(QLatin1String("language"), attributeLanguage());
+
+    if (hasAttributeStdSetDef())
+        e.setAttribute(QLatin1String("stdsetdef"), attributeStdSetDef());
+
+    if (m_children & Author) {
+        child = doc.createElement(QLatin1String("author"));
+        child.appendChild(doc.createTextNode(m_author));
+        e.appendChild(child);
+    }
+
+    if (m_children & Comment) {
+        child = doc.createElement(QLatin1String("comment"));
+        child.appendChild(doc.createTextNode(m_comment));
+        e.appendChild(child);
+    }
+
+    if (m_children & ExportMacro) {
+        child = doc.createElement(QLatin1String("exportmacro"));
+        child.appendChild(doc.createTextNode(m_exportMacro));
+        e.appendChild(child);
+    }
+
+    if (m_children & Class) {
+        child = doc.createElement(QLatin1String("class"));
+        child.appendChild(doc.createTextNode(m_class));
+        e.appendChild(child);
+    }
+
+    if (m_children & Widget) {
+        e.appendChild(m_widget->write(doc, QLatin1String("widget")));
+    }
+
+    if (m_children & LayoutDefault) {
+        e.appendChild(m_layoutDefault->write(doc, QLatin1String("layoutdefault")));
+    }
+
+    if (m_children & LayoutFunction) {
+        e.appendChild(m_layoutFunction->write(doc, QLatin1String("layoutfunction")));
+    }
+
+    if (m_children & PixmapFunction) {
+        child = doc.createElement(QLatin1String("pixmapfunction"));
+        child.appendChild(doc.createTextNode(m_pixmapFunction));
+        e.appendChild(child);
+    }
+
+    if (m_children & CustomWidgets) {
+        e.appendChild(m_customWidgets->write(doc, QLatin1String("customwidgets")));
+    }
+
+    if (m_children & TabStops) {
+        e.appendChild(m_tabStops->write(doc, QLatin1String("tabstops")));
+    }
+
+    if (m_children & Images) {
+        e.appendChild(m_images->write(doc, QLatin1String("images")));
+    }
+
+    if (m_children & Includes) {
+        e.appendChild(m_includes->write(doc, QLatin1String("includes")));
+    }
+
+    if (m_children & Resources) {
+        e.appendChild(m_resources->write(doc, QLatin1String("resources")));
+    }
+
+    if (m_children & Connections) {
+        e.appendChild(m_connections->write(doc, QLatin1String("connections")));
+    }
+
+    if (m_children & Designerdata) {
+        e.appendChild(m_designerdata->write(doc, QLatin1String("designerdata")));
+    }
+
+    if (m_children & Slots) {
+        e.appendChild(m_slots->write(doc, QLatin1String("slots")));
+    }
+
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomUI::setElementAuthor(const QString& a)
+{
+    m_children |= Author;
+    m_author = a;
+}
+
+void DomUI::setElementComment(const QString& a)
+{
+    m_children |= Comment;
+    m_comment = a;
+}
+
+void DomUI::setElementExportMacro(const QString& a)
+{
+    m_children |= ExportMacro;
+    m_exportMacro = a;
+}
+
+void DomUI::setElementClass(const QString& a)
+{
+    m_children |= Class;
+    m_class = a;
+}
+
+void DomUI::setElementWidget(DomWidget* a)
+{
+    delete m_widget;
+    m_children |= Widget;
+    m_widget = a;
+}
+
+void DomUI::setElementLayoutDefault(DomLayoutDefault* a)
+{
+    delete m_layoutDefault;
+    m_children |= LayoutDefault;
+    m_layoutDefault = a;
+}
+
+void DomUI::setElementLayoutFunction(DomLayoutFunction* a)
+{
+    delete m_layoutFunction;
+    m_children |= LayoutFunction;
+    m_layoutFunction = a;
+}
+
+void DomUI::setElementPixmapFunction(const QString& a)
+{
+    m_children |= PixmapFunction;
+    m_pixmapFunction = a;
+}
+
+void DomUI::setElementCustomWidgets(DomCustomWidgets* a)
+{
+    delete m_customWidgets;
+    m_children |= CustomWidgets;
+    m_customWidgets = a;
+}
+
+void DomUI::setElementTabStops(DomTabStops* a)
+{
+    delete m_tabStops;
+    m_children |= TabStops;
+    m_tabStops = a;
+}
+
+void DomUI::setElementImages(DomImages* a)
+{
+    delete m_images;
+    m_children |= Images;
+    m_images = a;
+}
+
+void DomUI::setElementIncludes(DomIncludes* a)
+{
+    delete m_includes;
+    m_children |= Includes;
+    m_includes = a;
+}
+
+void DomUI::setElementResources(DomResources* a)
+{
+    delete m_resources;
+    m_children |= Resources;
+    m_resources = a;
+}
+
+void DomUI::setElementConnections(DomConnections* a)
+{
+    delete m_connections;
+    m_children |= Connections;
+    m_connections = a;
+}
+
+void DomUI::setElementDesignerdata(DomDesignerData* a)
+{
+    delete m_designerdata;
+    m_children |= Designerdata;
+    m_designerdata = a;
+}
+
+void DomUI::setElementSlots(DomSlots* a)
+{
+    delete m_slots;
+    m_children |= Slots;
+    m_slots = a;
+}
+
+void DomUI::clearElementAuthor()
+{
+    m_children &= ~Author;
+}
+
+void DomUI::clearElementComment()
+{
+    m_children &= ~Comment;
+}
+
+void DomUI::clearElementExportMacro()
+{
+    m_children &= ~ExportMacro;
+}
+
+void DomUI::clearElementClass()
+{
+    m_children &= ~Class;
+}
+
+void DomUI::clearElementWidget()
+{
+    delete m_widget;
+    m_widget = 0;
+    m_children &= ~Widget;
+}
+
+void DomUI::clearElementLayoutDefault()
+{
+    delete m_layoutDefault;
+    m_layoutDefault = 0;
+    m_children &= ~LayoutDefault;
+}
+
+void DomUI::clearElementLayoutFunction()
+{
+    delete m_layoutFunction;
+    m_layoutFunction = 0;
+    m_children &= ~LayoutFunction;
+}
+
+void DomUI::clearElementPixmapFunction()
+{
+    m_children &= ~PixmapFunction;
+}
+
+void DomUI::clearElementCustomWidgets()
+{
+    delete m_customWidgets;
+    m_customWidgets = 0;
+    m_children &= ~CustomWidgets;
+}
+
+void DomUI::clearElementTabStops()
+{
+    delete m_tabStops;
+    m_tabStops = 0;
+    m_children &= ~TabStops;
+}
+
+void DomUI::clearElementImages()
+{
+    delete m_images;
+    m_images = 0;
+    m_children &= ~Images;
+}
+
+void DomUI::clearElementIncludes()
+{
+    delete m_includes;
+    m_includes = 0;
+    m_children &= ~Includes;
+}
+
+void DomUI::clearElementResources()
+{
+    delete m_resources;
+    m_resources = 0;
+    m_children &= ~Resources;
+}
+
+void DomUI::clearElementConnections()
+{
+    delete m_connections;
+    m_connections = 0;
+    m_children &= ~Connections;
+}
+
+void DomUI::clearElementDesignerdata()
+{
+    delete m_designerdata;
+    m_designerdata = 0;
+    m_children &= ~Designerdata;
+}
+
+void DomUI::clearElementSlots()
+{
+    delete m_slots;
+    m_slots = 0;
+    m_children &= ~Slots;
+}
+
+void DomIncludes::clear(bool clear_all)
+{
+    for (int i = 0; i < m_include.size(); ++i)
+        delete m_include[i];
+    m_include.clear();
+
+    if (clear_all) {
+    m_text = QString();
+    }
+
+}
+
+DomIncludes::DomIncludes()
+{
+}
+
+DomIncludes::~DomIncludes()
+{
+    for (int i = 0; i < m_include.size(); ++i)
+        delete m_include[i];
+    m_include.clear();
+}
+
+void DomIncludes::read(const QDomElement &node)
+{
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+        if (tag == QLatin1String("include")) {
+            DomInclude *v = new DomInclude();
+            v->read(e);
+            m_include.append(v);
+            continue;
+        }
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomIncludes::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("includes") : tagName.toLower());
+
+    QDomElement child;
+
+    for (int i = 0; i < m_include.size(); ++i) {
+        DomInclude* v = m_include[i];
+        QDomNode child = v->write(doc, QLatin1String("include"));
+        e.appendChild(child);
+    }
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomIncludes::setElementInclude(const QList<DomInclude*>& a)
+{
+    m_include = a;
+}
+
+void DomInclude::clear(bool clear_all)
+{
+
+    if (clear_all) {
+    m_text = QString();
+    m_has_attr_location = false;
+    m_has_attr_impldecl = false;
+    }
+
+}
+
+DomInclude::DomInclude()
+{
+    m_has_attr_location = false;
+    m_has_attr_impldecl = false;
+}
+
+DomInclude::~DomInclude()
+{
+}
+
+void DomInclude::read(const QDomElement &node)
+{
+    if (node.hasAttribute(QLatin1String("location")))
+        setAttributeLocation(node.attribute(QLatin1String("location")));
+    if (node.hasAttribute(QLatin1String("impldecl")))
+        setAttributeImpldecl(node.attribute(QLatin1String("impldecl")));
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomInclude::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("include") : tagName.toLower());
+
+    QDomElement child;
+
+    if (hasAttributeLocation())
+        e.setAttribute(QLatin1String("location"), attributeLocation());
+
+    if (hasAttributeImpldecl())
+        e.setAttribute(QLatin1String("impldecl"), attributeImpldecl());
+
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomResources::clear(bool clear_all)
+{
+    for (int i = 0; i < m_include.size(); ++i)
+        delete m_include[i];
+    m_include.clear();
+
+    if (clear_all) {
+    m_text = QString();
+    m_has_attr_name = false;
+    }
+
+}
+
+DomResources::DomResources()
+{
+    m_has_attr_name = false;
+}
+
+DomResources::~DomResources()
+{
+    for (int i = 0; i < m_include.size(); ++i)
+        delete m_include[i];
+    m_include.clear();
+}
+
+void DomResources::read(const QDomElement &node)
+{
+    if (node.hasAttribute(QLatin1String("name")))
+        setAttributeName(node.attribute(QLatin1String("name")));
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+        if (tag == QLatin1String("include")) {
+            DomResource *v = new DomResource();
+            v->read(e);
+            m_include.append(v);
+            continue;
+        }
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomResources::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("resources") : tagName.toLower());
+
+    QDomElement child;
+
+    if (hasAttributeName())
+        e.setAttribute(QLatin1String("name"), attributeName());
+
+    for (int i = 0; i < m_include.size(); ++i) {
+        DomResource* v = m_include[i];
+        QDomNode child = v->write(doc, QLatin1String("include"));
+        e.appendChild(child);
+    }
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomResources::setElementInclude(const QList<DomResource*>& a)
+{
+    m_include = a;
+}
+
+void DomResource::clear(bool clear_all)
+{
+
+    if (clear_all) {
+    m_text = QString();
+    m_has_attr_location = false;
+    }
+
+}
+
+DomResource::DomResource()
+{
+    m_has_attr_location = false;
+}
+
+DomResource::~DomResource()
+{
+}
+
+void DomResource::read(const QDomElement &node)
+{
+    if (node.hasAttribute(QLatin1String("location")))
+        setAttributeLocation(node.attribute(QLatin1String("location")));
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomResource::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("resource") : tagName.toLower());
+
+    QDomElement child;
+
+    if (hasAttributeLocation())
+        e.setAttribute(QLatin1String("location"), attributeLocation());
+
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomActionGroup::clear(bool clear_all)
+{
+    for (int i = 0; i < m_action.size(); ++i)
+        delete m_action[i];
+    m_action.clear();
+    for (int i = 0; i < m_actionGroup.size(); ++i)
+        delete m_actionGroup[i];
+    m_actionGroup.clear();
+    for (int i = 0; i < m_property.size(); ++i)
+        delete m_property[i];
+    m_property.clear();
+    for (int i = 0; i < m_attribute.size(); ++i)
+        delete m_attribute[i];
+    m_attribute.clear();
+
+    if (clear_all) {
+    m_text = QString();
+    m_has_attr_name = false;
+    }
+
+}
+
+DomActionGroup::DomActionGroup()
+{
+    m_has_attr_name = false;
+}
+
+DomActionGroup::~DomActionGroup()
+{
+    for (int i = 0; i < m_action.size(); ++i)
+        delete m_action[i];
+    m_action.clear();
+    for (int i = 0; i < m_actionGroup.size(); ++i)
+        delete m_actionGroup[i];
+    m_actionGroup.clear();
+    for (int i = 0; i < m_property.size(); ++i)
+        delete m_property[i];
+    m_property.clear();
+    for (int i = 0; i < m_attribute.size(); ++i)
+        delete m_attribute[i];
+    m_attribute.clear();
+}
+
+void DomActionGroup::read(const QDomElement &node)
+{
+    if (node.hasAttribute(QLatin1String("name")))
+        setAttributeName(node.attribute(QLatin1String("name")));
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+        if (tag == QLatin1String("action")) {
+            DomAction *v = new DomAction();
+            v->read(e);
+            m_action.append(v);
+            continue;
+        }
+        if (tag == QLatin1String("actiongroup")) {
+            DomActionGroup *v = new DomActionGroup();
+            v->read(e);
+            m_actionGroup.append(v);
+            continue;
+        }
+        if (tag == QLatin1String("property")) {
+            DomProperty *v = new DomProperty();
+            v->read(e);
+            m_property.append(v);
+            continue;
+        }
+        if (tag == QLatin1String("attribute")) {
+            DomProperty *v = new DomProperty();
+            v->read(e);
+            m_attribute.append(v);
+            continue;
+        }
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomActionGroup::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("actiongroup") : tagName.toLower());
+
+    QDomElement child;
+
+    if (hasAttributeName())
+        e.setAttribute(QLatin1String("name"), attributeName());
+
+    for (int i = 0; i < m_action.size(); ++i) {
+        DomAction* v = m_action[i];
+        QDomNode child = v->write(doc, QLatin1String("action"));
+        e.appendChild(child);
+    }
+    for (int i = 0; i < m_actionGroup.size(); ++i) {
+        DomActionGroup* v = m_actionGroup[i];
+        QDomNode child = v->write(doc, QLatin1String("actiongroup"));
+        e.appendChild(child);
+    }
+    for (int i = 0; i < m_property.size(); ++i) {
+        DomProperty* v = m_property[i];
+        QDomNode child = v->write(doc, QLatin1String("property"));
+        e.appendChild(child);
+    }
+    for (int i = 0; i < m_attribute.size(); ++i) {
+        DomProperty* v = m_attribute[i];
+        QDomNode child = v->write(doc, QLatin1String("attribute"));
+        e.appendChild(child);
+    }
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomActionGroup::setElementAction(const QList<DomAction*>& a)
+{
+    m_action = a;
+}
+
+void DomActionGroup::setElementActionGroup(const QList<DomActionGroup*>& a)
+{
+    m_actionGroup = a;
+}
+
+void DomActionGroup::setElementProperty(const QList<DomProperty*>& a)
+{
+    m_property = a;
+}
+
+void DomActionGroup::setElementAttribute(const QList<DomProperty*>& a)
+{
+    m_attribute = a;
+}
+
+void DomAction::clear(bool clear_all)
+{
+    for (int i = 0; i < m_property.size(); ++i)
+        delete m_property[i];
+    m_property.clear();
+    for (int i = 0; i < m_attribute.size(); ++i)
+        delete m_attribute[i];
+    m_attribute.clear();
+
+    if (clear_all) {
+    m_text = QString();
+    m_has_attr_name = false;
+    m_has_attr_menu = false;
+    }
+
+}
+
+DomAction::DomAction()
+{
+    m_has_attr_name = false;
+    m_has_attr_menu = false;
+}
+
+DomAction::~DomAction()
+{
+    for (int i = 0; i < m_property.size(); ++i)
+        delete m_property[i];
+    m_property.clear();
+    for (int i = 0; i < m_attribute.size(); ++i)
+        delete m_attribute[i];
+    m_attribute.clear();
+}
+
+void DomAction::read(const QDomElement &node)
+{
+    if (node.hasAttribute(QLatin1String("name")))
+        setAttributeName(node.attribute(QLatin1String("name")));
+    if (node.hasAttribute(QLatin1String("menu")))
+        setAttributeMenu(node.attribute(QLatin1String("menu")));
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+        if (tag == QLatin1String("property")) {
+            DomProperty *v = new DomProperty();
+            v->read(e);
+            m_property.append(v);
+            continue;
+        }
+        if (tag == QLatin1String("attribute")) {
+            DomProperty *v = new DomProperty();
+            v->read(e);
+            m_attribute.append(v);
+            continue;
+        }
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomAction::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("action") : tagName.toLower());
+
+    QDomElement child;
+
+    if (hasAttributeName())
+        e.setAttribute(QLatin1String("name"), attributeName());
+
+    if (hasAttributeMenu())
+        e.setAttribute(QLatin1String("menu"), attributeMenu());
+
+    for (int i = 0; i < m_property.size(); ++i) {
+        DomProperty* v = m_property[i];
+        QDomNode child = v->write(doc, QLatin1String("property"));
+        e.appendChild(child);
+    }
+    for (int i = 0; i < m_attribute.size(); ++i) {
+        DomProperty* v = m_attribute[i];
+        QDomNode child = v->write(doc, QLatin1String("attribute"));
+        e.appendChild(child);
+    }
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomAction::setElementProperty(const QList<DomProperty*>& a)
+{
+    m_property = a;
+}
+
+void DomAction::setElementAttribute(const QList<DomProperty*>& a)
+{
+    m_attribute = a;
+}
+
+void DomActionRef::clear(bool clear_all)
+{
+
+    if (clear_all) {
+    m_text = QString();
+    m_has_attr_name = false;
+    }
+
+}
+
+DomActionRef::DomActionRef()
+{
+    m_has_attr_name = false;
+}
+
+DomActionRef::~DomActionRef()
+{
+}
+
+void DomActionRef::read(const QDomElement &node)
+{
+    if (node.hasAttribute(QLatin1String("name")))
+        setAttributeName(node.attribute(QLatin1String("name")));
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomActionRef::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("actionref") : tagName.toLower());
+
+    QDomElement child;
+
+    if (hasAttributeName())
+        e.setAttribute(QLatin1String("name"), attributeName());
+
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomImages::clear(bool clear_all)
+{
+    for (int i = 0; i < m_image.size(); ++i)
+        delete m_image[i];
+    m_image.clear();
+
+    if (clear_all) {
+    m_text = QString();
+    }
+
+}
+
+DomImages::DomImages()
+{
+}
+
+DomImages::~DomImages()
+{
+    for (int i = 0; i < m_image.size(); ++i)
+        delete m_image[i];
+    m_image.clear();
+}
+
+void DomImages::read(const QDomElement &node)
+{
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+        if (tag == QLatin1String("image")) {
+            DomImage *v = new DomImage();
+            v->read(e);
+            m_image.append(v);
+            continue;
+        }
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomImages::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("images") : tagName.toLower());
+
+    QDomElement child;
+
+    for (int i = 0; i < m_image.size(); ++i) {
+        DomImage* v = m_image[i];
+        QDomNode child = v->write(doc, QLatin1String("image"));
+        e.appendChild(child);
+    }
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomImages::setElementImage(const QList<DomImage*>& a)
+{
+    m_image = a;
+}
+
+void DomImage::clear(bool clear_all)
+{
+    delete m_data;
+
+    if (clear_all) {
+    m_text = QString();
+    m_has_attr_name = false;
+    }
+
+    m_children = 0;
+    m_data = 0;
+}
+
+DomImage::DomImage()
+{
+    m_children = 0;
+    m_has_attr_name = false;
+    m_data = 0;
+}
+
+DomImage::~DomImage()
+{
+    delete m_data;
+}
+
+void DomImage::read(const QDomElement &node)
+{
+    if (node.hasAttribute(QLatin1String("name")))
+        setAttributeName(node.attribute(QLatin1String("name")));
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+        if (tag == QLatin1String("data")) {
+            DomImageData *v = new DomImageData();
+            v->read(e);
+            setElementData(v);
+            continue;
+        }
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomImage::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("image") : tagName.toLower());
+
+    QDomElement child;
+
+    if (hasAttributeName())
+        e.setAttribute(QLatin1String("name"), attributeName());
+
+    if (m_children & Data) {
+        e.appendChild(m_data->write(doc, QLatin1String("data")));
+    }
+
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomImage::setElementData(DomImageData* a)
+{
+    delete m_data;
+    m_children |= Data;
+    m_data = a;
+}
+
+void DomImage::clearElementData()
+{
+    delete m_data;
+    m_data = 0;
+    m_children &= ~Data;
+}
+
+void DomImageData::clear(bool clear_all)
+{
+
+    if (clear_all) {
+    m_text = QString();
+    m_has_attr_format = false;
+    m_has_attr_length = false;
+    m_attr_length = 0;
+    }
+
+}
+
+DomImageData::DomImageData()
+{
+    m_has_attr_format = false;
+    m_has_attr_length = false;
+    m_attr_length = 0;
+}
+
+DomImageData::~DomImageData()
+{
+}
+
+void DomImageData::read(const QDomElement &node)
+{
+    if (node.hasAttribute(QLatin1String("format")))
+        setAttributeFormat(node.attribute(QLatin1String("format")));
+    if (node.hasAttribute(QLatin1String("length")))
+        setAttributeLength(node.attribute(QLatin1String("length")).toInt());
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomImageData::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("imagedata") : tagName.toLower());
+
+    QDomElement child;
+
+    if (hasAttributeFormat())
+        e.setAttribute(QLatin1String("format"), attributeFormat());
+
+    if (hasAttributeLength())
+        e.setAttribute(QLatin1String("length"), attributeLength());
+
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomCustomWidgets::clear(bool clear_all)
+{
+    for (int i = 0; i < m_customWidget.size(); ++i)
+        delete m_customWidget[i];
+    m_customWidget.clear();
+
+    if (clear_all) {
+    m_text = QString();
+    }
+
+}
+
+DomCustomWidgets::DomCustomWidgets()
+{
+}
+
+DomCustomWidgets::~DomCustomWidgets()
+{
+    for (int i = 0; i < m_customWidget.size(); ++i)
+        delete m_customWidget[i];
+    m_customWidget.clear();
+}
+
+void DomCustomWidgets::read(const QDomElement &node)
+{
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+        if (tag == QLatin1String("customwidget")) {
+            DomCustomWidget *v = new DomCustomWidget();
+            v->read(e);
+            m_customWidget.append(v);
+            continue;
+        }
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomCustomWidgets::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("customwidgets") : tagName.toLower());
+
+    QDomElement child;
+
+    for (int i = 0; i < m_customWidget.size(); ++i) {
+        DomCustomWidget* v = m_customWidget[i];
+        QDomNode child = v->write(doc, QLatin1String("customwidget"));
+        e.appendChild(child);
+    }
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomCustomWidgets::setElementCustomWidget(const QList<DomCustomWidget*>& a)
+{
+    m_customWidget = a;
+}
+
+void DomHeader::clear(bool clear_all)
+{
+
+    if (clear_all) {
+    m_text = QString();
+    m_has_attr_location = false;
+    }
+
+}
+
+DomHeader::DomHeader()
+{
+    m_has_attr_location = false;
+}
+
+DomHeader::~DomHeader()
+{
+}
+
+void DomHeader::read(const QDomElement &node)
+{
+    if (node.hasAttribute(QLatin1String("location")))
+        setAttributeLocation(node.attribute(QLatin1String("location")));
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomHeader::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("header") : tagName.toLower());
+
+    QDomElement child;
+
+    if (hasAttributeLocation())
+        e.setAttribute(QLatin1String("location"), attributeLocation());
+
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomCustomWidget::clear(bool clear_all)
+{
+    delete m_header;
+    delete m_sizeHint;
+    delete m_sizePolicy;
+    delete m_script;
+    delete m_properties;
+    delete m_slots;
+
+    if (clear_all) {
+    m_text = QString();
+    }
+
+    m_children = 0;
+    m_header = 0;
+    m_sizeHint = 0;
+    m_container = 0;
+    m_sizePolicy = 0;
+    m_script = 0;
+    m_properties = 0;
+    m_slots = 0;
+}
+
+DomCustomWidget::DomCustomWidget()
+{
+    m_children = 0;
+    m_header = 0;
+    m_sizeHint = 0;
+    m_container = 0;
+    m_sizePolicy = 0;
+    m_script = 0;
+    m_properties = 0;
+    m_slots = 0;
+}
+
+DomCustomWidget::~DomCustomWidget()
+{
+    delete m_header;
+    delete m_sizeHint;
+    delete m_sizePolicy;
+    delete m_script;
+    delete m_properties;
+    delete m_slots;
+}
+
+void DomCustomWidget::read(const QDomElement &node)
+{
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+        if (tag == QLatin1String("class")) {
+            setElementClass(e.text());
+            continue;
+        }
+        if (tag == QLatin1String("extends")) {
+            setElementExtends(e.text());
+            continue;
+        }
+        if (tag == QLatin1String("header")) {
+            DomHeader *v = new DomHeader();
+            v->read(e);
+            setElementHeader(v);
+            continue;
+        }
+        if (tag == QLatin1String("sizehint")) {
+            DomSize *v = new DomSize();
+            v->read(e);
+            setElementSizeHint(v);
+            continue;
+        }
+        if (tag == QLatin1String("addpagemethod")) {
+            setElementAddPageMethod(e.text());
+            continue;
+        }
+        if (tag == QLatin1String("container")) {
+            setElementContainer(e.text().toInt());
+            continue;
+        }
+        if (tag == QLatin1String("sizepolicy")) {
+            DomSizePolicyData *v = new DomSizePolicyData();
+            v->read(e);
+            setElementSizePolicy(v);
+            continue;
+        }
+        if (tag == QLatin1String("pixmap")) {
+            setElementPixmap(e.text());
+            continue;
+        }
+        if (tag == QLatin1String("script")) {
+            DomScript *v = new DomScript();
+            v->read(e);
+            setElementScript(v);
+            continue;
+        }
+        if (tag == QLatin1String("properties")) {
+            DomProperties *v = new DomProperties();
+            v->read(e);
+            setElementProperties(v);
+            continue;
+        }
+        if (tag == QLatin1String("slots")) {
+            DomSlots *v = new DomSlots();
+            v->read(e);
+            setElementSlots(v);
+            continue;
+        }
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomCustomWidget::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("customwidget") : tagName.toLower());
+
+    QDomElement child;
+
+    if (m_children & Class) {
+        child = doc.createElement(QLatin1String("class"));
+        child.appendChild(doc.createTextNode(m_class));
+        e.appendChild(child);
+    }
+
+    if (m_children & Extends) {
+        child = doc.createElement(QLatin1String("extends"));
+        child.appendChild(doc.createTextNode(m_extends));
+        e.appendChild(child);
+    }
+
+    if (m_children & Header) {
+        e.appendChild(m_header->write(doc, QLatin1String("header")));
+    }
+
+    if (m_children & SizeHint) {
+        e.appendChild(m_sizeHint->write(doc, QLatin1String("sizehint")));
+    }
+
+    if (m_children & AddPageMethod) {
+        child = doc.createElement(QLatin1String("addpagemethod"));
+        child.appendChild(doc.createTextNode(m_addPageMethod));
+        e.appendChild(child);
+    }
+
+    if (m_children & Container) {
+        child = doc.createElement(QLatin1String("container"));
+        child.appendChild(doc.createTextNode(QString::number(m_container)));
+        e.appendChild(child);
+    }
+
+    if (m_children & SizePolicy) {
+        e.appendChild(m_sizePolicy->write(doc, QLatin1String("sizepolicy")));
+    }
+
+    if (m_children & Pixmap) {
+        child = doc.createElement(QLatin1String("pixmap"));
+        child.appendChild(doc.createTextNode(m_pixmap));
+        e.appendChild(child);
+    }
+
+    if (m_children & Script) {
+        e.appendChild(m_script->write(doc, QLatin1String("script")));
+    }
+
+    if (m_children & Properties) {
+        e.appendChild(m_properties->write(doc, QLatin1String("properties")));
+    }
+
+    if (m_children & Slots) {
+        e.appendChild(m_slots->write(doc, QLatin1String("slots")));
+    }
+
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomCustomWidget::setElementClass(const QString& a)
+{
+    m_children |= Class;
+    m_class = a;
+}
+
+void DomCustomWidget::setElementExtends(const QString& a)
+{
+    m_children |= Extends;
+    m_extends = a;
+}
+
+void DomCustomWidget::setElementHeader(DomHeader* a)
+{
+    delete m_header;
+    m_children |= Header;
+    m_header = a;
+}
+
+void DomCustomWidget::setElementSizeHint(DomSize* a)
+{
+    delete m_sizeHint;
+    m_children |= SizeHint;
+    m_sizeHint = a;
+}
+
+void DomCustomWidget::setElementAddPageMethod(const QString& a)
+{
+    m_children |= AddPageMethod;
+    m_addPageMethod = a;
+}
+
+void DomCustomWidget::setElementContainer(int a)
+{
+    m_children |= Container;
+    m_container = a;
+}
+
+void DomCustomWidget::setElementSizePolicy(DomSizePolicyData* a)
+{
+    delete m_sizePolicy;
+    m_children |= SizePolicy;
+    m_sizePolicy = a;
+}
+
+void DomCustomWidget::setElementPixmap(const QString& a)
+{
+    m_children |= Pixmap;
+    m_pixmap = a;
+}
+
+void DomCustomWidget::setElementScript(DomScript* a)
+{
+    delete m_script;
+    m_children |= Script;
+    m_script = a;
+}
+
+void DomCustomWidget::setElementProperties(DomProperties* a)
+{
+    delete m_properties;
+    m_children |= Properties;
+    m_properties = a;
+}
+
+void DomCustomWidget::setElementSlots(DomSlots* a)
+{
+    delete m_slots;
+    m_children |= Slots;
+    m_slots = a;
+}
+
+void DomCustomWidget::clearElementClass()
+{
+    m_children &= ~Class;
+}
+
+void DomCustomWidget::clearElementExtends()
+{
+    m_children &= ~Extends;
+}
+
+void DomCustomWidget::clearElementHeader()
+{
+    delete m_header;
+    m_header = 0;
+    m_children &= ~Header;
+}
+
+void DomCustomWidget::clearElementSizeHint()
+{
+    delete m_sizeHint;
+    m_sizeHint = 0;
+    m_children &= ~SizeHint;
+}
+
+void DomCustomWidget::clearElementAddPageMethod()
+{
+    m_children &= ~AddPageMethod;
+}
+
+void DomCustomWidget::clearElementContainer()
+{
+    m_children &= ~Container;
+}
+
+void DomCustomWidget::clearElementSizePolicy()
+{
+    delete m_sizePolicy;
+    m_sizePolicy = 0;
+    m_children &= ~SizePolicy;
+}
+
+void DomCustomWidget::clearElementPixmap()
+{
+    m_children &= ~Pixmap;
+}
+
+void DomCustomWidget::clearElementScript()
+{
+    delete m_script;
+    m_script = 0;
+    m_children &= ~Script;
+}
+
+void DomCustomWidget::clearElementProperties()
+{
+    delete m_properties;
+    m_properties = 0;
+    m_children &= ~Properties;
+}
+
+void DomCustomWidget::clearElementSlots()
+{
+    delete m_slots;
+    m_slots = 0;
+    m_children &= ~Slots;
+}
+
+void DomProperties::clear(bool clear_all)
+{
+    for (int i = 0; i < m_property.size(); ++i)
+        delete m_property[i];
+    m_property.clear();
+
+    if (clear_all) {
+    m_text = QString();
+    }
+
+}
+
+DomProperties::DomProperties()
+{
+}
+
+DomProperties::~DomProperties()
+{
+    for (int i = 0; i < m_property.size(); ++i)
+        delete m_property[i];
+    m_property.clear();
+}
+
+void DomProperties::read(const QDomElement &node)
+{
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+        if (tag == QLatin1String("property")) {
+            DomPropertyData *v = new DomPropertyData();
+            v->read(e);
+            m_property.append(v);
+            continue;
+        }
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomProperties::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("properties") : tagName.toLower());
+
+    QDomElement child;
+
+    for (int i = 0; i < m_property.size(); ++i) {
+        DomPropertyData* v = m_property[i];
+        QDomNode child = v->write(doc, QLatin1String("property"));
+        e.appendChild(child);
+    }
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomProperties::setElementProperty(const QList<DomPropertyData*>& a)
+{
+    m_property = a;
+}
+
+void DomPropertyData::clear(bool clear_all)
+{
+
+    if (clear_all) {
+    m_text = QString();
+    m_has_attr_type = false;
+    }
+
+}
+
+DomPropertyData::DomPropertyData()
+{
+    m_has_attr_type = false;
+}
+
+DomPropertyData::~DomPropertyData()
+{
+}
+
+void DomPropertyData::read(const QDomElement &node)
+{
+    if (node.hasAttribute(QLatin1String("type")))
+        setAttributeType(node.attribute(QLatin1String("type")));
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomPropertyData::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("propertydata") : tagName.toLower());
+
+    QDomElement child;
+
+    if (hasAttributeType())
+        e.setAttribute(QLatin1String("type"), attributeType());
+
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomSizePolicyData::clear(bool clear_all)
+{
+
+    if (clear_all) {
+    m_text = QString();
+    }
+
+    m_children = 0;
+    m_horData = 0;
+    m_verData = 0;
+}
+
+DomSizePolicyData::DomSizePolicyData()
+{
+    m_children = 0;
+    m_horData = 0;
+    m_verData = 0;
+}
+
+DomSizePolicyData::~DomSizePolicyData()
+{
+}
+
+void DomSizePolicyData::read(const QDomElement &node)
+{
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+        if (tag == QLatin1String("hordata")) {
+            setElementHorData(e.text().toInt());
+            continue;
+        }
+        if (tag == QLatin1String("verdata")) {
+            setElementVerData(e.text().toInt());
+            continue;
+        }
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomSizePolicyData::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("sizepolicydata") : tagName.toLower());
+
+    QDomElement child;
+
+    if (m_children & HorData) {
+        child = doc.createElement(QLatin1String("hordata"));
+        child.appendChild(doc.createTextNode(QString::number(m_horData)));
+        e.appendChild(child);
+    }
+
+    if (m_children & VerData) {
+        child = doc.createElement(QLatin1String("verdata"));
+        child.appendChild(doc.createTextNode(QString::number(m_verData)));
+        e.appendChild(child);
+    }
+
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomSizePolicyData::setElementHorData(int a)
+{
+    m_children |= HorData;
+    m_horData = a;
+}
+
+void DomSizePolicyData::setElementVerData(int a)
+{
+    m_children |= VerData;
+    m_verData = a;
+}
+
+void DomSizePolicyData::clearElementHorData()
+{
+    m_children &= ~HorData;
+}
+
+void DomSizePolicyData::clearElementVerData()
+{
+    m_children &= ~VerData;
+}
+
+void DomLayoutDefault::clear(bool clear_all)
+{
+
+    if (clear_all) {
+    m_text = QString();
+    m_has_attr_spacing = false;
+    m_attr_spacing = 0;
+    m_has_attr_margin = false;
+    m_attr_margin = 0;
+    }
+
+}
+
+DomLayoutDefault::DomLayoutDefault()
+{
+    m_has_attr_spacing = false;
+    m_attr_spacing = 0;
+    m_has_attr_margin = false;
+    m_attr_margin = 0;
+}
+
+DomLayoutDefault::~DomLayoutDefault()
+{
+}
+
+void DomLayoutDefault::read(const QDomElement &node)
+{
+    if (node.hasAttribute(QLatin1String("spacing")))
+        setAttributeSpacing(node.attribute(QLatin1String("spacing")).toInt());
+    if (node.hasAttribute(QLatin1String("margin")))
+        setAttributeMargin(node.attribute(QLatin1String("margin")).toInt());
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomLayoutDefault::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("layoutdefault") : tagName.toLower());
+
+    QDomElement child;
+
+    if (hasAttributeSpacing())
+        e.setAttribute(QLatin1String("spacing"), attributeSpacing());
+
+    if (hasAttributeMargin())
+        e.setAttribute(QLatin1String("margin"), attributeMargin());
+
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomLayoutFunction::clear(bool clear_all)
+{
+
+    if (clear_all) {
+    m_text = QString();
+    m_has_attr_spacing = false;
+    m_has_attr_margin = false;
+    }
+
+}
+
+DomLayoutFunction::DomLayoutFunction()
+{
+    m_has_attr_spacing = false;
+    m_has_attr_margin = false;
+}
+
+DomLayoutFunction::~DomLayoutFunction()
+{
+}
+
+void DomLayoutFunction::read(const QDomElement &node)
+{
+    if (node.hasAttribute(QLatin1String("spacing")))
+        setAttributeSpacing(node.attribute(QLatin1String("spacing")));
+    if (node.hasAttribute(QLatin1String("margin")))
+        setAttributeMargin(node.attribute(QLatin1String("margin")));
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomLayoutFunction::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("layoutfunction") : tagName.toLower());
+
+    QDomElement child;
+
+    if (hasAttributeSpacing())
+        e.setAttribute(QLatin1String("spacing"), attributeSpacing());
+
+    if (hasAttributeMargin())
+        e.setAttribute(QLatin1String("margin"), attributeMargin());
+
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomTabStops::clear(bool clear_all)
+{
+    m_tabStop.clear();
+
+    if (clear_all) {
+    m_text = QString();
+    }
+
+}
+
+DomTabStops::DomTabStops()
+{
+}
+
+DomTabStops::~DomTabStops()
+{
+    m_tabStop.clear();
+}
+
+void DomTabStops::read(const QDomElement &node)
+{
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+        if (tag == QLatin1String("tabstop")) {
+            m_tabStop.append(e.text());
+            continue;
+        }
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomTabStops::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("tabstops") : tagName.toLower());
+
+    QDomElement child;
+
+    for (int i = 0; i < m_tabStop.size(); ++i) {
+        QString v = m_tabStop[i];
+        QDomNode child = doc.createElement(QLatin1String("tabstop"));
+        child.appendChild(doc.createTextNode(v));
+        e.appendChild(child);
+    }
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomTabStops::setElementTabStop(const QStringList& a)
+{
+    m_tabStop = a;
+}
+
+void DomLayout::clear(bool clear_all)
+{
+    for (int i = 0; i < m_property.size(); ++i)
+        delete m_property[i];
+    m_property.clear();
+    for (int i = 0; i < m_attribute.size(); ++i)
+        delete m_attribute[i];
+    m_attribute.clear();
+    for (int i = 0; i < m_item.size(); ++i)
+        delete m_item[i];
+    m_item.clear();
+
+    if (clear_all) {
+    m_text = QString();
+    m_has_attr_class = false;
+    m_has_attr_name = false;
+    }
+
+}
+
+DomLayout::DomLayout()
+{
+    m_has_attr_class = false;
+    m_has_attr_name = false;
+}
+
+DomLayout::~DomLayout()
+{
+    for (int i = 0; i < m_property.size(); ++i)
+        delete m_property[i];
+    m_property.clear();
+    for (int i = 0; i < m_attribute.size(); ++i)
+        delete m_attribute[i];
+    m_attribute.clear();
+    for (int i = 0; i < m_item.size(); ++i)
+        delete m_item[i];
+    m_item.clear();
+}
+
+void DomLayout::read(const QDomElement &node)
+{
+    if (node.hasAttribute(QLatin1String("class")))
+        setAttributeClass(node.attribute(QLatin1String("class")));
+    if (node.hasAttribute(QLatin1String("name")))
+        setAttributeName(node.attribute(QLatin1String("name")));
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+        if (tag == QLatin1String("property")) {
+            DomProperty *v = new DomProperty();
+            v->read(e);
+            m_property.append(v);
+            continue;
+        }
+        if (tag == QLatin1String("attribute")) {
+            DomProperty *v = new DomProperty();
+            v->read(e);
+            m_attribute.append(v);
+            continue;
+        }
+        if (tag == QLatin1String("item")) {
+            DomLayoutItem *v = new DomLayoutItem();
+            v->read(e);
+            m_item.append(v);
+            continue;
+        }
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomLayout::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("layout") : tagName.toLower());
+
+    QDomElement child;
+
+    if (hasAttributeClass())
+        e.setAttribute(QLatin1String("class"), attributeClass());
+
+    if (hasAttributeName())
+        e.setAttribute(QLatin1String("name"), attributeName());
+
+    for (int i = 0; i < m_property.size(); ++i) {
+        DomProperty* v = m_property[i];
+        QDomNode child = v->write(doc, QLatin1String("property"));
+        e.appendChild(child);
+    }
+    for (int i = 0; i < m_attribute.size(); ++i) {
+        DomProperty* v = m_attribute[i];
+        QDomNode child = v->write(doc, QLatin1String("attribute"));
+        e.appendChild(child);
+    }
+    for (int i = 0; i < m_item.size(); ++i) {
+        DomLayoutItem* v = m_item[i];
+        QDomNode child = v->write(doc, QLatin1String("item"));
+        e.appendChild(child);
+    }
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomLayout::setElementProperty(const QList<DomProperty*>& a)
+{
+    m_property = a;
+}
+
+void DomLayout::setElementAttribute(const QList<DomProperty*>& a)
+{
+    m_attribute = a;
+}
+
+void DomLayout::setElementItem(const QList<DomLayoutItem*>& a)
+{
+    m_item = a;
+}
+
+void DomLayoutItem::clear(bool clear_all)
+{
+    delete m_widget;
+    delete m_layout;
+    delete m_spacer;
+
+    if (clear_all) {
+    m_text = QString();
+    m_has_attr_row = false;
+    m_attr_row = 0;
+    m_has_attr_column = false;
+    m_attr_column = 0;
+    m_has_attr_rowSpan = false;
+    m_attr_rowSpan = 0;
+    m_has_attr_colSpan = false;
+    m_attr_colSpan = 0;
+    }
+
+    m_kind = Unknown;
+
+    m_widget = 0;
+    m_layout = 0;
+    m_spacer = 0;
+}
+
+DomLayoutItem::DomLayoutItem()
+{
+    m_kind = Unknown;
+
+    m_has_attr_row = false;
+    m_attr_row = 0;
+    m_has_attr_column = false;
+    m_attr_column = 0;
+    m_has_attr_rowSpan = false;
+    m_attr_rowSpan = 0;
+    m_has_attr_colSpan = false;
+    m_attr_colSpan = 0;
+    m_widget = 0;
+    m_layout = 0;
+    m_spacer = 0;
+}
+
+DomLayoutItem::~DomLayoutItem()
+{
+    delete m_widget;
+    delete m_layout;
+    delete m_spacer;
+}
+
+void DomLayoutItem::read(const QDomElement &node)
+{
+    if (node.hasAttribute(QLatin1String("row")))
+        setAttributeRow(node.attribute(QLatin1String("row")).toInt());
+    if (node.hasAttribute(QLatin1String("column")))
+        setAttributeColumn(node.attribute(QLatin1String("column")).toInt());
+    if (node.hasAttribute(QLatin1String("rowspan")))
+        setAttributeRowSpan(node.attribute(QLatin1String("rowspan")).toInt());
+    if (node.hasAttribute(QLatin1String("colspan")))
+        setAttributeColSpan(node.attribute(QLatin1String("colspan")).toInt());
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+        if (tag == QLatin1String("widget")) {
+            DomWidget *v = new DomWidget();
+            v->read(e);
+            setElementWidget(v);
+            continue;
+        }
+        if (tag == QLatin1String("layout")) {
+            DomLayout *v = new DomLayout();
+            v->read(e);
+            setElementLayout(v);
+            continue;
+        }
+        if (tag == QLatin1String("spacer")) {
+            DomSpacer *v = new DomSpacer();
+            v->read(e);
+            setElementSpacer(v);
+            continue;
+        }
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomLayoutItem::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("layoutitem") : tagName.toLower());
+
+    QDomElement child;
+
+    if (hasAttributeRow())
+        e.setAttribute(QLatin1String("row"), attributeRow());
+
+    if (hasAttributeColumn())
+        e.setAttribute(QLatin1String("column"), attributeColumn());
+
+    if (hasAttributeRowSpan())
+        e.setAttribute(QLatin1String("rowspan"), attributeRowSpan());
+
+    if (hasAttributeColSpan())
+        e.setAttribute(QLatin1String("colspan"), attributeColSpan());
+
+    switch(kind()) {
+        case Widget: {
+            DomWidget* v = elementWidget();
+            if (v != 0) {
+                QDomElement child = v->write(doc, QLatin1String("widget"));
+                e.appendChild(child);
+            }
+            break;
+        }
+        case Layout: {
+            DomLayout* v = elementLayout();
+            if (v != 0) {
+                QDomElement child = v->write(doc, QLatin1String("layout"));
+                e.appendChild(child);
+            }
+            break;
+        }
+        case Spacer: {
+            DomSpacer* v = elementSpacer();
+            if (v != 0) {
+                QDomElement child = v->write(doc, QLatin1String("spacer"));
+                e.appendChild(child);
+            }
+            break;
+        }
+        default:
+            break;
+    }
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomLayoutItem::setElementWidget(DomWidget* a)
+{
+    clear(false);
+    m_kind = Widget;
+    m_widget = a;
+}
+
+void DomLayoutItem::setElementLayout(DomLayout* a)
+{
+    clear(false);
+    m_kind = Layout;
+    m_layout = a;
+}
+
+void DomLayoutItem::setElementSpacer(DomSpacer* a)
+{
+    clear(false);
+    m_kind = Spacer;
+    m_spacer = a;
+}
+
+void DomRow::clear(bool clear_all)
+{
+    for (int i = 0; i < m_property.size(); ++i)
+        delete m_property[i];
+    m_property.clear();
+
+    if (clear_all) {
+    m_text = QString();
+    }
+
+}
+
+DomRow::DomRow()
+{
+}
+
+DomRow::~DomRow()
+{
+    for (int i = 0; i < m_property.size(); ++i)
+        delete m_property[i];
+    m_property.clear();
+}
+
+void DomRow::read(const QDomElement &node)
+{
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+        if (tag == QLatin1String("property")) {
+            DomProperty *v = new DomProperty();
+            v->read(e);
+            m_property.append(v);
+            continue;
+        }
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomRow::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("row") : tagName.toLower());
+
+    QDomElement child;
+
+    for (int i = 0; i < m_property.size(); ++i) {
+        DomProperty* v = m_property[i];
+        QDomNode child = v->write(doc, QLatin1String("property"));
+        e.appendChild(child);
+    }
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomRow::setElementProperty(const QList<DomProperty*>& a)
+{
+    m_property = a;
+}
+
+void DomColumn::clear(bool clear_all)
+{
+    for (int i = 0; i < m_property.size(); ++i)
+        delete m_property[i];
+    m_property.clear();
+
+    if (clear_all) {
+    m_text = QString();
+    }
+
+}
+
+DomColumn::DomColumn()
+{
+}
+
+DomColumn::~DomColumn()
+{
+    for (int i = 0; i < m_property.size(); ++i)
+        delete m_property[i];
+    m_property.clear();
+}
+
+void DomColumn::read(const QDomElement &node)
+{
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+        if (tag == QLatin1String("property")) {
+            DomProperty *v = new DomProperty();
+            v->read(e);
+            m_property.append(v);
+            continue;
+        }
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomColumn::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("column") : tagName.toLower());
+
+    QDomElement child;
+
+    for (int i = 0; i < m_property.size(); ++i) {
+        DomProperty* v = m_property[i];
+        QDomNode child = v->write(doc, QLatin1String("property"));
+        e.appendChild(child);
+    }
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomColumn::setElementProperty(const QList<DomProperty*>& a)
+{
+    m_property = a;
+}
+
+void DomItem::clear(bool clear_all)
+{
+    for (int i = 0; i < m_property.size(); ++i)
+        delete m_property[i];
+    m_property.clear();
+    for (int i = 0; i < m_item.size(); ++i)
+        delete m_item[i];
+    m_item.clear();
+
+    if (clear_all) {
+    m_text = QString();
+    m_has_attr_row = false;
+    m_attr_row = 0;
+    m_has_attr_column = false;
+    m_attr_column = 0;
+    }
+
+}
+
+DomItem::DomItem()
+{
+    m_has_attr_row = false;
+    m_attr_row = 0;
+    m_has_attr_column = false;
+    m_attr_column = 0;
+}
+
+DomItem::~DomItem()
+{
+    for (int i = 0; i < m_property.size(); ++i)
+        delete m_property[i];
+    m_property.clear();
+    for (int i = 0; i < m_item.size(); ++i)
+        delete m_item[i];
+    m_item.clear();
+}
+
+void DomItem::read(const QDomElement &node)
+{
+    if (node.hasAttribute(QLatin1String("row")))
+        setAttributeRow(node.attribute(QLatin1String("row")).toInt());
+    if (node.hasAttribute(QLatin1String("column")))
+        setAttributeColumn(node.attribute(QLatin1String("column")).toInt());
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+        if (tag == QLatin1String("property")) {
+            DomProperty *v = new DomProperty();
+            v->read(e);
+            m_property.append(v);
+            continue;
+        }
+        if (tag == QLatin1String("item")) {
+            DomItem *v = new DomItem();
+            v->read(e);
+            m_item.append(v);
+            continue;
+        }
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomItem::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("item") : tagName.toLower());
+
+    QDomElement child;
+
+    if (hasAttributeRow())
+        e.setAttribute(QLatin1String("row"), attributeRow());
+
+    if (hasAttributeColumn())
+        e.setAttribute(QLatin1String("column"), attributeColumn());
+
+    for (int i = 0; i < m_property.size(); ++i) {
+        DomProperty* v = m_property[i];
+        QDomNode child = v->write(doc, QLatin1String("property"));
+        e.appendChild(child);
+    }
+    for (int i = 0; i < m_item.size(); ++i) {
+        DomItem* v = m_item[i];
+        QDomNode child = v->write(doc, QLatin1String("item"));
+        e.appendChild(child);
+    }
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomItem::setElementProperty(const QList<DomProperty*>& a)
+{
+    m_property = a;
+}
+
+void DomItem::setElementItem(const QList<DomItem*>& a)
+{
+    m_item = a;
+}
+
+void DomWidget::clear(bool clear_all)
+{
+    m_class.clear();
+    for (int i = 0; i < m_property.size(); ++i)
+        delete m_property[i];
+    m_property.clear();
+    for (int i = 0; i < m_script.size(); ++i)
+        delete m_script[i];
+    m_script.clear();
+    for (int i = 0; i < m_widgetData.size(); ++i)
+        delete m_widgetData[i];
+    m_widgetData.clear();
+    for (int i = 0; i < m_attribute.size(); ++i)
+        delete m_attribute[i];
+    m_attribute.clear();
+    for (int i = 0; i < m_row.size(); ++i)
+        delete m_row[i];
+    m_row.clear();
+    for (int i = 0; i < m_column.size(); ++i)
+        delete m_column[i];
+    m_column.clear();
+    for (int i = 0; i < m_item.size(); ++i)
+        delete m_item[i];
+    m_item.clear();
+    for (int i = 0; i < m_layout.size(); ++i)
+        delete m_layout[i];
+    m_layout.clear();
+    for (int i = 0; i < m_widget.size(); ++i)
+        delete m_widget[i];
+    m_widget.clear();
+    for (int i = 0; i < m_action.size(); ++i)
+        delete m_action[i];
+    m_action.clear();
+    for (int i = 0; i < m_actionGroup.size(); ++i)
+        delete m_actionGroup[i];
+    m_actionGroup.clear();
+    for (int i = 0; i < m_addAction.size(); ++i)
+        delete m_addAction[i];
+    m_addAction.clear();
+    m_zOrder.clear();
+
+    if (clear_all) {
+    m_text = QString();
+    m_has_attr_class = false;
+    m_has_attr_name = false;
+    m_has_attr_native = false;
+    m_attr_native = false;
+    }
+
+}
+
+DomWidget::DomWidget()
+{
+    m_has_attr_class = false;
+    m_has_attr_name = false;
+    m_has_attr_native = false;
+    m_attr_native = false;
+}
+
+DomWidget::~DomWidget()
+{
+    m_class.clear();
+    for (int i = 0; i < m_property.size(); ++i)
+        delete m_property[i];
+    m_property.clear();
+    for (int i = 0; i < m_script.size(); ++i)
+        delete m_script[i];
+    m_script.clear();
+    for (int i = 0; i < m_widgetData.size(); ++i)
+        delete m_widgetData[i];
+    m_widgetData.clear();
+    for (int i = 0; i < m_attribute.size(); ++i)
+        delete m_attribute[i];
+    m_attribute.clear();
+    for (int i = 0; i < m_row.size(); ++i)
+        delete m_row[i];
+    m_row.clear();
+    for (int i = 0; i < m_column.size(); ++i)
+        delete m_column[i];
+    m_column.clear();
+    for (int i = 0; i < m_item.size(); ++i)
+        delete m_item[i];
+    m_item.clear();
+    for (int i = 0; i < m_layout.size(); ++i)
+        delete m_layout[i];
+    m_layout.clear();
+    for (int i = 0; i < m_widget.size(); ++i)
+        delete m_widget[i];
+    m_widget.clear();
+    for (int i = 0; i < m_action.size(); ++i)
+        delete m_action[i];
+    m_action.clear();
+    for (int i = 0; i < m_actionGroup.size(); ++i)
+        delete m_actionGroup[i];
+    m_actionGroup.clear();
+    for (int i = 0; i < m_addAction.size(); ++i)
+        delete m_addAction[i];
+    m_addAction.clear();
+    m_zOrder.clear();
+}
+
+void DomWidget::read(const QDomElement &node)
+{
+    if (node.hasAttribute(QLatin1String("class")))
+        setAttributeClass(node.attribute(QLatin1String("class")));
+    if (node.hasAttribute(QLatin1String("name")))
+        setAttributeName(node.attribute(QLatin1String("name")));
+    if (node.hasAttribute(QLatin1String("native")))
+        setAttributeNative((node.attribute(QLatin1String("native")) == QLatin1String("true") ? true : false));
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+        if (tag == QLatin1String("class")) {
+            m_class.append(e.text());
+            continue;
+        }
+        if (tag == QLatin1String("property")) {
+            DomProperty *v = new DomProperty();
+            v->read(e);
+            m_property.append(v);
+            continue;
+        }
+        if (tag == QLatin1String("script")) {
+            DomScript *v = new DomScript();
+            v->read(e);
+            m_script.append(v);
+            continue;
+        }
+        if (tag == QLatin1String("widgetdata")) {
+            DomWidgetData *v = new DomWidgetData();
+            v->read(e);
+            m_widgetData.append(v);
+            continue;
+        }
+        if (tag == QLatin1String("attribute")) {
+            DomProperty *v = new DomProperty();
+            v->read(e);
+            m_attribute.append(v);
+            continue;
+        }
+        if (tag == QLatin1String("row")) {
+            DomRow *v = new DomRow();
+            v->read(e);
+            m_row.append(v);
+            continue;
+        }
+        if (tag == QLatin1String("column")) {
+            DomColumn *v = new DomColumn();
+            v->read(e);
+            m_column.append(v);
+            continue;
+        }
+        if (tag == QLatin1String("item")) {
+            DomItem *v = new DomItem();
+            v->read(e);
+            m_item.append(v);
+            continue;
+        }
+        if (tag == QLatin1String("layout")) {
+            DomLayout *v = new DomLayout();
+            v->read(e);
+            m_layout.append(v);
+            continue;
+        }
+        if (tag == QLatin1String("widget")) {
+            DomWidget *v = new DomWidget();
+            v->read(e);
+            m_widget.append(v);
+            continue;
+        }
+        if (tag == QLatin1String("action")) {
+            DomAction *v = new DomAction();
+            v->read(e);
+            m_action.append(v);
+            continue;
+        }
+        if (tag == QLatin1String("actiongroup")) {
+            DomActionGroup *v = new DomActionGroup();
+            v->read(e);
+            m_actionGroup.append(v);
+            continue;
+        }
+        if (tag == QLatin1String("addaction")) {
+            DomActionRef *v = new DomActionRef();
+            v->read(e);
+            m_addAction.append(v);
+            continue;
+        }
+        if (tag == QLatin1String("zorder")) {
+            m_zOrder.append(e.text());
+            continue;
+        }
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomWidget::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("widget") : tagName.toLower());
+
+    QDomElement child;
+
+    if (hasAttributeClass())
+        e.setAttribute(QLatin1String("class"), attributeClass());
+
+    if (hasAttributeName())
+        e.setAttribute(QLatin1String("name"), attributeName());
+
+    if (hasAttributeNative())
+        e.setAttribute(QLatin1String("native"), attributeNative());
+
+    for (int i = 0; i < m_class.size(); ++i) {
+        QString v = m_class[i];
+        QDomNode child = doc.createElement(QLatin1String("class"));
+        child.appendChild(doc.createTextNode(v));
+        e.appendChild(child);
+    }
+    for (int i = 0; i < m_property.size(); ++i) {
+        DomProperty* v = m_property[i];
+        QDomNode child = v->write(doc, QLatin1String("property"));
+        e.appendChild(child);
+    }
+    for (int i = 0; i < m_script.size(); ++i) {
+        DomScript* v = m_script[i];
+        QDomNode child = v->write(doc, QLatin1String("script"));
+        e.appendChild(child);
+    }
+    for (int i = 0; i < m_widgetData.size(); ++i) {
+        DomWidgetData* v = m_widgetData[i];
+        QDomNode child = v->write(doc, QLatin1String("widgetdata"));
+        e.appendChild(child);
+    }
+    for (int i = 0; i < m_attribute.size(); ++i) {
+        DomProperty* v = m_attribute[i];
+        QDomNode child = v->write(doc, QLatin1String("attribute"));
+        e.appendChild(child);
+    }
+    for (int i = 0; i < m_row.size(); ++i) {
+        DomRow* v = m_row[i];
+        QDomNode child = v->write(doc, QLatin1String("row"));
+        e.appendChild(child);
+    }
+    for (int i = 0; i < m_column.size(); ++i) {
+        DomColumn* v = m_column[i];
+        QDomNode child = v->write(doc, QLatin1String("column"));
+        e.appendChild(child);
+    }
+    for (int i = 0; i < m_item.size(); ++i) {
+        DomItem* v = m_item[i];
+        QDomNode child = v->write(doc, QLatin1String("item"));
+        e.appendChild(child);
+    }
+    for (int i = 0; i < m_layout.size(); ++i) {
+        DomLayout* v = m_layout[i];
+        QDomNode child = v->write(doc, QLatin1String("layout"));
+        e.appendChild(child);
+    }
+    for (int i = 0; i < m_widget.size(); ++i) {
+        DomWidget* v = m_widget[i];
+        QDomNode child = v->write(doc, QLatin1String("widget"));
+        e.appendChild(child);
+    }
+    for (int i = 0; i < m_action.size(); ++i) {
+        DomAction* v = m_action[i];
+        QDomNode child = v->write(doc, QLatin1String("action"));
+        e.appendChild(child);
+    }
+    for (int i = 0; i < m_actionGroup.size(); ++i) {
+        DomActionGroup* v = m_actionGroup[i];
+        QDomNode child = v->write(doc, QLatin1String("actiongroup"));
+        e.appendChild(child);
+    }
+    for (int i = 0; i < m_addAction.size(); ++i) {
+        DomActionRef* v = m_addAction[i];
+        QDomNode child = v->write(doc, QLatin1String("addaction"));
+        e.appendChild(child);
+    }
+    for (int i = 0; i < m_zOrder.size(); ++i) {
+        QString v = m_zOrder[i];
+        QDomNode child = doc.createElement(QLatin1String("zorder"));
+        child.appendChild(doc.createTextNode(v));
+        e.appendChild(child);
+    }
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomWidget::setElementClass(const QStringList& a)
+{
+    m_class = a;
+}
+
+void DomWidget::setElementProperty(const QList<DomProperty*>& a)
+{
+    m_property = a;
+}
+
+void DomWidget::setElementScript(const QList<DomScript*>& a)
+{
+    m_script = a;
+}
+
+void DomWidget::setElementWidgetData(const QList<DomWidgetData*>& a)
+{
+    m_widgetData = a;
+}
+
+void DomWidget::setElementAttribute(const QList<DomProperty*>& a)
+{
+    m_attribute = a;
+}
+
+void DomWidget::setElementRow(const QList<DomRow*>& a)
+{
+    m_row = a;
+}
+
+void DomWidget::setElementColumn(const QList<DomColumn*>& a)
+{
+    m_column = a;
+}
+
+void DomWidget::setElementItem(const QList<DomItem*>& a)
+{
+    m_item = a;
+}
+
+void DomWidget::setElementLayout(const QList<DomLayout*>& a)
+{
+    m_layout = a;
+}
+
+void DomWidget::setElementWidget(const QList<DomWidget*>& a)
+{
+    m_widget = a;
+}
+
+void DomWidget::setElementAction(const QList<DomAction*>& a)
+{
+    m_action = a;
+}
+
+void DomWidget::setElementActionGroup(const QList<DomActionGroup*>& a)
+{
+    m_actionGroup = a;
+}
+
+void DomWidget::setElementAddAction(const QList<DomActionRef*>& a)
+{
+    m_addAction = a;
+}
+
+void DomWidget::setElementZOrder(const QStringList& a)
+{
+    m_zOrder = a;
+}
+
+void DomSpacer::clear(bool clear_all)
+{
+    for (int i = 0; i < m_property.size(); ++i)
+        delete m_property[i];
+    m_property.clear();
+
+    if (clear_all) {
+    m_text = QString();
+    m_has_attr_name = false;
+    }
+
+}
+
+DomSpacer::DomSpacer()
+{
+    m_has_attr_name = false;
+}
+
+DomSpacer::~DomSpacer()
+{
+    for (int i = 0; i < m_property.size(); ++i)
+        delete m_property[i];
+    m_property.clear();
+}
+
+void DomSpacer::read(const QDomElement &node)
+{
+    if (node.hasAttribute(QLatin1String("name")))
+        setAttributeName(node.attribute(QLatin1String("name")));
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+        if (tag == QLatin1String("property")) {
+            DomProperty *v = new DomProperty();
+            v->read(e);
+            m_property.append(v);
+            continue;
+        }
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomSpacer::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("spacer") : tagName.toLower());
+
+    QDomElement child;
+
+    if (hasAttributeName())
+        e.setAttribute(QLatin1String("name"), attributeName());
+
+    for (int i = 0; i < m_property.size(); ++i) {
+        DomProperty* v = m_property[i];
+        QDomNode child = v->write(doc, QLatin1String("property"));
+        e.appendChild(child);
+    }
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomSpacer::setElementProperty(const QList<DomProperty*>& a)
+{
+    m_property = a;
+}
+
+void DomColor::clear(bool clear_all)
+{
+
+    if (clear_all) {
+    m_text = QString();
+    m_has_attr_alpha = false;
+    m_attr_alpha = 0;
+    }
+
+    m_children = 0;
+    m_red = 0;
+    m_green = 0;
+    m_blue = 0;
+}
+
+DomColor::DomColor()
+{
+    m_children = 0;
+    m_has_attr_alpha = false;
+    m_attr_alpha = 0;
+    m_red = 0;
+    m_green = 0;
+    m_blue = 0;
+}
+
+DomColor::~DomColor()
+{
+}
+
+void DomColor::read(const QDomElement &node)
+{
+    if (node.hasAttribute(QLatin1String("alpha")))
+        setAttributeAlpha(node.attribute(QLatin1String("alpha")).toInt());
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+        if (tag == QLatin1String("red")) {
+            setElementRed(e.text().toInt());
+            continue;
+        }
+        if (tag == QLatin1String("green")) {
+            setElementGreen(e.text().toInt());
+            continue;
+        }
+        if (tag == QLatin1String("blue")) {
+            setElementBlue(e.text().toInt());
+            continue;
+        }
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomColor::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("color") : tagName.toLower());
+
+    QDomElement child;
+
+    if (hasAttributeAlpha())
+        e.setAttribute(QLatin1String("alpha"), attributeAlpha());
+
+    if (m_children & Red) {
+        child = doc.createElement(QLatin1String("red"));
+        child.appendChild(doc.createTextNode(QString::number(m_red)));
+        e.appendChild(child);
+    }
+
+    if (m_children & Green) {
+        child = doc.createElement(QLatin1String("green"));
+        child.appendChild(doc.createTextNode(QString::number(m_green)));
+        e.appendChild(child);
+    }
+
+    if (m_children & Blue) {
+        child = doc.createElement(QLatin1String("blue"));
+        child.appendChild(doc.createTextNode(QString::number(m_blue)));
+        e.appendChild(child);
+    }
+
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomColor::setElementRed(int a)
+{
+    m_children |= Red;
+    m_red = a;
+}
+
+void DomColor::setElementGreen(int a)
+{
+    m_children |= Green;
+    m_green = a;
+}
+
+void DomColor::setElementBlue(int a)
+{
+    m_children |= Blue;
+    m_blue = a;
+}
+
+void DomColor::clearElementRed()
+{
+    m_children &= ~Red;
+}
+
+void DomColor::clearElementGreen()
+{
+    m_children &= ~Green;
+}
+
+void DomColor::clearElementBlue()
+{
+    m_children &= ~Blue;
+}
+
+void DomGradientStop::clear(bool clear_all)
+{
+    delete m_color;
+
+    if (clear_all) {
+    m_text = QString();
+    m_has_attr_position = false;
+    m_attr_position = 0.0;
+    }
+
+    m_children = 0;
+    m_color = 0;
+}
+
+DomGradientStop::DomGradientStop()
+{
+    m_children = 0;
+    m_has_attr_position = false;
+    m_attr_position = 0.0;
+    m_color = 0;
+}
+
+DomGradientStop::~DomGradientStop()
+{
+    delete m_color;
+}
+
+void DomGradientStop::read(const QDomElement &node)
+{
+    if (node.hasAttribute(QLatin1String("position")))
+        setAttributePosition(node.attribute(QLatin1String("position")).toDouble());
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+        if (tag == QLatin1String("color")) {
+            DomColor *v = new DomColor();
+            v->read(e);
+            setElementColor(v);
+            continue;
+        }
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomGradientStop::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("gradientstop") : tagName.toLower());
+
+    QDomElement child;
+
+    if (hasAttributePosition())
+        e.setAttribute(QLatin1String("position"), attributePosition());
+
+    if (m_children & Color) {
+        e.appendChild(m_color->write(doc, QLatin1String("color")));
+    }
+
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomGradientStop::setElementColor(DomColor* a)
+{
+    delete m_color;
+    m_children |= Color;
+    m_color = a;
+}
+
+void DomGradientStop::clearElementColor()
+{
+    delete m_color;
+    m_color = 0;
+    m_children &= ~Color;
+}
+
+void DomGradient::clear(bool clear_all)
+{
+    for (int i = 0; i < m_gradientStop.size(); ++i)
+        delete m_gradientStop[i];
+    m_gradientStop.clear();
+
+    if (clear_all) {
+    m_text = QString();
+    m_has_attr_startX = false;
+    m_attr_startX = 0.0;
+    m_has_attr_startY = false;
+    m_attr_startY = 0.0;
+    m_has_attr_endX = false;
+    m_attr_endX = 0.0;
+    m_has_attr_endY = false;
+    m_attr_endY = 0.0;
+    m_has_attr_centralX = false;
+    m_attr_centralX = 0.0;
+    m_has_attr_centralY = false;
+    m_attr_centralY = 0.0;
+    m_has_attr_focalX = false;
+    m_attr_focalX = 0.0;
+    m_has_attr_focalY = false;
+    m_attr_focalY = 0.0;
+    m_has_attr_radius = false;
+    m_attr_radius = 0.0;
+    m_has_attr_angle = false;
+    m_attr_angle = 0.0;
+    m_has_attr_type = false;
+    m_has_attr_spread = false;
+    m_has_attr_coordinateMode = false;
+    }
+
+}
+
+DomGradient::DomGradient()
+{
+    m_has_attr_startX = false;
+    m_attr_startX = 0.0;
+    m_has_attr_startY = false;
+    m_attr_startY = 0.0;
+    m_has_attr_endX = false;
+    m_attr_endX = 0.0;
+    m_has_attr_endY = false;
+    m_attr_endY = 0.0;
+    m_has_attr_centralX = false;
+    m_attr_centralX = 0.0;
+    m_has_attr_centralY = false;
+    m_attr_centralY = 0.0;
+    m_has_attr_focalX = false;
+    m_attr_focalX = 0.0;
+    m_has_attr_focalY = false;
+    m_attr_focalY = 0.0;
+    m_has_attr_radius = false;
+    m_attr_radius = 0.0;
+    m_has_attr_angle = false;
+    m_attr_angle = 0.0;
+    m_has_attr_type = false;
+    m_has_attr_spread = false;
+    m_has_attr_coordinateMode = false;
+}
+
+DomGradient::~DomGradient()
+{
+    for (int i = 0; i < m_gradientStop.size(); ++i)
+        delete m_gradientStop[i];
+    m_gradientStop.clear();
+}
+
+void DomGradient::read(const QDomElement &node)
+{
+    if (node.hasAttribute(QLatin1String("startx")))
+        setAttributeStartX(node.attribute(QLatin1String("startx")).toDouble());
+    if (node.hasAttribute(QLatin1String("starty")))
+        setAttributeStartY(node.attribute(QLatin1String("starty")).toDouble());
+    if (node.hasAttribute(QLatin1String("endx")))
+        setAttributeEndX(node.attribute(QLatin1String("endx")).toDouble());
+    if (node.hasAttribute(QLatin1String("endy")))
+        setAttributeEndY(node.attribute(QLatin1String("endy")).toDouble());
+    if (node.hasAttribute(QLatin1String("centralx")))
+        setAttributeCentralX(node.attribute(QLatin1String("centralx")).toDouble());
+    if (node.hasAttribute(QLatin1String("centraly")))
+        setAttributeCentralY(node.attribute(QLatin1String("centraly")).toDouble());
+    if (node.hasAttribute(QLatin1String("focalx")))
+        setAttributeFocalX(node.attribute(QLatin1String("focalx")).toDouble());
+    if (node.hasAttribute(QLatin1String("focaly")))
+        setAttributeFocalY(node.attribute(QLatin1String("focaly")).toDouble());
+    if (node.hasAttribute(QLatin1String("radius")))
+        setAttributeRadius(node.attribute(QLatin1String("radius")).toDouble());
+    if (node.hasAttribute(QLatin1String("angle")))
+        setAttributeAngle(node.attribute(QLatin1String("angle")).toDouble());
+    if (node.hasAttribute(QLatin1String("type")))
+        setAttributeType(node.attribute(QLatin1String("type")));
+    if (node.hasAttribute(QLatin1String("spread")))
+        setAttributeSpread(node.attribute(QLatin1String("spread")));
+    if (node.hasAttribute(QLatin1String("coordinatemode")))
+        setAttributeCoordinateMode(node.attribute(QLatin1String("coordinatemode")));
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+        if (tag == QLatin1String("gradientstop")) {
+            DomGradientStop *v = new DomGradientStop();
+            v->read(e);
+            m_gradientStop.append(v);
+            continue;
+        }
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomGradient::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("gradient") : tagName.toLower());
+
+    QDomElement child;
+
+    if (hasAttributeStartX())
+        e.setAttribute(QLatin1String("startx"), attributeStartX());
+
+    if (hasAttributeStartY())
+        e.setAttribute(QLatin1String("starty"), attributeStartY());
+
+    if (hasAttributeEndX())
+        e.setAttribute(QLatin1String("endx"), attributeEndX());
+
+    if (hasAttributeEndY())
+        e.setAttribute(QLatin1String("endy"), attributeEndY());
+
+    if (hasAttributeCentralX())
+        e.setAttribute(QLatin1String("centralx"), attributeCentralX());
+
+    if (hasAttributeCentralY())
+        e.setAttribute(QLatin1String("centraly"), attributeCentralY());
+
+    if (hasAttributeFocalX())
+        e.setAttribute(QLatin1String("focalx"), attributeFocalX());
+
+    if (hasAttributeFocalY())
+        e.setAttribute(QLatin1String("focaly"), attributeFocalY());
+
+    if (hasAttributeRadius())
+        e.setAttribute(QLatin1String("radius"), attributeRadius());
+
+    if (hasAttributeAngle())
+        e.setAttribute(QLatin1String("angle"), attributeAngle());
+
+    if (hasAttributeType())
+        e.setAttribute(QLatin1String("type"), attributeType());
+
+    if (hasAttributeSpread())
+        e.setAttribute(QLatin1String("spread"), attributeSpread());
+
+    if (hasAttributeCoordinateMode())
+        e.setAttribute(QLatin1String("coordinatemode"), attributeCoordinateMode());
+
+    for (int i = 0; i < m_gradientStop.size(); ++i) {
+        DomGradientStop* v = m_gradientStop[i];
+        QDomNode child = v->write(doc, QLatin1String("gradientstop"));
+        e.appendChild(child);
+    }
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomGradient::setElementGradientStop(const QList<DomGradientStop*>& a)
+{
+    m_gradientStop = a;
+}
+
+void DomBrush::clear(bool clear_all)
+{
+    delete m_color;
+    delete m_texture;
+    delete m_gradient;
+
+    if (clear_all) {
+    m_text = QString();
+    m_has_attr_brushStyle = false;
+    }
+
+    m_kind = Unknown;
+
+    m_color = 0;
+    m_texture = 0;
+    m_gradient = 0;
+}
+
+DomBrush::DomBrush()
+{
+    m_kind = Unknown;
+
+    m_has_attr_brushStyle = false;
+    m_color = 0;
+    m_texture = 0;
+    m_gradient = 0;
+}
+
+DomBrush::~DomBrush()
+{
+    delete m_color;
+    delete m_texture;
+    delete m_gradient;
+}
+
+void DomBrush::read(const QDomElement &node)
+{
+    if (node.hasAttribute(QLatin1String("brushstyle")))
+        setAttributeBrushStyle(node.attribute(QLatin1String("brushstyle")));
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+        if (tag == QLatin1String("color")) {
+            DomColor *v = new DomColor();
+            v->read(e);
+            setElementColor(v);
+            continue;
+        }
+        if (tag == QLatin1String("texture")) {
+            DomProperty *v = new DomProperty();
+            v->read(e);
+            setElementTexture(v);
+            continue;
+        }
+        if (tag == QLatin1String("gradient")) {
+            DomGradient *v = new DomGradient();
+            v->read(e);
+            setElementGradient(v);
+            continue;
+        }
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomBrush::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("brush") : tagName.toLower());
+
+    QDomElement child;
+
+    if (hasAttributeBrushStyle())
+        e.setAttribute(QLatin1String("brushstyle"), attributeBrushStyle());
+
+    switch(kind()) {
+        case Color: {
+            DomColor* v = elementColor();
+            if (v != 0) {
+                QDomElement child = v->write(doc, QLatin1String("color"));
+                e.appendChild(child);
+            }
+            break;
+        }
+        case Texture: {
+            DomProperty* v = elementTexture();
+            if (v != 0) {
+                QDomElement child = v->write(doc, QLatin1String("texture"));
+                e.appendChild(child);
+            }
+            break;
+        }
+        case Gradient: {
+            DomGradient* v = elementGradient();
+            if (v != 0) {
+                QDomElement child = v->write(doc, QLatin1String("gradient"));
+                e.appendChild(child);
+            }
+            break;
+        }
+        default:
+            break;
+    }
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomBrush::setElementColor(DomColor* a)
+{
+    clear(false);
+    m_kind = Color;
+    m_color = a;
+}
+
+void DomBrush::setElementTexture(DomProperty* a)
+{
+    clear(false);
+    m_kind = Texture;
+    m_texture = a;
+}
+
+void DomBrush::setElementGradient(DomGradient* a)
+{
+    clear(false);
+    m_kind = Gradient;
+    m_gradient = a;
+}
+
+void DomColorRole::clear(bool clear_all)
+{
+    delete m_brush;
+
+    if (clear_all) {
+    m_text = QString();
+    m_has_attr_role = false;
+    }
+
+    m_children = 0;
+    m_brush = 0;
+}
+
+DomColorRole::DomColorRole()
+{
+    m_children = 0;
+    m_has_attr_role = false;
+    m_brush = 0;
+}
+
+DomColorRole::~DomColorRole()
+{
+    delete m_brush;
+}
+
+void DomColorRole::read(const QDomElement &node)
+{
+    if (node.hasAttribute(QLatin1String("role")))
+        setAttributeRole(node.attribute(QLatin1String("role")));
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+        if (tag == QLatin1String("brush")) {
+            DomBrush *v = new DomBrush();
+            v->read(e);
+            setElementBrush(v);
+            continue;
+        }
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomColorRole::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("colorrole") : tagName.toLower());
+
+    QDomElement child;
+
+    if (hasAttributeRole())
+        e.setAttribute(QLatin1String("role"), attributeRole());
+
+    if (m_children & Brush) {
+        e.appendChild(m_brush->write(doc, QLatin1String("brush")));
+    }
+
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomColorRole::setElementBrush(DomBrush* a)
+{
+    delete m_brush;
+    m_children |= Brush;
+    m_brush = a;
+}
+
+void DomColorRole::clearElementBrush()
+{
+    delete m_brush;
+    m_brush = 0;
+    m_children &= ~Brush;
+}
+
+void DomColorGroup::clear(bool clear_all)
+{
+    for (int i = 0; i < m_colorRole.size(); ++i)
+        delete m_colorRole[i];
+    m_colorRole.clear();
+    for (int i = 0; i < m_color.size(); ++i)
+        delete m_color[i];
+    m_color.clear();
+
+    if (clear_all) {
+    m_text = QString();
+    }
+
+}
+
+DomColorGroup::DomColorGroup()
+{
+}
+
+DomColorGroup::~DomColorGroup()
+{
+    for (int i = 0; i < m_colorRole.size(); ++i)
+        delete m_colorRole[i];
+    m_colorRole.clear();
+    for (int i = 0; i < m_color.size(); ++i)
+        delete m_color[i];
+    m_color.clear();
+}
+
+void DomColorGroup::read(const QDomElement &node)
+{
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+        if (tag == QLatin1String("colorrole")) {
+            DomColorRole *v = new DomColorRole();
+            v->read(e);
+            m_colorRole.append(v);
+            continue;
+        }
+        if (tag == QLatin1String("color")) {
+            DomColor *v = new DomColor();
+            v->read(e);
+            m_color.append(v);
+            continue;
+        }
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomColorGroup::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("colorgroup") : tagName.toLower());
+
+    QDomElement child;
+
+    for (int i = 0; i < m_colorRole.size(); ++i) {
+        DomColorRole* v = m_colorRole[i];
+        QDomNode child = v->write(doc, QLatin1String("colorrole"));
+        e.appendChild(child);
+    }
+    for (int i = 0; i < m_color.size(); ++i) {
+        DomColor* v = m_color[i];
+        QDomNode child = v->write(doc, QLatin1String("color"));
+        e.appendChild(child);
+    }
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomColorGroup::setElementColorRole(const QList<DomColorRole*>& a)
+{
+    m_colorRole = a;
+}
+
+void DomColorGroup::setElementColor(const QList<DomColor*>& a)
+{
+    m_color = a;
+}
+
+void DomPalette::clear(bool clear_all)
+{
+    delete m_active;
+    delete m_inactive;
+    delete m_disabled;
+
+    if (clear_all) {
+    m_text = QString();
+    }
+
+    m_children = 0;
+    m_active = 0;
+    m_inactive = 0;
+    m_disabled = 0;
+}
+
+DomPalette::DomPalette()
+{
+    m_children = 0;
+    m_active = 0;
+    m_inactive = 0;
+    m_disabled = 0;
+}
+
+DomPalette::~DomPalette()
+{
+    delete m_active;
+    delete m_inactive;
+    delete m_disabled;
+}
+
+void DomPalette::read(const QDomElement &node)
+{
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+        if (tag == QLatin1String("active")) {
+            DomColorGroup *v = new DomColorGroup();
+            v->read(e);
+            setElementActive(v);
+            continue;
+        }
+        if (tag == QLatin1String("inactive")) {
+            DomColorGroup *v = new DomColorGroup();
+            v->read(e);
+            setElementInactive(v);
+            continue;
+        }
+        if (tag == QLatin1String("disabled")) {
+            DomColorGroup *v = new DomColorGroup();
+            v->read(e);
+            setElementDisabled(v);
+            continue;
+        }
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomPalette::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("palette") : tagName.toLower());
+
+    QDomElement child;
+
+    if (m_children & Active) {
+        e.appendChild(m_active->write(doc, QLatin1String("active")));
+    }
+
+    if (m_children & Inactive) {
+        e.appendChild(m_inactive->write(doc, QLatin1String("inactive")));
+    }
+
+    if (m_children & Disabled) {
+        e.appendChild(m_disabled->write(doc, QLatin1String("disabled")));
+    }
+
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomPalette::setElementActive(DomColorGroup* a)
+{
+    delete m_active;
+    m_children |= Active;
+    m_active = a;
+}
+
+void DomPalette::setElementInactive(DomColorGroup* a)
+{
+    delete m_inactive;
+    m_children |= Inactive;
+    m_inactive = a;
+}
+
+void DomPalette::setElementDisabled(DomColorGroup* a)
+{
+    delete m_disabled;
+    m_children |= Disabled;
+    m_disabled = a;
+}
+
+void DomPalette::clearElementActive()
+{
+    delete m_active;
+    m_active = 0;
+    m_children &= ~Active;
+}
+
+void DomPalette::clearElementInactive()
+{
+    delete m_inactive;
+    m_inactive = 0;
+    m_children &= ~Inactive;
+}
+
+void DomPalette::clearElementDisabled()
+{
+    delete m_disabled;
+    m_disabled = 0;
+    m_children &= ~Disabled;
+}
+
+void DomFont::clear(bool clear_all)
+{
+
+    if (clear_all) {
+    m_text = QString();
+    }
+
+    m_children = 0;
+    m_pointSize = 0;
+    m_weight = 0;
+    m_italic = false;
+    m_bold = false;
+    m_underline = false;
+    m_strikeOut = false;
+    m_antialiasing = false;
+    m_kerning = false;
+}
+
+DomFont::DomFont()
+{
+    m_children = 0;
+    m_pointSize = 0;
+    m_weight = 0;
+    m_italic = false;
+    m_bold = false;
+    m_underline = false;
+    m_strikeOut = false;
+    m_antialiasing = false;
+    m_kerning = false;
+}
+
+DomFont::~DomFont()
+{
+}
+
+void DomFont::read(const QDomElement &node)
+{
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+        if (tag == QLatin1String("family")) {
+            setElementFamily(e.text());
+            continue;
+        }
+        if (tag == QLatin1String("pointsize")) {
+            setElementPointSize(e.text().toInt());
+            continue;
+        }
+        if (tag == QLatin1String("weight")) {
+            setElementWeight(e.text().toInt());
+            continue;
+        }
+        if (tag == QLatin1String("italic")) {
+            setElementItalic((e.text() == QLatin1String("true") ? true : false));
+            continue;
+        }
+        if (tag == QLatin1String("bold")) {
+            setElementBold((e.text() == QLatin1String("true") ? true : false));
+            continue;
+        }
+        if (tag == QLatin1String("underline")) {
+            setElementUnderline((e.text() == QLatin1String("true") ? true : false));
+            continue;
+        }
+        if (tag == QLatin1String("strikeout")) {
+            setElementStrikeOut((e.text() == QLatin1String("true") ? true : false));
+            continue;
+        }
+        if (tag == QLatin1String("antialiasing")) {
+            setElementAntialiasing((e.text() == QLatin1String("true") ? true : false));
+            continue;
+        }
+        if (tag == QLatin1String("stylestrategy")) {
+            setElementStyleStrategy(e.text());
+            continue;
+        }
+        if (tag == QLatin1String("kerning")) {
+            setElementKerning((e.text() == QLatin1String("true") ? true : false));
+            continue;
+        }
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomFont::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("font") : tagName.toLower());
+
+    QDomElement child;
+
+    if (m_children & Family) {
+        child = doc.createElement(QLatin1String("family"));
+        child.appendChild(doc.createTextNode(m_family));
+        e.appendChild(child);
+    }
+
+    if (m_children & PointSize) {
+        child = doc.createElement(QLatin1String("pointsize"));
+        child.appendChild(doc.createTextNode(QString::number(m_pointSize)));
+        e.appendChild(child);
+    }
+
+    if (m_children & Weight) {
+        child = doc.createElement(QLatin1String("weight"));
+        child.appendChild(doc.createTextNode(QString::number(m_weight)));
+        e.appendChild(child);
+    }
+
+    if (m_children & Italic) {
+        child = doc.createElement(QLatin1String("italic"));
+        child.appendChild(doc.createTextNode((m_italic ? QLatin1String("true") : QLatin1String("false"))));
+        e.appendChild(child);
+    }
+
+    if (m_children & Bold) {
+        child = doc.createElement(QLatin1String("bold"));
+        child.appendChild(doc.createTextNode((m_bold ? QLatin1String("true") : QLatin1String("false"))));
+        e.appendChild(child);
+    }
+
+    if (m_children & Underline) {
+        child = doc.createElement(QLatin1String("underline"));
+        child.appendChild(doc.createTextNode((m_underline ? QLatin1String("true") : QLatin1String("false"))));
+        e.appendChild(child);
+    }
+
+    if (m_children & StrikeOut) {
+        child = doc.createElement(QLatin1String("strikeout"));
+        child.appendChild(doc.createTextNode((m_strikeOut ? QLatin1String("true") : QLatin1String("false"))));
+        e.appendChild(child);
+    }
+
+    if (m_children & Antialiasing) {
+        child = doc.createElement(QLatin1String("antialiasing"));
+        child.appendChild(doc.createTextNode((m_antialiasing ? QLatin1String("true") : QLatin1String("false"))));
+        e.appendChild(child);
+    }
+
+    if (m_children & StyleStrategy) {
+        child = doc.createElement(QLatin1String("stylestrategy"));
+        child.appendChild(doc.createTextNode(m_styleStrategy));
+        e.appendChild(child);
+    }
+
+    if (m_children & Kerning) {
+        child = doc.createElement(QLatin1String("kerning"));
+        child.appendChild(doc.createTextNode((m_kerning ? QLatin1String("true") : QLatin1String("false"))));
+        e.appendChild(child);
+    }
+
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomFont::setElementFamily(const QString& a)
+{
+    m_children |= Family;
+    m_family = a;
+}
+
+void DomFont::setElementPointSize(int a)
+{
+    m_children |= PointSize;
+    m_pointSize = a;
+}
+
+void DomFont::setElementWeight(int a)
+{
+    m_children |= Weight;
+    m_weight = a;
+}
+
+void DomFont::setElementItalic(bool a)
+{
+    m_children |= Italic;
+    m_italic = a;
+}
+
+void DomFont::setElementBold(bool a)
+{
+    m_children |= Bold;
+    m_bold = a;
+}
+
+void DomFont::setElementUnderline(bool a)
+{
+    m_children |= Underline;
+    m_underline = a;
+}
+
+void DomFont::setElementStrikeOut(bool a)
+{
+    m_children |= StrikeOut;
+    m_strikeOut = a;
+}
+
+void DomFont::setElementAntialiasing(bool a)
+{
+    m_children |= Antialiasing;
+    m_antialiasing = a;
+}
+
+void DomFont::setElementStyleStrategy(const QString& a)
+{
+    m_children |= StyleStrategy;
+    m_styleStrategy = a;
+}
+
+void DomFont::setElementKerning(bool a)
+{
+    m_children |= Kerning;
+    m_kerning = a;
+}
+
+void DomFont::clearElementFamily()
+{
+    m_children &= ~Family;
+}
+
+void DomFont::clearElementPointSize()
+{
+    m_children &= ~PointSize;
+}
+
+void DomFont::clearElementWeight()
+{
+    m_children &= ~Weight;
+}
+
+void DomFont::clearElementItalic()
+{
+    m_children &= ~Italic;
+}
+
+void DomFont::clearElementBold()
+{
+    m_children &= ~Bold;
+}
+
+void DomFont::clearElementUnderline()
+{
+    m_children &= ~Underline;
+}
+
+void DomFont::clearElementStrikeOut()
+{
+    m_children &= ~StrikeOut;
+}
+
+void DomFont::clearElementAntialiasing()
+{
+    m_children &= ~Antialiasing;
+}
+
+void DomFont::clearElementStyleStrategy()
+{
+    m_children &= ~StyleStrategy;
+}
+
+void DomFont::clearElementKerning()
+{
+    m_children &= ~Kerning;
+}
+
+void DomPoint::clear(bool clear_all)
+{
+
+    if (clear_all) {
+    m_text = QString();
+    }
+
+    m_children = 0;
+    m_x = 0;
+    m_y = 0;
+}
+
+DomPoint::DomPoint()
+{
+    m_children = 0;
+    m_x = 0;
+    m_y = 0;
+}
+
+DomPoint::~DomPoint()
+{
+}
+
+void DomPoint::read(const QDomElement &node)
+{
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+        if (tag == QString(QLatin1Char('x'))) {
+            setElementX(e.text().toInt());
+            continue;
+        }
+        if (tag == QString(QLatin1Char('y'))) {
+            setElementY(e.text().toInt());
+            continue;
+        }
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomPoint::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("point") : tagName.toLower());
+
+    QDomElement child;
+
+    if (m_children & X) {
+        child = doc.createElement(QString(QLatin1Char('x')));
+        child.appendChild(doc.createTextNode(QString::number(m_x)));
+        e.appendChild(child);
+    }
+
+    if (m_children & Y) {
+        child = doc.createElement(QString(QLatin1Char('y')));
+        child.appendChild(doc.createTextNode(QString::number(m_y)));
+        e.appendChild(child);
+    }
+
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomPoint::setElementX(int a)
+{
+    m_children |= X;
+    m_x = a;
+}
+
+void DomPoint::setElementY(int a)
+{
+    m_children |= Y;
+    m_y = a;
+}
+
+void DomPoint::clearElementX()
+{
+    m_children &= ~X;
+}
+
+void DomPoint::clearElementY()
+{
+    m_children &= ~Y;
+}
+
+void DomRect::clear(bool clear_all)
+{
+
+    if (clear_all) {
+    m_text = QString();
+    }
+
+    m_children = 0;
+    m_x = 0;
+    m_y = 0;
+    m_width = 0;
+    m_height = 0;
+}
+
+DomRect::DomRect()
+{
+    m_children = 0;
+    m_x = 0;
+    m_y = 0;
+    m_width = 0;
+    m_height = 0;
+}
+
+DomRect::~DomRect()
+{
+}
+
+void DomRect::read(const QDomElement &node)
+{
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+        if (tag == QString(QLatin1Char('x'))) {
+            setElementX(e.text().toInt());
+            continue;
+        }
+        if (tag == QString(QLatin1Char('y'))) {
+            setElementY(e.text().toInt());
+            continue;
+        }
+        if (tag == QLatin1String("width")) {
+            setElementWidth(e.text().toInt());
+            continue;
+        }
+        if (tag == QLatin1String("height")) {
+            setElementHeight(e.text().toInt());
+            continue;
+        }
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomRect::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("rect") : tagName.toLower());
+
+    QDomElement child;
+
+    if (m_children & X) {
+        child = doc.createElement(QString(QLatin1Char('x')));
+        child.appendChild(doc.createTextNode(QString::number(m_x)));
+        e.appendChild(child);
+    }
+
+    if (m_children & Y) {
+        child = doc.createElement(QString(QLatin1Char('y')));
+        child.appendChild(doc.createTextNode(QString::number(m_y)));
+        e.appendChild(child);
+    }
+
+    if (m_children & Width) {
+        child = doc.createElement(QLatin1String("width"));
+        child.appendChild(doc.createTextNode(QString::number(m_width)));
+        e.appendChild(child);
+    }
+
+    if (m_children & Height) {
+        child = doc.createElement(QLatin1String("height"));
+        child.appendChild(doc.createTextNode(QString::number(m_height)));
+        e.appendChild(child);
+    }
+
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomRect::setElementX(int a)
+{
+    m_children |= X;
+    m_x = a;
+}
+
+void DomRect::setElementY(int a)
+{
+    m_children |= Y;
+    m_y = a;
+}
+
+void DomRect::setElementWidth(int a)
+{
+    m_children |= Width;
+    m_width = a;
+}
+
+void DomRect::setElementHeight(int a)
+{
+    m_children |= Height;
+    m_height = a;
+}
+
+void DomRect::clearElementX()
+{
+    m_children &= ~X;
+}
+
+void DomRect::clearElementY()
+{
+    m_children &= ~Y;
+}
+
+void DomRect::clearElementWidth()
+{
+    m_children &= ~Width;
+}
+
+void DomRect::clearElementHeight()
+{
+    m_children &= ~Height;
+}
+
+void DomLocale::clear(bool clear_all)
+{
+
+    if (clear_all) {
+    m_text = QString();
+    m_has_attr_language = false;
+    m_has_attr_country = false;
+    }
+
+}
+
+DomLocale::DomLocale()
+{
+    m_has_attr_language = false;
+    m_has_attr_country = false;
+}
+
+DomLocale::~DomLocale()
+{
+}
+
+void DomLocale::read(const QDomElement &node)
+{
+    if (node.hasAttribute(QLatin1String("language")))
+        setAttributeLanguage(node.attribute(QLatin1String("language")));
+    if (node.hasAttribute(QLatin1String("country")))
+        setAttributeCountry(node.attribute(QLatin1String("country")));
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomLocale::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("locale") : tagName.toLower());
+
+    QDomElement child;
+
+    if (hasAttributeLanguage())
+        e.setAttribute(QLatin1String("language"), attributeLanguage());
+
+    if (hasAttributeCountry())
+        e.setAttribute(QLatin1String("country"), attributeCountry());
+
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomSizePolicy::clear(bool clear_all)
+{
+
+    if (clear_all) {
+    m_text = QString();
+    m_has_attr_hSizeType = false;
+    m_has_attr_vSizeType = false;
+    }
+
+    m_children = 0;
+    m_hSizeType = 0;
+    m_vSizeType = 0;
+    m_horStretch = 0;
+    m_verStretch = 0;
+}
+
+DomSizePolicy::DomSizePolicy()
+{
+    m_children = 0;
+    m_has_attr_hSizeType = false;
+    m_has_attr_vSizeType = false;
+    m_hSizeType = 0;
+    m_vSizeType = 0;
+    m_horStretch = 0;
+    m_verStretch = 0;
+}
+
+DomSizePolicy::~DomSizePolicy()
+{
+}
+
+void DomSizePolicy::read(const QDomElement &node)
+{
+    if (node.hasAttribute(QLatin1String("hsizetype")))
+        setAttributeHSizeType(node.attribute(QLatin1String("hsizetype")));
+    if (node.hasAttribute(QLatin1String("vsizetype")))
+        setAttributeVSizeType(node.attribute(QLatin1String("vsizetype")));
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+        if (tag == QLatin1String("hsizetype")) {
+            setElementHSizeType(e.text().toInt());
+            continue;
+        }
+        if (tag == QLatin1String("vsizetype")) {
+            setElementVSizeType(e.text().toInt());
+            continue;
+        }
+        if (tag == QLatin1String("horstretch")) {
+            setElementHorStretch(e.text().toInt());
+            continue;
+        }
+        if (tag == QLatin1String("verstretch")) {
+            setElementVerStretch(e.text().toInt());
+            continue;
+        }
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomSizePolicy::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("sizepolicy") : tagName.toLower());
+
+    QDomElement child;
+
+    if (hasAttributeHSizeType())
+        e.setAttribute(QLatin1String("hsizetype"), attributeHSizeType());
+
+    if (hasAttributeVSizeType())
+        e.setAttribute(QLatin1String("vsizetype"), attributeVSizeType());
+
+    if (m_children & HSizeType) {
+        child = doc.createElement(QLatin1String("hsizetype"));
+        child.appendChild(doc.createTextNode(QString::number(m_hSizeType)));
+        e.appendChild(child);
+    }
+
+    if (m_children & VSizeType) {
+        child = doc.createElement(QLatin1String("vsizetype"));
+        child.appendChild(doc.createTextNode(QString::number(m_vSizeType)));
+        e.appendChild(child);
+    }
+
+    if (m_children & HorStretch) {
+        child = doc.createElement(QLatin1String("horstretch"));
+        child.appendChild(doc.createTextNode(QString::number(m_horStretch)));
+        e.appendChild(child);
+    }
+
+    if (m_children & VerStretch) {
+        child = doc.createElement(QLatin1String("verstretch"));
+        child.appendChild(doc.createTextNode(QString::number(m_verStretch)));
+        e.appendChild(child);
+    }
+
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomSizePolicy::setElementHSizeType(int a)
+{
+    m_children |= HSizeType;
+    m_hSizeType = a;
+}
+
+void DomSizePolicy::setElementVSizeType(int a)
+{
+    m_children |= VSizeType;
+    m_vSizeType = a;
+}
+
+void DomSizePolicy::setElementHorStretch(int a)
+{
+    m_children |= HorStretch;
+    m_horStretch = a;
+}
+
+void DomSizePolicy::setElementVerStretch(int a)
+{
+    m_children |= VerStretch;
+    m_verStretch = a;
+}
+
+void DomSizePolicy::clearElementHSizeType()
+{
+    m_children &= ~HSizeType;
+}
+
+void DomSizePolicy::clearElementVSizeType()
+{
+    m_children &= ~VSizeType;
+}
+
+void DomSizePolicy::clearElementHorStretch()
+{
+    m_children &= ~HorStretch;
+}
+
+void DomSizePolicy::clearElementVerStretch()
+{
+    m_children &= ~VerStretch;
+}
+
+void DomSize::clear(bool clear_all)
+{
+
+    if (clear_all) {
+    m_text = QString();
+    }
+
+    m_children = 0;
+    m_width = 0;
+    m_height = 0;
+}
+
+DomSize::DomSize()
+{
+    m_children = 0;
+    m_width = 0;
+    m_height = 0;
+}
+
+DomSize::~DomSize()
+{
+}
+
+void DomSize::read(const QDomElement &node)
+{
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+        if (tag == QLatin1String("width")) {
+            setElementWidth(e.text().toInt());
+            continue;
+        }
+        if (tag == QLatin1String("height")) {
+            setElementHeight(e.text().toInt());
+            continue;
+        }
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomSize::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("size") : tagName.toLower());
+
+    QDomElement child;
+
+    if (m_children & Width) {
+        child = doc.createElement(QLatin1String("width"));
+        child.appendChild(doc.createTextNode(QString::number(m_width)));
+        e.appendChild(child);
+    }
+
+    if (m_children & Height) {
+        child = doc.createElement(QLatin1String("height"));
+        child.appendChild(doc.createTextNode(QString::number(m_height)));
+        e.appendChild(child);
+    }
+
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomSize::setElementWidth(int a)
+{
+    m_children |= Width;
+    m_width = a;
+}
+
+void DomSize::setElementHeight(int a)
+{
+    m_children |= Height;
+    m_height = a;
+}
+
+void DomSize::clearElementWidth()
+{
+    m_children &= ~Width;
+}
+
+void DomSize::clearElementHeight()
+{
+    m_children &= ~Height;
+}
+
+void DomDate::clear(bool clear_all)
+{
+
+    if (clear_all) {
+    m_text = QString();
+    }
+
+    m_children = 0;
+    m_year = 0;
+    m_month = 0;
+    m_day = 0;
+}
+
+DomDate::DomDate()
+{
+    m_children = 0;
+    m_year = 0;
+    m_month = 0;
+    m_day = 0;
+}
+
+DomDate::~DomDate()
+{
+}
+
+void DomDate::read(const QDomElement &node)
+{
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+        if (tag == QLatin1String("year")) {
+            setElementYear(e.text().toInt());
+            continue;
+        }
+        if (tag == QLatin1String("month")) {
+            setElementMonth(e.text().toInt());
+            continue;
+        }
+        if (tag == QLatin1String("day")) {
+            setElementDay(e.text().toInt());
+            continue;
+        }
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomDate::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("date") : tagName.toLower());
+
+    QDomElement child;
+
+    if (m_children & Year) {
+        child = doc.createElement(QLatin1String("year"));
+        child.appendChild(doc.createTextNode(QString::number(m_year)));
+        e.appendChild(child);
+    }
+
+    if (m_children & Month) {
+        child = doc.createElement(QLatin1String("month"));
+        child.appendChild(doc.createTextNode(QString::number(m_month)));
+        e.appendChild(child);
+    }
+
+    if (m_children & Day) {
+        child = doc.createElement(QLatin1String("day"));
+        child.appendChild(doc.createTextNode(QString::number(m_day)));
+        e.appendChild(child);
+    }
+
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomDate::setElementYear(int a)
+{
+    m_children |= Year;
+    m_year = a;
+}
+
+void DomDate::setElementMonth(int a)
+{
+    m_children |= Month;
+    m_month = a;
+}
+
+void DomDate::setElementDay(int a)
+{
+    m_children |= Day;
+    m_day = a;
+}
+
+void DomDate::clearElementYear()
+{
+    m_children &= ~Year;
+}
+
+void DomDate::clearElementMonth()
+{
+    m_children &= ~Month;
+}
+
+void DomDate::clearElementDay()
+{
+    m_children &= ~Day;
+}
+
+void DomTime::clear(bool clear_all)
+{
+
+    if (clear_all) {
+    m_text = QString();
+    }
+
+    m_children = 0;
+    m_hour = 0;
+    m_minute = 0;
+    m_second = 0;
+}
+
+DomTime::DomTime()
+{
+    m_children = 0;
+    m_hour = 0;
+    m_minute = 0;
+    m_second = 0;
+}
+
+DomTime::~DomTime()
+{
+}
+
+void DomTime::read(const QDomElement &node)
+{
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+        if (tag == QLatin1String("hour")) {
+            setElementHour(e.text().toInt());
+            continue;
+        }
+        if (tag == QLatin1String("minute")) {
+            setElementMinute(e.text().toInt());
+            continue;
+        }
+        if (tag == QLatin1String("second")) {
+            setElementSecond(e.text().toInt());
+            continue;
+        }
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomTime::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("time") : tagName.toLower());
+
+    QDomElement child;
+
+    if (m_children & Hour) {
+        child = doc.createElement(QLatin1String("hour"));
+        child.appendChild(doc.createTextNode(QString::number(m_hour)));
+        e.appendChild(child);
+    }
+
+    if (m_children & Minute) {
+        child = doc.createElement(QLatin1String("minute"));
+        child.appendChild(doc.createTextNode(QString::number(m_minute)));
+        e.appendChild(child);
+    }
+
+    if (m_children & Second) {
+        child = doc.createElement(QLatin1String("second"));
+        child.appendChild(doc.createTextNode(QString::number(m_second)));
+        e.appendChild(child);
+    }
+
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomTime::setElementHour(int a)
+{
+    m_children |= Hour;
+    m_hour = a;
+}
+
+void DomTime::setElementMinute(int a)
+{
+    m_children |= Minute;
+    m_minute = a;
+}
+
+void DomTime::setElementSecond(int a)
+{
+    m_children |= Second;
+    m_second = a;
+}
+
+void DomTime::clearElementHour()
+{
+    m_children &= ~Hour;
+}
+
+void DomTime::clearElementMinute()
+{
+    m_children &= ~Minute;
+}
+
+void DomTime::clearElementSecond()
+{
+    m_children &= ~Second;
+}
+
+void DomDateTime::clear(bool clear_all)
+{
+
+    if (clear_all) {
+    m_text = QString();
+    }
+
+    m_children = 0;
+    m_hour = 0;
+    m_minute = 0;
+    m_second = 0;
+    m_year = 0;
+    m_month = 0;
+    m_day = 0;
+}
+
+DomDateTime::DomDateTime()
+{
+    m_children = 0;
+    m_hour = 0;
+    m_minute = 0;
+    m_second = 0;
+    m_year = 0;
+    m_month = 0;
+    m_day = 0;
+}
+
+DomDateTime::~DomDateTime()
+{
+}
+
+void DomDateTime::read(const QDomElement &node)
+{
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+        if (tag == QLatin1String("hour")) {
+            setElementHour(e.text().toInt());
+            continue;
+        }
+        if (tag == QLatin1String("minute")) {
+            setElementMinute(e.text().toInt());
+            continue;
+        }
+        if (tag == QLatin1String("second")) {
+            setElementSecond(e.text().toInt());
+            continue;
+        }
+        if (tag == QLatin1String("year")) {
+            setElementYear(e.text().toInt());
+            continue;
+        }
+        if (tag == QLatin1String("month")) {
+            setElementMonth(e.text().toInt());
+            continue;
+        }
+        if (tag == QLatin1String("day")) {
+            setElementDay(e.text().toInt());
+            continue;
+        }
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomDateTime::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("datetime") : tagName.toLower());
+
+    QDomElement child;
+
+    if (m_children & Hour) {
+        child = doc.createElement(QLatin1String("hour"));
+        child.appendChild(doc.createTextNode(QString::number(m_hour)));
+        e.appendChild(child);
+    }
+
+    if (m_children & Minute) {
+        child = doc.createElement(QLatin1String("minute"));
+        child.appendChild(doc.createTextNode(QString::number(m_minute)));
+        e.appendChild(child);
+    }
+
+    if (m_children & Second) {
+        child = doc.createElement(QLatin1String("second"));
+        child.appendChild(doc.createTextNode(QString::number(m_second)));
+        e.appendChild(child);
+    }
+
+    if (m_children & Year) {
+        child = doc.createElement(QLatin1String("year"));
+        child.appendChild(doc.createTextNode(QString::number(m_year)));
+        e.appendChild(child);
+    }
+
+    if (m_children & Month) {
+        child = doc.createElement(QLatin1String("month"));
+        child.appendChild(doc.createTextNode(QString::number(m_month)));
+        e.appendChild(child);
+    }
+
+    if (m_children & Day) {
+        child = doc.createElement(QLatin1String("day"));
+        child.appendChild(doc.createTextNode(QString::number(m_day)));
+        e.appendChild(child);
+    }
+
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomDateTime::setElementHour(int a)
+{
+    m_children |= Hour;
+    m_hour = a;
+}
+
+void DomDateTime::setElementMinute(int a)
+{
+    m_children |= Minute;
+    m_minute = a;
+}
+
+void DomDateTime::setElementSecond(int a)
+{
+    m_children |= Second;
+    m_second = a;
+}
+
+void DomDateTime::setElementYear(int a)
+{
+    m_children |= Year;
+    m_year = a;
+}
+
+void DomDateTime::setElementMonth(int a)
+{
+    m_children |= Month;
+    m_month = a;
+}
+
+void DomDateTime::setElementDay(int a)
+{
+    m_children |= Day;
+    m_day = a;
+}
+
+void DomDateTime::clearElementHour()
+{
+    m_children &= ~Hour;
+}
+
+void DomDateTime::clearElementMinute()
+{
+    m_children &= ~Minute;
+}
+
+void DomDateTime::clearElementSecond()
+{
+    m_children &= ~Second;
+}
+
+void DomDateTime::clearElementYear()
+{
+    m_children &= ~Year;
+}
+
+void DomDateTime::clearElementMonth()
+{
+    m_children &= ~Month;
+}
+
+void DomDateTime::clearElementDay()
+{
+    m_children &= ~Day;
+}
+
+void DomStringList::clear(bool clear_all)
+{
+    m_string.clear();
+
+    if (clear_all) {
+    m_text = QString();
+    }
+
+}
+
+DomStringList::DomStringList()
+{
+}
+
+DomStringList::~DomStringList()
+{
+    m_string.clear();
+}
+
+void DomStringList::read(const QDomElement &node)
+{
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+        if (tag == QLatin1String("string")) {
+            m_string.append(e.text());
+            continue;
+        }
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomStringList::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("stringlist") : tagName.toLower());
+
+    QDomElement child;
+
+    for (int i = 0; i < m_string.size(); ++i) {
+        QString v = m_string[i];
+        QDomNode child = doc.createElement(QLatin1String("string"));
+        child.appendChild(doc.createTextNode(v));
+        e.appendChild(child);
+    }
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomStringList::setElementString(const QStringList& a)
+{
+    m_string = a;
+}
+
+void DomResourcePixmap::clear(bool clear_all)
+{
+
+    if (clear_all) {
+    m_text = QString();
+    m_has_attr_resource = false;
+    m_has_attr_alias = false;
+    }
+
+}
+
+DomResourcePixmap::DomResourcePixmap()
+{
+    m_has_attr_resource = false;
+    m_has_attr_alias = false;
+}
+
+DomResourcePixmap::~DomResourcePixmap()
+{
+}
+
+void DomResourcePixmap::read(const QDomElement &node)
+{
+    if (node.hasAttribute(QLatin1String("resource")))
+        setAttributeResource(node.attribute(QLatin1String("resource")));
+    if (node.hasAttribute(QLatin1String("alias")))
+        setAttributeAlias(node.attribute(QLatin1String("alias")));
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomResourcePixmap::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("resourcepixmap") : tagName.toLower());
+
+    QDomElement child;
+
+    if (hasAttributeResource())
+        e.setAttribute(QLatin1String("resource"), attributeResource());
+
+    if (hasAttributeAlias())
+        e.setAttribute(QLatin1String("alias"), attributeAlias());
+
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomResourceIcon::clear(bool clear_all)
+{
+    delete m_normalOff;
+    delete m_normalOn;
+    delete m_disabledOff;
+    delete m_disabledOn;
+    delete m_activeOff;
+    delete m_activeOn;
+    delete m_selectedOff;
+    delete m_selectedOn;
+
+    if (clear_all) {
+    m_text = QString();
+    m_has_attr_resource = false;
+    }
+
+    m_children = 0;
+    m_normalOff = 0;
+    m_normalOn = 0;
+    m_disabledOff = 0;
+    m_disabledOn = 0;
+    m_activeOff = 0;
+    m_activeOn = 0;
+    m_selectedOff = 0;
+    m_selectedOn = 0;
+}
+
+DomResourceIcon::DomResourceIcon()
+{
+    m_children = 0;
+    m_has_attr_resource = false;
+    m_normalOff = 0;
+    m_normalOn = 0;
+    m_disabledOff = 0;
+    m_disabledOn = 0;
+    m_activeOff = 0;
+    m_activeOn = 0;
+    m_selectedOff = 0;
+    m_selectedOn = 0;
+}
+
+DomResourceIcon::~DomResourceIcon()
+{
+    delete m_normalOff;
+    delete m_normalOn;
+    delete m_disabledOff;
+    delete m_disabledOn;
+    delete m_activeOff;
+    delete m_activeOn;
+    delete m_selectedOff;
+    delete m_selectedOn;
+}
+
+void DomResourceIcon::read(const QDomElement &node)
+{
+    if (node.hasAttribute(QLatin1String("resource")))
+        setAttributeResource(node.attribute(QLatin1String("resource")));
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+        if (tag == QLatin1String("normaloff")) {
+            DomResourcePixmap *v = new DomResourcePixmap();
+            v->read(e);
+            setElementNormalOff(v);
+            continue;
+        }
+        if (tag == QLatin1String("normalon")) {
+            DomResourcePixmap *v = new DomResourcePixmap();
+            v->read(e);
+            setElementNormalOn(v);
+            continue;
+        }
+        if (tag == QLatin1String("disabledoff")) {
+            DomResourcePixmap *v = new DomResourcePixmap();
+            v->read(e);
+            setElementDisabledOff(v);
+            continue;
+        }
+        if (tag == QLatin1String("disabledon")) {
+            DomResourcePixmap *v = new DomResourcePixmap();
+            v->read(e);
+            setElementDisabledOn(v);
+            continue;
+        }
+        if (tag == QLatin1String("activeoff")) {
+            DomResourcePixmap *v = new DomResourcePixmap();
+            v->read(e);
+            setElementActiveOff(v);
+            continue;
+        }
+        if (tag == QLatin1String("activeon")) {
+            DomResourcePixmap *v = new DomResourcePixmap();
+            v->read(e);
+            setElementActiveOn(v);
+            continue;
+        }
+        if (tag == QLatin1String("selectedoff")) {
+            DomResourcePixmap *v = new DomResourcePixmap();
+            v->read(e);
+            setElementSelectedOff(v);
+            continue;
+        }
+        if (tag == QLatin1String("selectedon")) {
+            DomResourcePixmap *v = new DomResourcePixmap();
+            v->read(e);
+            setElementSelectedOn(v);
+            continue;
+        }
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomResourceIcon::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("resourceicon") : tagName.toLower());
+
+    QDomElement child;
+
+    if (hasAttributeResource())
+        e.setAttribute(QLatin1String("resource"), attributeResource());
+
+    if (m_children & NormalOff) {
+        e.appendChild(m_normalOff->write(doc, QLatin1String("normaloff")));
+    }
+
+    if (m_children & NormalOn) {
+        e.appendChild(m_normalOn->write(doc, QLatin1String("normalon")));
+    }
+
+    if (m_children & DisabledOff) {
+        e.appendChild(m_disabledOff->write(doc, QLatin1String("disabledoff")));
+    }
+
+    if (m_children & DisabledOn) {
+        e.appendChild(m_disabledOn->write(doc, QLatin1String("disabledon")));
+    }
+
+    if (m_children & ActiveOff) {
+        e.appendChild(m_activeOff->write(doc, QLatin1String("activeoff")));
+    }
+
+    if (m_children & ActiveOn) {
+        e.appendChild(m_activeOn->write(doc, QLatin1String("activeon")));
+    }
+
+    if (m_children & SelectedOff) {
+        e.appendChild(m_selectedOff->write(doc, QLatin1String("selectedoff")));
+    }
+
+    if (m_children & SelectedOn) {
+        e.appendChild(m_selectedOn->write(doc, QLatin1String("selectedon")));
+    }
+
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomResourceIcon::setElementNormalOff(DomResourcePixmap* a)
+{
+    delete m_normalOff;
+    m_children |= NormalOff;
+    m_normalOff = a;
+}
+
+void DomResourceIcon::setElementNormalOn(DomResourcePixmap* a)
+{
+    delete m_normalOn;
+    m_children |= NormalOn;
+    m_normalOn = a;
+}
+
+void DomResourceIcon::setElementDisabledOff(DomResourcePixmap* a)
+{
+    delete m_disabledOff;
+    m_children |= DisabledOff;
+    m_disabledOff = a;
+}
+
+void DomResourceIcon::setElementDisabledOn(DomResourcePixmap* a)
+{
+    delete m_disabledOn;
+    m_children |= DisabledOn;
+    m_disabledOn = a;
+}
+
+void DomResourceIcon::setElementActiveOff(DomResourcePixmap* a)
+{
+    delete m_activeOff;
+    m_children |= ActiveOff;
+    m_activeOff = a;
+}
+
+void DomResourceIcon::setElementActiveOn(DomResourcePixmap* a)
+{
+    delete m_activeOn;
+    m_children |= ActiveOn;
+    m_activeOn = a;
+}
+
+void DomResourceIcon::setElementSelectedOff(DomResourcePixmap* a)
+{
+    delete m_selectedOff;
+    m_children |= SelectedOff;
+    m_selectedOff = a;
+}
+
+void DomResourceIcon::setElementSelectedOn(DomResourcePixmap* a)
+{
+    delete m_selectedOn;
+    m_children |= SelectedOn;
+    m_selectedOn = a;
+}
+
+void DomResourceIcon::clearElementNormalOff()
+{
+    delete m_normalOff;
+    m_normalOff = 0;
+    m_children &= ~NormalOff;
+}
+
+void DomResourceIcon::clearElementNormalOn()
+{
+    delete m_normalOn;
+    m_normalOn = 0;
+    m_children &= ~NormalOn;
+}
+
+void DomResourceIcon::clearElementDisabledOff()
+{
+    delete m_disabledOff;
+    m_disabledOff = 0;
+    m_children &= ~DisabledOff;
+}
+
+void DomResourceIcon::clearElementDisabledOn()
+{
+    delete m_disabledOn;
+    m_disabledOn = 0;
+    m_children &= ~DisabledOn;
+}
+
+void DomResourceIcon::clearElementActiveOff()
+{
+    delete m_activeOff;
+    m_activeOff = 0;
+    m_children &= ~ActiveOff;
+}
+
+void DomResourceIcon::clearElementActiveOn()
+{
+    delete m_activeOn;
+    m_activeOn = 0;
+    m_children &= ~ActiveOn;
+}
+
+void DomResourceIcon::clearElementSelectedOff()
+{
+    delete m_selectedOff;
+    m_selectedOff = 0;
+    m_children &= ~SelectedOff;
+}
+
+void DomResourceIcon::clearElementSelectedOn()
+{
+    delete m_selectedOn;
+    m_selectedOn = 0;
+    m_children &= ~SelectedOn;
+}
+
+void DomString::clear(bool clear_all)
+{
+
+    if (clear_all) {
+    m_text = QString();
+    m_has_attr_notr = false;
+    m_has_attr_comment = false;
+    }
+
+}
+
+DomString::DomString()
+{
+    m_has_attr_notr = false;
+    m_has_attr_comment = false;
+}
+
+DomString::~DomString()
+{
+}
+
+void DomString::read(const QDomElement &node)
+{
+    if (node.hasAttribute(QLatin1String("notr")))
+        setAttributeNotr(node.attribute(QLatin1String("notr")));
+    if (node.hasAttribute(QLatin1String("comment")))
+        setAttributeComment(node.attribute(QLatin1String("comment")));
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomString::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("string") : tagName.toLower());
+
+    QDomElement child;
+
+    if (hasAttributeNotr())
+        e.setAttribute(QLatin1String("notr"), attributeNotr());
+
+    if (hasAttributeComment())
+        e.setAttribute(QLatin1String("comment"), attributeComment());
+
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomPointF::clear(bool clear_all)
+{
+
+    if (clear_all) {
+    m_text = QString();
+    }
+
+    m_children = 0;
+    m_x = 0;
+    m_y = 0;
+}
+
+DomPointF::DomPointF()
+{
+    m_children = 0;
+    m_x = 0;
+    m_y = 0;
+}
+
+DomPointF::~DomPointF()
+{
+}
+
+void DomPointF::read(const QDomElement &node)
+{
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+        if (tag == QString(QLatin1Char('x'))) {
+            setElementX(e.text().toDouble());
+            continue;
+        }
+        if (tag == QString(QLatin1Char('y'))) {
+            setElementY(e.text().toDouble());
+            continue;
+        }
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomPointF::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("pointf") : tagName.toLower());
+
+    QDomElement child;
+
+    if (m_children & X) {
+        child = doc.createElement(QString(QLatin1Char('x')));
+        child.appendChild(doc.createTextNode(QString::number(m_x, 'f', 15)));
+        e.appendChild(child);
+    }
+
+    if (m_children & Y) {
+        child = doc.createElement(QString(QLatin1Char('y')));
+        child.appendChild(doc.createTextNode(QString::number(m_y, 'f', 15)));
+        e.appendChild(child);
+    }
+
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomPointF::setElementX(double a)
+{
+    m_children |= X;
+    m_x = a;
+}
+
+void DomPointF::setElementY(double a)
+{
+    m_children |= Y;
+    m_y = a;
+}
+
+void DomPointF::clearElementX()
+{
+    m_children &= ~X;
+}
+
+void DomPointF::clearElementY()
+{
+    m_children &= ~Y;
+}
+
+void DomRectF::clear(bool clear_all)
+{
+
+    if (clear_all) {
+    m_text = QString();
+    }
+
+    m_children = 0;
+    m_x = 0;
+    m_y = 0;
+    m_width = 0;
+    m_height = 0;
+}
+
+DomRectF::DomRectF()
+{
+    m_children = 0;
+    m_x = 0;
+    m_y = 0;
+    m_width = 0;
+    m_height = 0;
+}
+
+DomRectF::~DomRectF()
+{
+}
+
+void DomRectF::read(const QDomElement &node)
+{
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+        if (tag == QString(QLatin1Char('x'))) {
+            setElementX(e.text().toDouble());
+            continue;
+        }
+        if (tag == QString(QLatin1Char('y'))) {
+            setElementY(e.text().toDouble());
+            continue;
+        }
+        if (tag == QLatin1String("width")) {
+            setElementWidth(e.text().toDouble());
+            continue;
+        }
+        if (tag == QLatin1String("height")) {
+            setElementHeight(e.text().toDouble());
+            continue;
+        }
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomRectF::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("rectf") : tagName.toLower());
+
+    QDomElement child;
+
+    if (m_children & X) {
+        child = doc.createElement(QString(QLatin1Char('x')));
+        child.appendChild(doc.createTextNode(QString::number(m_x, 'f', 15)));
+        e.appendChild(child);
+    }
+
+    if (m_children & Y) {
+        child = doc.createElement(QString(QLatin1Char('y')));
+        child.appendChild(doc.createTextNode(QString::number(m_y, 'f', 15)));
+        e.appendChild(child);
+    }
+
+    if (m_children & Width) {
+        child = doc.createElement(QLatin1String("width"));
+        child.appendChild(doc.createTextNode(QString::number(m_width, 'f', 15)));
+        e.appendChild(child);
+    }
+
+    if (m_children & Height) {
+        child = doc.createElement(QLatin1String("height"));
+        child.appendChild(doc.createTextNode(QString::number(m_height, 'f', 15)));
+        e.appendChild(child);
+    }
+
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomRectF::setElementX(double a)
+{
+    m_children |= X;
+    m_x = a;
+}
+
+void DomRectF::setElementY(double a)
+{
+    m_children |= Y;
+    m_y = a;
+}
+
+void DomRectF::setElementWidth(double a)
+{
+    m_children |= Width;
+    m_width = a;
+}
+
+void DomRectF::setElementHeight(double a)
+{
+    m_children |= Height;
+    m_height = a;
+}
+
+void DomRectF::clearElementX()
+{
+    m_children &= ~X;
+}
+
+void DomRectF::clearElementY()
+{
+    m_children &= ~Y;
+}
+
+void DomRectF::clearElementWidth()
+{
+    m_children &= ~Width;
+}
+
+void DomRectF::clearElementHeight()
+{
+    m_children &= ~Height;
+}
+
+void DomSizeF::clear(bool clear_all)
+{
+
+    if (clear_all) {
+    m_text = QString();
+    }
+
+    m_children = 0;
+    m_width = 0;
+    m_height = 0;
+}
+
+DomSizeF::DomSizeF()
+{
+    m_children = 0;
+    m_width = 0;
+    m_height = 0;
+}
+
+DomSizeF::~DomSizeF()
+{
+}
+
+void DomSizeF::read(const QDomElement &node)
+{
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+        if (tag == QLatin1String("width")) {
+            setElementWidth(e.text().toDouble());
+            continue;
+        }
+        if (tag == QLatin1String("height")) {
+            setElementHeight(e.text().toDouble());
+            continue;
+        }
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomSizeF::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("sizef") : tagName.toLower());
+
+    QDomElement child;
+
+    if (m_children & Width) {
+        child = doc.createElement(QLatin1String("width"));
+        child.appendChild(doc.createTextNode(QString::number(m_width, 'f', 15)));
+        e.appendChild(child);
+    }
+
+    if (m_children & Height) {
+        child = doc.createElement(QLatin1String("height"));
+        child.appendChild(doc.createTextNode(QString::number(m_height, 'f', 15)));
+        e.appendChild(child);
+    }
+
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomSizeF::setElementWidth(double a)
+{
+    m_children |= Width;
+    m_width = a;
+}
+
+void DomSizeF::setElementHeight(double a)
+{
+    m_children |= Height;
+    m_height = a;
+}
+
+void DomSizeF::clearElementWidth()
+{
+    m_children &= ~Width;
+}
+
+void DomSizeF::clearElementHeight()
+{
+    m_children &= ~Height;
+}
+
+void DomChar::clear(bool clear_all)
+{
+
+    if (clear_all) {
+    m_text = QString();
+    }
+
+    m_children = 0;
+    m_unicode = 0;
+}
+
+DomChar::DomChar()
+{
+    m_children = 0;
+    m_unicode = 0;
+}
+
+DomChar::~DomChar()
+{
+}
+
+void DomChar::read(const QDomElement &node)
+{
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+        if (tag == QLatin1String("unicode")) {
+            setElementUnicode(e.text().toInt());
+            continue;
+        }
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomChar::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("char") : tagName.toLower());
+
+    QDomElement child;
+
+    if (m_children & Unicode) {
+        child = doc.createElement(QLatin1String("unicode"));
+        child.appendChild(doc.createTextNode(QString::number(m_unicode)));
+        e.appendChild(child);
+    }
+
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomChar::setElementUnicode(int a)
+{
+    m_children |= Unicode;
+    m_unicode = a;
+}
+
+void DomChar::clearElementUnicode()
+{
+    m_children &= ~Unicode;
+}
+
+void DomUrl::clear(bool clear_all)
+{
+    delete m_string;
+
+    if (clear_all) {
+    m_text = QString();
+    }
+
+    m_children = 0;
+    m_string = 0;
+}
+
+DomUrl::DomUrl()
+{
+    m_children = 0;
+    m_string = 0;
+}
+
+DomUrl::~DomUrl()
+{
+    delete m_string;
+}
+
+void DomUrl::read(const QDomElement &node)
+{
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+        if (tag == QLatin1String("string")) {
+            DomString *v = new DomString();
+            v->read(e);
+            setElementString(v);
+            continue;
+        }
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomUrl::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("url") : tagName.toLower());
+
+    QDomElement child;
+
+    if (m_children & String) {
+        e.appendChild(m_string->write(doc, QLatin1String("string")));
+    }
+
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomUrl::setElementString(DomString* a)
+{
+    delete m_string;
+    m_children |= String;
+    m_string = a;
+}
+
+void DomUrl::clearElementString()
+{
+    delete m_string;
+    m_string = 0;
+    m_children &= ~String;
+}
+
+void DomProperty::clear(bool clear_all)
+{
+    delete m_color;
+    delete m_font;
+    delete m_iconSet;
+    delete m_pixmap;
+    delete m_palette;
+    delete m_point;
+    delete m_rect;
+    delete m_locale;
+    delete m_sizePolicy;
+    delete m_size;
+    delete m_string;
+    delete m_stringList;
+    delete m_date;
+    delete m_time;
+    delete m_dateTime;
+    delete m_pointF;
+    delete m_rectF;
+    delete m_sizeF;
+    delete m_char;
+    delete m_url;
+    delete m_brush;
+
+    if (clear_all) {
+    m_text = QString();
+    m_has_attr_name = false;
+    m_has_attr_stdset = false;
+    m_attr_stdset = 0;
+    }
+
+    m_kind = Unknown;
+
+    m_color = 0;
+    m_cursor = 0;
+    m_font = 0;
+    m_iconSet = 0;
+    m_pixmap = 0;
+    m_palette = 0;
+    m_point = 0;
+    m_rect = 0;
+    m_locale = 0;
+    m_sizePolicy = 0;
+    m_size = 0;
+    m_string = 0;
+    m_stringList = 0;
+    m_number = 0;
+    m_float = 0.0;
+    m_double = 0;
+    m_date = 0;
+    m_time = 0;
+    m_dateTime = 0;
+    m_pointF = 0;
+    m_rectF = 0;
+    m_sizeF = 0;
+    m_longLong = 0;
+    m_char = 0;
+    m_url = 0;
+    m_uInt = 0;
+    m_uLongLong = 0;
+    m_brush = 0;
+}
+
+DomProperty::DomProperty()
+{
+    m_kind = Unknown;
+
+    m_has_attr_name = false;
+    m_has_attr_stdset = false;
+    m_attr_stdset = 0;
+    m_color = 0;
+    m_cursor = 0;
+    m_font = 0;
+    m_iconSet = 0;
+    m_pixmap = 0;
+    m_palette = 0;
+    m_point = 0;
+    m_rect = 0;
+    m_locale = 0;
+    m_sizePolicy = 0;
+    m_size = 0;
+    m_string = 0;
+    m_stringList = 0;
+    m_number = 0;
+    m_float = 0.0;
+    m_double = 0;
+    m_date = 0;
+    m_time = 0;
+    m_dateTime = 0;
+    m_pointF = 0;
+    m_rectF = 0;
+    m_sizeF = 0;
+    m_longLong = 0;
+    m_char = 0;
+    m_url = 0;
+    m_uInt = 0;
+    m_uLongLong = 0;
+    m_brush = 0;
+}
+
+DomProperty::~DomProperty()
+{
+    delete m_color;
+    delete m_font;
+    delete m_iconSet;
+    delete m_pixmap;
+    delete m_palette;
+    delete m_point;
+    delete m_rect;
+    delete m_locale;
+    delete m_sizePolicy;
+    delete m_size;
+    delete m_string;
+    delete m_stringList;
+    delete m_date;
+    delete m_time;
+    delete m_dateTime;
+    delete m_pointF;
+    delete m_rectF;
+    delete m_sizeF;
+    delete m_char;
+    delete m_url;
+    delete m_brush;
+}
+
+void DomProperty::read(const QDomElement &node)
+{
+    if (node.hasAttribute(QLatin1String("name")))
+        setAttributeName(node.attribute(QLatin1String("name")));
+    if (node.hasAttribute(QLatin1String("stdset")))
+        setAttributeStdset(node.attribute(QLatin1String("stdset")).toInt());
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+        if (tag == QLatin1String("bool")) {
+            setElementBool(e.text());
+            continue;
+        }
+        if (tag == QLatin1String("color")) {
+            DomColor *v = new DomColor();
+            v->read(e);
+            setElementColor(v);
+            continue;
+        }
+        if (tag == QLatin1String("cstring")) {
+            setElementCstring(e.text());
+            continue;
+        }
+        if (tag == QLatin1String("cursor")) {
+            setElementCursor(e.text().toInt());
+            continue;
+        }
+        if (tag == QLatin1String("cursorshape")) {
+            setElementCursorShape(e.text());
+            continue;
+        }
+        if (tag == QLatin1String("enum")) {
+            setElementEnum(e.text());
+            continue;
+        }
+        if (tag == QLatin1String("font")) {
+            DomFont *v = new DomFont();
+            v->read(e);
+            setElementFont(v);
+            continue;
+        }
+        if (tag == QLatin1String("iconset")) {
+            DomResourceIcon *v = new DomResourceIcon();
+            v->read(e);
+            setElementIconSet(v);
+            continue;
+        }
+        if (tag == QLatin1String("pixmap")) {
+            DomResourcePixmap *v = new DomResourcePixmap();
+            v->read(e);
+            setElementPixmap(v);
+            continue;
+        }
+        if (tag == QLatin1String("palette")) {
+            DomPalette *v = new DomPalette();
+            v->read(e);
+            setElementPalette(v);
+            continue;
+        }
+        if (tag == QLatin1String("point")) {
+            DomPoint *v = new DomPoint();
+            v->read(e);
+            setElementPoint(v);
+            continue;
+        }
+        if (tag == QLatin1String("rect")) {
+            DomRect *v = new DomRect();
+            v->read(e);
+            setElementRect(v);
+            continue;
+        }
+        if (tag == QLatin1String("set")) {
+            setElementSet(e.text());
+            continue;
+        }
+        if (tag == QLatin1String("locale")) {
+            DomLocale *v = new DomLocale();
+            v->read(e);
+            setElementLocale(v);
+            continue;
+        }
+        if (tag == QLatin1String("sizepolicy")) {
+            DomSizePolicy *v = new DomSizePolicy();
+            v->read(e);
+            setElementSizePolicy(v);
+            continue;
+        }
+        if (tag == QLatin1String("size")) {
+            DomSize *v = new DomSize();
+            v->read(e);
+            setElementSize(v);
+            continue;
+        }
+        if (tag == QLatin1String("string")) {
+            DomString *v = new DomString();
+            v->read(e);
+            setElementString(v);
+            continue;
+        }
+        if (tag == QLatin1String("stringlist")) {
+            DomStringList *v = new DomStringList();
+            v->read(e);
+            setElementStringList(v);
+            continue;
+        }
+        if (tag == QLatin1String("number")) {
+            setElementNumber(e.text().toInt());
+            continue;
+        }
+        if (tag == QLatin1String("float")) {
+            setElementFloat(e.text().toFloat());
+            continue;
+        }
+        if (tag == QLatin1String("double")) {
+            setElementDouble(e.text().toDouble());
+            continue;
+        }
+        if (tag == QLatin1String("date")) {
+            DomDate *v = new DomDate();
+            v->read(e);
+            setElementDate(v);
+            continue;
+        }
+        if (tag == QLatin1String("time")) {
+            DomTime *v = new DomTime();
+            v->read(e);
+            setElementTime(v);
+            continue;
+        }
+        if (tag == QLatin1String("datetime")) {
+            DomDateTime *v = new DomDateTime();
+            v->read(e);
+            setElementDateTime(v);
+            continue;
+        }
+        if (tag == QLatin1String("pointf")) {
+            DomPointF *v = new DomPointF();
+            v->read(e);
+            setElementPointF(v);
+            continue;
+        }
+        if (tag == QLatin1String("rectf")) {
+            DomRectF *v = new DomRectF();
+            v->read(e);
+            setElementRectF(v);
+            continue;
+        }
+        if (tag == QLatin1String("sizef")) {
+            DomSizeF *v = new DomSizeF();
+            v->read(e);
+            setElementSizeF(v);
+            continue;
+        }
+        if (tag == QLatin1String("longlong")) {
+            setElementLongLong(e.text().toLongLong());
+            continue;
+        }
+        if (tag == QLatin1String("char")) {
+            DomChar *v = new DomChar();
+            v->read(e);
+            setElementChar(v);
+            continue;
+        }
+        if (tag == QLatin1String("url")) {
+            DomUrl *v = new DomUrl();
+            v->read(e);
+            setElementUrl(v);
+            continue;
+        }
+        if (tag == QLatin1String("uint")) {
+            setElementUInt(e.text().toUInt());
+            continue;
+        }
+        if (tag == QLatin1String("ulonglong")) {
+            setElementULongLong(e.text().toULongLong());
+            continue;
+        }
+        if (tag == QLatin1String("brush")) {
+            DomBrush *v = new DomBrush();
+            v->read(e);
+            setElementBrush(v);
+            continue;
+        }
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomProperty::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("property") : tagName.toLower());
+
+    QDomElement child;
+
+    if (hasAttributeName())
+        e.setAttribute(QLatin1String("name"), attributeName());
+
+    if (hasAttributeStdset())
+        e.setAttribute(QLatin1String("stdset"), attributeStdset());
+
+    switch(kind()) {
+        case Bool: {
+            QDomElement child = doc.createElement(QLatin1String("bool"));
+            QDomText text = doc.createTextNode(elementBool());
+            child.appendChild(text);
+            e.appendChild(child);
+            break;
+        }
+        case Color: {
+            DomColor* v = elementColor();
+            if (v != 0) {
+                QDomElement child = v->write(doc, QLatin1String("color"));
+                e.appendChild(child);
+            }
+            break;
+        }
+        case Cstring: {
+            QDomElement child = doc.createElement(QLatin1String("cstring"));
+            QDomText text = doc.createTextNode(elementCstring());
+            child.appendChild(text);
+            e.appendChild(child);
+            break;
+        }
+        case Cursor: {
+            QDomElement child = doc.createElement(QLatin1String("cursor"));
+            QDomText text = doc.createTextNode(QString::number(elementCursor()));
+            child.appendChild(text);
+            e.appendChild(child);
+            break;
+        }
+        case CursorShape: {
+            QDomElement child = doc.createElement(QLatin1String("cursorShape"));
+            QDomText text = doc.createTextNode(elementCursorShape());
+            child.appendChild(text);
+            e.appendChild(child);
+            break;
+        }
+        case Enum: {
+            QDomElement child = doc.createElement(QLatin1String("enum"));
+            QDomText text = doc.createTextNode(elementEnum());
+            child.appendChild(text);
+            e.appendChild(child);
+            break;
+        }
+        case Font: {
+            DomFont* v = elementFont();
+            if (v != 0) {
+                QDomElement child = v->write(doc, QLatin1String("font"));
+                e.appendChild(child);
+            }
+            break;
+        }
+        case IconSet: {
+            DomResourceIcon* v = elementIconSet();
+            if (v != 0) {
+                QDomElement child = v->write(doc, QLatin1String("iconset"));
+                e.appendChild(child);
+            }
+            break;
+        }
+        case Pixmap: {
+            DomResourcePixmap* v = elementPixmap();
+            if (v != 0) {
+                QDomElement child = v->write(doc, QLatin1String("pixmap"));
+                e.appendChild(child);
+            }
+            break;
+        }
+        case Palette: {
+            DomPalette* v = elementPalette();
+            if (v != 0) {
+                QDomElement child = v->write(doc, QLatin1String("palette"));
+                e.appendChild(child);
+            }
+            break;
+        }
+        case Point: {
+            DomPoint* v = elementPoint();
+            if (v != 0) {
+                QDomElement child = v->write(doc, QLatin1String("point"));
+                e.appendChild(child);
+            }
+            break;
+        }
+        case Rect: {
+            DomRect* v = elementRect();
+            if (v != 0) {
+                QDomElement child = v->write(doc, QLatin1String("rect"));
+                e.appendChild(child);
+            }
+            break;
+        }
+        case Set: {
+            QDomElement child = doc.createElement(QLatin1String("set"));
+            QDomText text = doc.createTextNode(elementSet());
+            child.appendChild(text);
+            e.appendChild(child);
+            break;
+        }
+        case Locale: {
+            DomLocale* v = elementLocale();
+            if (v != 0) {
+                QDomElement child = v->write(doc, QLatin1String("locale"));
+                e.appendChild(child);
+            }
+            break;
+        }
+        case SizePolicy: {
+            DomSizePolicy* v = elementSizePolicy();
+            if (v != 0) {
+                QDomElement child = v->write(doc, QLatin1String("sizepolicy"));
+                e.appendChild(child);
+            }
+            break;
+        }
+        case Size: {
+            DomSize* v = elementSize();
+            if (v != 0) {
+                QDomElement child = v->write(doc, QLatin1String("size"));
+                e.appendChild(child);
+            }
+            break;
+        }
+        case String: {
+            DomString* v = elementString();
+            if (v != 0) {
+                QDomElement child = v->write(doc, QLatin1String("string"));
+                e.appendChild(child);
+            }
+            break;
+        }
+        case StringList: {
+            DomStringList* v = elementStringList();
+            if (v != 0) {
+                QDomElement child = v->write(doc, QLatin1String("stringlist"));
+                e.appendChild(child);
+            }
+            break;
+        }
+        case Number: {
+            QDomElement child = doc.createElement(QLatin1String("number"));
+            QDomText text = doc.createTextNode(QString::number(elementNumber()));
+            child.appendChild(text);
+            e.appendChild(child);
+            break;
+        }
+        case Float: {
+            QDomElement child = doc.createElement(QLatin1String("float"));
+            QDomText text = doc.createTextNode(QString::number(elementFloat(), 'f', 8));
+            child.appendChild(text);
+            e.appendChild(child);
+            break;
+        }
+        case Double: {
+            QDomElement child = doc.createElement(QLatin1String("double"));
+            QDomText text = doc.createTextNode(QString::number(elementDouble(), 'f', 15));
+            child.appendChild(text);
+            e.appendChild(child);
+            break;
+        }
+        case Date: {
+            DomDate* v = elementDate();
+            if (v != 0) {
+                QDomElement child = v->write(doc, QLatin1String("date"));
+                e.appendChild(child);
+            }
+            break;
+        }
+        case Time: {
+            DomTime* v = elementTime();
+            if (v != 0) {
+                QDomElement child = v->write(doc, QLatin1String("time"));
+                e.appendChild(child);
+            }
+            break;
+        }
+        case DateTime: {
+            DomDateTime* v = elementDateTime();
+            if (v != 0) {
+                QDomElement child = v->write(doc, QLatin1String("datetime"));
+                e.appendChild(child);
+            }
+            break;
+        }
+        case PointF: {
+            DomPointF* v = elementPointF();
+            if (v != 0) {
+                QDomElement child = v->write(doc, QLatin1String("pointf"));
+                e.appendChild(child);
+            }
+            break;
+        }
+        case RectF: {
+            DomRectF* v = elementRectF();
+            if (v != 0) {
+                QDomElement child = v->write(doc, QLatin1String("rectf"));
+                e.appendChild(child);
+            }
+            break;
+        }
+        case SizeF: {
+            DomSizeF* v = elementSizeF();
+            if (v != 0) {
+                QDomElement child = v->write(doc, QLatin1String("sizef"));
+                e.appendChild(child);
+            }
+            break;
+        }
+        case LongLong: {
+            QDomElement child = doc.createElement(QLatin1String("longLong"));
+            QDomText text = doc.createTextNode(QString::number(elementLongLong()));
+            child.appendChild(text);
+            e.appendChild(child);
+            break;
+        }
+        case Char: {
+            DomChar* v = elementChar();
+            if (v != 0) {
+                QDomElement child = v->write(doc, QLatin1String("char"));
+                e.appendChild(child);
+            }
+            break;
+        }
+        case Url: {
+            DomUrl* v = elementUrl();
+            if (v != 0) {
+                QDomElement child = v->write(doc, QLatin1String("url"));
+                e.appendChild(child);
+            }
+            break;
+        }
+        case UInt: {
+            QDomElement child = doc.createElement(QLatin1String("uInt"));
+            QDomText text = doc.createTextNode(QString::number(elementUInt()));
+            child.appendChild(text);
+            e.appendChild(child);
+            break;
+        }
+        case ULongLong: {
+            QDomElement child = doc.createElement(QLatin1String("uLongLong"));
+            QDomText text = doc.createTextNode(QString::number(elementULongLong()));
+            child.appendChild(text);
+            e.appendChild(child);
+            break;
+        }
+        case Brush: {
+            DomBrush* v = elementBrush();
+            if (v != 0) {
+                QDomElement child = v->write(doc, QLatin1String("brush"));
+                e.appendChild(child);
+            }
+            break;
+        }
+        default:
+            break;
+    }
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomProperty::setElementBool(const QString& a)
+{
+    clear(false);
+    m_kind = Bool;
+    m_bool = a;
+}
+
+void DomProperty::setElementColor(DomColor* a)
+{
+    clear(false);
+    m_kind = Color;
+    m_color = a;
+}
+
+void DomProperty::setElementCstring(const QString& a)
+{
+    clear(false);
+    m_kind = Cstring;
+    m_cstring = a;
+}
+
+void DomProperty::setElementCursor(int a)
+{
+    clear(false);
+    m_kind = Cursor;
+    m_cursor = a;
+}
+
+void DomProperty::setElementCursorShape(const QString& a)
+{
+    clear(false);
+    m_kind = CursorShape;
+    m_cursorShape = a;
+}
+
+void DomProperty::setElementEnum(const QString& a)
+{
+    clear(false);
+    m_kind = Enum;
+    m_enum = a;
+}
+
+void DomProperty::setElementFont(DomFont* a)
+{
+    clear(false);
+    m_kind = Font;
+    m_font = a;
+}
+
+void DomProperty::setElementIconSet(DomResourceIcon* a)
+{
+    clear(false);
+    m_kind = IconSet;
+    m_iconSet = a;
+}
+
+void DomProperty::setElementPixmap(DomResourcePixmap* a)
+{
+    clear(false);
+    m_kind = Pixmap;
+    m_pixmap = a;
+}
+
+void DomProperty::setElementPalette(DomPalette* a)
+{
+    clear(false);
+    m_kind = Palette;
+    m_palette = a;
+}
+
+void DomProperty::setElementPoint(DomPoint* a)
+{
+    clear(false);
+    m_kind = Point;
+    m_point = a;
+}
+
+void DomProperty::setElementRect(DomRect* a)
+{
+    clear(false);
+    m_kind = Rect;
+    m_rect = a;
+}
+
+void DomProperty::setElementSet(const QString& a)
+{
+    clear(false);
+    m_kind = Set;
+    m_set = a;
+}
+
+void DomProperty::setElementLocale(DomLocale* a)
+{
+    clear(false);
+    m_kind = Locale;
+    m_locale = a;
+}
+
+void DomProperty::setElementSizePolicy(DomSizePolicy* a)
+{
+    clear(false);
+    m_kind = SizePolicy;
+    m_sizePolicy = a;
+}
+
+void DomProperty::setElementSize(DomSize* a)
+{
+    clear(false);
+    m_kind = Size;
+    m_size = a;
+}
+
+void DomProperty::setElementString(DomString* a)
+{
+    clear(false);
+    m_kind = String;
+    m_string = a;
+}
+
+void DomProperty::setElementStringList(DomStringList* a)
+{
+    clear(false);
+    m_kind = StringList;
+    m_stringList = a;
+}
+
+void DomProperty::setElementNumber(int a)
+{
+    clear(false);
+    m_kind = Number;
+    m_number = a;
+}
+
+void DomProperty::setElementFloat(float a)
+{
+    clear(false);
+    m_kind = Float;
+    m_float = a;
+}
+
+void DomProperty::setElementDouble(double a)
+{
+    clear(false);
+    m_kind = Double;
+    m_double = a;
+}
+
+void DomProperty::setElementDate(DomDate* a)
+{
+    clear(false);
+    m_kind = Date;
+    m_date = a;
+}
+
+void DomProperty::setElementTime(DomTime* a)
+{
+    clear(false);
+    m_kind = Time;
+    m_time = a;
+}
+
+void DomProperty::setElementDateTime(DomDateTime* a)
+{
+    clear(false);
+    m_kind = DateTime;
+    m_dateTime = a;
+}
+
+void DomProperty::setElementPointF(DomPointF* a)
+{
+    clear(false);
+    m_kind = PointF;
+    m_pointF = a;
+}
+
+void DomProperty::setElementRectF(DomRectF* a)
+{
+    clear(false);
+    m_kind = RectF;
+    m_rectF = a;
+}
+
+void DomProperty::setElementSizeF(DomSizeF* a)
+{
+    clear(false);
+    m_kind = SizeF;
+    m_sizeF = a;
+}
+
+void DomProperty::setElementLongLong(qlonglong a)
+{
+    clear(false);
+    m_kind = LongLong;
+    m_longLong = a;
+}
+
+void DomProperty::setElementChar(DomChar* a)
+{
+    clear(false);
+    m_kind = Char;
+    m_char = a;
+}
+
+void DomProperty::setElementUrl(DomUrl* a)
+{
+    clear(false);
+    m_kind = Url;
+    m_url = a;
+}
+
+void DomProperty::setElementUInt(uint a)
+{
+    clear(false);
+    m_kind = UInt;
+    m_uInt = a;
+}
+
+void DomProperty::setElementULongLong(qulonglong a)
+{
+    clear(false);
+    m_kind = ULongLong;
+    m_uLongLong = a;
+}
+
+void DomProperty::setElementBrush(DomBrush* a)
+{
+    clear(false);
+    m_kind = Brush;
+    m_brush = a;
+}
+
+void DomConnections::clear(bool clear_all)
+{
+    for (int i = 0; i < m_connection.size(); ++i)
+        delete m_connection[i];
+    m_connection.clear();
+
+    if (clear_all) {
+    m_text = QString();
+    }
+
+}
+
+DomConnections::DomConnections()
+{
+}
+
+DomConnections::~DomConnections()
+{
+    for (int i = 0; i < m_connection.size(); ++i)
+        delete m_connection[i];
+    m_connection.clear();
+}
+
+void DomConnections::read(const QDomElement &node)
+{
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+        if (tag == QLatin1String("connection")) {
+            DomConnection *v = new DomConnection();
+            v->read(e);
+            m_connection.append(v);
+            continue;
+        }
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomConnections::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("connections") : tagName.toLower());
+
+    QDomElement child;
+
+    for (int i = 0; i < m_connection.size(); ++i) {
+        DomConnection* v = m_connection[i];
+        QDomNode child = v->write(doc, QLatin1String("connection"));
+        e.appendChild(child);
+    }
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomConnections::setElementConnection(const QList<DomConnection*>& a)
+{
+    m_connection = a;
+}
+
+void DomConnection::clear(bool clear_all)
+{
+    delete m_hints;
+
+    if (clear_all) {
+    m_text = QString();
+    }
+
+    m_children = 0;
+    m_hints = 0;
+}
+
+DomConnection::DomConnection()
+{
+    m_children = 0;
+    m_hints = 0;
+}
+
+DomConnection::~DomConnection()
+{
+    delete m_hints;
+}
+
+void DomConnection::read(const QDomElement &node)
+{
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+        if (tag == QLatin1String("sender")) {
+            setElementSender(e.text());
+            continue;
+        }
+        if (tag == QLatin1String("signal")) {
+            setElementSignal(e.text());
+            continue;
+        }
+        if (tag == QLatin1String("receiver")) {
+            setElementReceiver(e.text());
+            continue;
+        }
+        if (tag == QLatin1String("slot")) {
+            setElementSlot(e.text());
+            continue;
+        }
+        if (tag == QLatin1String("hints")) {
+            DomConnectionHints *v = new DomConnectionHints();
+            v->read(e);
+            setElementHints(v);
+            continue;
+        }
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomConnection::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("connection") : tagName.toLower());
+
+    QDomElement child;
+
+    if (m_children & Sender) {
+        child = doc.createElement(QLatin1String("sender"));
+        child.appendChild(doc.createTextNode(m_sender));
+        e.appendChild(child);
+    }
+
+    if (m_children & Signal) {
+        child = doc.createElement(QLatin1String("signal"));
+        child.appendChild(doc.createTextNode(m_signal));
+        e.appendChild(child);
+    }
+
+    if (m_children & Receiver) {
+        child = doc.createElement(QLatin1String("receiver"));
+        child.appendChild(doc.createTextNode(m_receiver));
+        e.appendChild(child);
+    }
+
+    if (m_children & Slot) {
+        child = doc.createElement(QLatin1String("slot"));
+        child.appendChild(doc.createTextNode(m_slot));
+        e.appendChild(child);
+    }
+
+    if (m_children & Hints) {
+        e.appendChild(m_hints->write(doc, QLatin1String("hints")));
+    }
+
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomConnection::setElementSender(const QString& a)
+{
+    m_children |= Sender;
+    m_sender = a;
+}
+
+void DomConnection::setElementSignal(const QString& a)
+{
+    m_children |= Signal;
+    m_signal = a;
+}
+
+void DomConnection::setElementReceiver(const QString& a)
+{
+    m_children |= Receiver;
+    m_receiver = a;
+}
+
+void DomConnection::setElementSlot(const QString& a)
+{
+    m_children |= Slot;
+    m_slot = a;
+}
+
+void DomConnection::setElementHints(DomConnectionHints* a)
+{
+    delete m_hints;
+    m_children |= Hints;
+    m_hints = a;
+}
+
+void DomConnection::clearElementSender()
+{
+    m_children &= ~Sender;
+}
+
+void DomConnection::clearElementSignal()
+{
+    m_children &= ~Signal;
+}
+
+void DomConnection::clearElementReceiver()
+{
+    m_children &= ~Receiver;
+}
+
+void DomConnection::clearElementSlot()
+{
+    m_children &= ~Slot;
+}
+
+void DomConnection::clearElementHints()
+{
+    delete m_hints;
+    m_hints = 0;
+    m_children &= ~Hints;
+}
+
+void DomConnectionHints::clear(bool clear_all)
+{
+    for (int i = 0; i < m_hint.size(); ++i)
+        delete m_hint[i];
+    m_hint.clear();
+
+    if (clear_all) {
+    m_text = QString();
+    }
+
+}
+
+DomConnectionHints::DomConnectionHints()
+{
+}
+
+DomConnectionHints::~DomConnectionHints()
+{
+    for (int i = 0; i < m_hint.size(); ++i)
+        delete m_hint[i];
+    m_hint.clear();
+}
+
+void DomConnectionHints::read(const QDomElement &node)
+{
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+        if (tag == QLatin1String("hint")) {
+            DomConnectionHint *v = new DomConnectionHint();
+            v->read(e);
+            m_hint.append(v);
+            continue;
+        }
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomConnectionHints::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("connectionhints") : tagName.toLower());
+
+    QDomElement child;
+
+    for (int i = 0; i < m_hint.size(); ++i) {
+        DomConnectionHint* v = m_hint[i];
+        QDomNode child = v->write(doc, QLatin1String("hint"));
+        e.appendChild(child);
+    }
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomConnectionHints::setElementHint(const QList<DomConnectionHint*>& a)
+{
+    m_hint = a;
+}
+
+void DomConnectionHint::clear(bool clear_all)
+{
+
+    if (clear_all) {
+    m_text = QString();
+    m_has_attr_type = false;
+    }
+
+    m_children = 0;
+    m_x = 0;
+    m_y = 0;
+}
+
+DomConnectionHint::DomConnectionHint()
+{
+    m_children = 0;
+    m_has_attr_type = false;
+    m_x = 0;
+    m_y = 0;
+}
+
+DomConnectionHint::~DomConnectionHint()
+{
+}
+
+void DomConnectionHint::read(const QDomElement &node)
+{
+    if (node.hasAttribute(QLatin1String("type")))
+        setAttributeType(node.attribute(QLatin1String("type")));
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+        if (tag == QString(QLatin1Char('x'))) {
+            setElementX(e.text().toInt());
+            continue;
+        }
+        if (tag == QString(QLatin1Char('y'))) {
+            setElementY(e.text().toInt());
+            continue;
+        }
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomConnectionHint::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("connectionhint") : tagName.toLower());
+
+    QDomElement child;
+
+    if (hasAttributeType())
+        e.setAttribute(QLatin1String("type"), attributeType());
+
+    if (m_children & X) {
+        child = doc.createElement(QString(QLatin1Char('x')));
+        child.appendChild(doc.createTextNode(QString::number(m_x)));
+        e.appendChild(child);
+    }
+
+    if (m_children & Y) {
+        child = doc.createElement(QString(QLatin1Char('y')));
+        child.appendChild(doc.createTextNode(QString::number(m_y)));
+        e.appendChild(child);
+    }
+
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomConnectionHint::setElementX(int a)
+{
+    m_children |= X;
+    m_x = a;
+}
+
+void DomConnectionHint::setElementY(int a)
+{
+    m_children |= Y;
+    m_y = a;
+}
+
+void DomConnectionHint::clearElementX()
+{
+    m_children &= ~X;
+}
+
+void DomConnectionHint::clearElementY()
+{
+    m_children &= ~Y;
+}
+
+void DomScript::clear(bool clear_all)
+{
+
+    if (clear_all) {
+    m_text = QString();
+    m_has_attr_source = false;
+    m_has_attr_language = false;
+    }
+
+}
+
+DomScript::DomScript()
+{
+    m_has_attr_source = false;
+    m_has_attr_language = false;
+}
+
+DomScript::~DomScript()
+{
+}
+
+void DomScript::read(const QDomElement &node)
+{
+    if (node.hasAttribute(QLatin1String("source")))
+        setAttributeSource(node.attribute(QLatin1String("source")));
+    if (node.hasAttribute(QLatin1String("language")))
+        setAttributeLanguage(node.attribute(QLatin1String("language")));
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomScript::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("script") : tagName.toLower());
+
+    QDomElement child;
+
+    if (hasAttributeSource())
+        e.setAttribute(QLatin1String("source"), attributeSource());
+
+    if (hasAttributeLanguage())
+        e.setAttribute(QLatin1String("language"), attributeLanguage());
+
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomWidgetData::clear(bool clear_all)
+{
+    for (int i = 0; i < m_property.size(); ++i)
+        delete m_property[i];
+    m_property.clear();
+
+    if (clear_all) {
+    m_text = QString();
+    }
+
+}
+
+DomWidgetData::DomWidgetData()
+{
+}
+
+DomWidgetData::~DomWidgetData()
+{
+    for (int i = 0; i < m_property.size(); ++i)
+        delete m_property[i];
+    m_property.clear();
+}
+
+void DomWidgetData::read(const QDomElement &node)
+{
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+        if (tag == QLatin1String("property")) {
+            DomProperty *v = new DomProperty();
+            v->read(e);
+            m_property.append(v);
+            continue;
+        }
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomWidgetData::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("widgetdata") : tagName.toLower());
+
+    QDomElement child;
+
+    for (int i = 0; i < m_property.size(); ++i) {
+        DomProperty* v = m_property[i];
+        QDomNode child = v->write(doc, QLatin1String("property"));
+        e.appendChild(child);
+    }
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomWidgetData::setElementProperty(const QList<DomProperty*>& a)
+{
+    m_property = a;
+}
+
+void DomDesignerData::clear(bool clear_all)
+{
+    for (int i = 0; i < m_property.size(); ++i)
+        delete m_property[i];
+    m_property.clear();
+
+    if (clear_all) {
+    m_text = QString();
+    }
+
+}
+
+DomDesignerData::DomDesignerData()
+{
+}
+
+DomDesignerData::~DomDesignerData()
+{
+    for (int i = 0; i < m_property.size(); ++i)
+        delete m_property[i];
+    m_property.clear();
+}
+
+void DomDesignerData::read(const QDomElement &node)
+{
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+        if (tag == QLatin1String("property")) {
+            DomProperty *v = new DomProperty();
+            v->read(e);
+            m_property.append(v);
+            continue;
+        }
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomDesignerData::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("designerdata") : tagName.toLower());
+
+    QDomElement child;
+
+    for (int i = 0; i < m_property.size(); ++i) {
+        DomProperty* v = m_property[i];
+        QDomNode child = v->write(doc, QLatin1String("property"));
+        e.appendChild(child);
+    }
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomDesignerData::setElementProperty(const QList<DomProperty*>& a)
+{
+    m_property = a;
+}
+
+void DomSlots::clear(bool clear_all)
+{
+    m_slot.clear();
+    m_signal.clear();
+
+    if (clear_all) {
+    m_text = QString();
+    }
+
+}
+
+DomSlots::DomSlots()
+{
+}
+
+DomSlots::~DomSlots()
+{
+    m_slot.clear();
+    m_signal.clear();
+}
+
+void DomSlots::read(const QDomElement &node)
+{
+
+    for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        if (!n.isElement())
+            continue;
+        QDomElement e = n.toElement();
+        QString tag = e.tagName().toLower();
+        if (tag == QLatin1String("slot")) {
+            m_slot.append(e.text());
+            continue;
+        }
+        if (tag == QLatin1String("signal")) {
+            m_signal.append(e.text());
+            continue;
+        }
+    }
+
+    m_text.clear();
+    for (QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
+        if (child.isText())
+            m_text.append(child.nodeValue());
+    }
+}
+
+QDomElement DomSlots::write(QDomDocument &doc, const QString &tagName) const
+{
+    QDomElement e = doc.createElement(tagName.isEmpty() ? QString::fromUtf8("slots") : tagName.toLower());
+
+    QDomElement child;
+
+    for (int i = 0; i < m_slot.size(); ++i) {
+        QString v = m_slot[i];
+        QDomNode child = doc.createElement(QLatin1String("slot"));
+        child.appendChild(doc.createTextNode(v));
+        e.appendChild(child);
+    }
+    for (int i = 0; i < m_signal.size(); ++i) {
+        QString v = m_signal[i];
+        QDomNode child = doc.createElement(QLatin1String("signal"));
+        child.appendChild(doc.createTextNode(v));
+        e.appendChild(child);
+    }
+    if (!m_text.isEmpty())
+        e.appendChild(doc.createTextNode(m_text));
+
+    return e;
+}
+
+void DomSlots::setElementSlot(const QStringList& a)
+{
+    m_slot = a;
+}
+
+void DomSlots::setElementSignal(const QStringList& a)
+{
+    m_signal = a;
+}
+
+QT_END_NAMESPACE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/duic/ui4.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,3165 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+** exception, Nokia gives you certain additional rights. These rights
+** are described in the Nokia Qt GPL Exception version 1.3, included in
+** the file GPL_EXCEPTION.txt in this package.
+**
+** Qt for Windows(R) Licensees
+** As a special exception, Nokia, as the sole copyright holder for Qt
+** Designer, grants users of the Qt/Eclipse Integration plug-in the
+** right for the Qt/Eclipse Integration to link to functionality
+** provided by Qt Designer and its related libraries.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+****************************************************************************/
+
+//
+//  W A R N I N G
+//  -------------
+//
+// This file is not part of the Qt API.  It exists for the convenience
+// of Qt Designer.  This header
+// file may change from version to version without notice, or even be removed.
+//
+// We mean it.
+//
+
+// THIS FILE IS AUTOMATICALLY GENERATED
+
+#ifndef UI4_H
+#define UI4_H
+
+#include <QtCore/QList>
+#include <QtCore/QString>
+#include <QtCore/QStringList>
+
+#include <QtCore/qglobal.h>
+
+QT_BEGIN_NAMESPACE
+
+class QDomDocument;
+class QDomElement;
+
+#define QDESIGNER_UILIB_EXTERN Q_DECL_EXPORT
+#define QDESIGNER_UILIB_IMPORT Q_DECL_IMPORT
+
+#if defined(QT_DESIGNER_STATIC) || defined(QT_UIC) || defined(QT_UIC3)
+#  define QDESIGNER_UILIB_EXPORT
+#elif defined(QDESIGNER_UILIB_LIBRARY)
+#  define QDESIGNER_UILIB_EXPORT QDESIGNER_UILIB_EXTERN
+#else
+#  define QDESIGNER_UILIB_EXPORT QDESIGNER_UILIB_IMPORT
+#endif
+
+#ifndef QDESIGNER_UILIB_EXPORT
+#    define QDESIGNER_UILIB_EXPORT
+#endif
+
+#ifdef QFORMINTERNAL_NAMESPACE
+namespace QFormInternal
+{
+#endif
+
+
+/*******************************************************************************
+** Forward declarations
+*/
+
+class DomUI;
+class DomIncludes;
+class DomInclude;
+class DomResources;
+class DomResource;
+class DomActionGroup;
+class DomAction;
+class DomActionRef;
+class DomImages;
+class DomImage;
+class DomImageData;
+class DomCustomWidgets;
+class DomHeader;
+class DomCustomWidget;
+class DomProperties;
+class DomPropertyData;
+class DomSizePolicyData;
+class DomLayoutDefault;
+class DomLayoutFunction;
+class DomTabStops;
+class DomLayout;
+class DomLayoutItem;
+class DomRow;
+class DomColumn;
+class DomItem;
+class DomWidget;
+class DomSpacer;
+class DomColor;
+class DomGradientStop;
+class DomGradient;
+class DomBrush;
+class DomColorRole;
+class DomColorGroup;
+class DomPalette;
+class DomFont;
+class DomPoint;
+class DomRect;
+class DomLocale;
+class DomSizePolicy;
+class DomSize;
+class DomDate;
+class DomTime;
+class DomDateTime;
+class DomStringList;
+class DomResourcePixmap;
+class DomResourceIcon;
+class DomString;
+class DomPointF;
+class DomRectF;
+class DomSizeF;
+class DomChar;
+class DomUrl;
+class DomProperty;
+class DomConnections;
+class DomConnection;
+class DomConnectionHints;
+class DomConnectionHint;
+class DomScript;
+class DomWidgetData;
+class DomDesignerData;
+class DomSlots;
+
+/*******************************************************************************
+** Declarations
+*/
+
+class QDESIGNER_UILIB_EXPORT DomUI {
+public:
+    DomUI();
+    ~DomUI();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    inline bool hasAttributeVersion() const { return m_has_attr_version; }
+    inline QString attributeVersion() const { return m_attr_version; }
+    inline void setAttributeVersion(const QString& a) { m_attr_version = a; m_has_attr_version = true; }
+    inline void clearAttributeVersion() { m_has_attr_version = false; }
+
+    inline bool hasAttributeLanguage() const { return m_has_attr_language; }
+    inline QString attributeLanguage() const { return m_attr_language; }
+    inline void setAttributeLanguage(const QString& a) { m_attr_language = a; m_has_attr_language = true; }
+    inline void clearAttributeLanguage() { m_has_attr_language = false; }
+
+    inline bool hasAttributeStdSetDef() const { return m_has_attr_stdSetDef; }
+    inline int attributeStdSetDef() const { return m_attr_stdSetDef; }
+    inline void setAttributeStdSetDef(int a) { m_attr_stdSetDef = a; m_has_attr_stdSetDef = true; }
+    inline void clearAttributeStdSetDef() { m_has_attr_stdSetDef = false; }
+
+    // child element accessors
+    inline QString elementAuthor() const { return m_author; }
+    void setElementAuthor(const QString& a);
+    inline bool hasElementAuthor() const { return m_children & Author; }
+    void clearElementAuthor();
+
+    inline QString elementComment() const { return m_comment; }
+    void setElementComment(const QString& a);
+    inline bool hasElementComment() const { return m_children & Comment; }
+    void clearElementComment();
+
+    inline QString elementExportMacro() const { return m_exportMacro; }
+    void setElementExportMacro(const QString& a);
+    inline bool hasElementExportMacro() const { return m_children & ExportMacro; }
+    void clearElementExportMacro();
+
+    inline QString elementClass() const { return m_class; }
+    void setElementClass(const QString& a);
+    inline bool hasElementClass() const { return m_children & Class; }
+    void clearElementClass();
+
+    inline DomWidget* elementWidget() const { return m_widget; }
+    void setElementWidget(DomWidget* a);
+    inline bool hasElementWidget() const { return m_children & Widget; }
+    void clearElementWidget();
+
+    inline DomLayoutDefault* elementLayoutDefault() const { return m_layoutDefault; }
+    void setElementLayoutDefault(DomLayoutDefault* a);
+    inline bool hasElementLayoutDefault() const { return m_children & LayoutDefault; }
+    void clearElementLayoutDefault();
+
+    inline DomLayoutFunction* elementLayoutFunction() const { return m_layoutFunction; }
+    void setElementLayoutFunction(DomLayoutFunction* a);
+    inline bool hasElementLayoutFunction() const { return m_children & LayoutFunction; }
+    void clearElementLayoutFunction();
+
+    inline QString elementPixmapFunction() const { return m_pixmapFunction; }
+    void setElementPixmapFunction(const QString& a);
+    inline bool hasElementPixmapFunction() const { return m_children & PixmapFunction; }
+    void clearElementPixmapFunction();
+
+    inline DomCustomWidgets* elementCustomWidgets() const { return m_customWidgets; }
+    void setElementCustomWidgets(DomCustomWidgets* a);
+    inline bool hasElementCustomWidgets() const { return m_children & CustomWidgets; }
+    void clearElementCustomWidgets();
+
+    inline DomTabStops* elementTabStops() const { return m_tabStops; }
+    void setElementTabStops(DomTabStops* a);
+    inline bool hasElementTabStops() const { return m_children & TabStops; }
+    void clearElementTabStops();
+
+    inline DomImages* elementImages() const { return m_images; }
+    void setElementImages(DomImages* a);
+    inline bool hasElementImages() const { return m_children & Images; }
+    void clearElementImages();
+
+    inline DomIncludes* elementIncludes() const { return m_includes; }
+    void setElementIncludes(DomIncludes* a);
+    inline bool hasElementIncludes() const { return m_children & Includes; }
+    void clearElementIncludes();
+
+    inline DomResources* elementResources() const { return m_resources; }
+    void setElementResources(DomResources* a);
+    inline bool hasElementResources() const { return m_children & Resources; }
+    void clearElementResources();
+
+    inline DomConnections* elementConnections() const { return m_connections; }
+    void setElementConnections(DomConnections* a);
+    inline bool hasElementConnections() const { return m_children & Connections; }
+    void clearElementConnections();
+
+    inline DomDesignerData* elementDesignerdata() const { return m_designerdata; }
+    void setElementDesignerdata(DomDesignerData* a);
+    inline bool hasElementDesignerdata() const { return m_children & Designerdata; }
+    void clearElementDesignerdata();
+
+    inline DomSlots* elementSlots() const { return m_slots; }
+    void setElementSlots(DomSlots* a);
+    inline bool hasElementSlots() const { return m_children & Slots; }
+    void clearElementSlots();
+
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    QString m_attr_version;
+    bool m_has_attr_version;
+
+    QString m_attr_language;
+    bool m_has_attr_language;
+
+    int m_attr_stdSetDef;
+    bool m_has_attr_stdSetDef;
+
+    // child element data
+    uint m_children;
+    QString m_author;
+    QString m_comment;
+    QString m_exportMacro;
+    QString m_class;
+    DomWidget* m_widget;
+    DomLayoutDefault* m_layoutDefault;
+    DomLayoutFunction* m_layoutFunction;
+    QString m_pixmapFunction;
+    DomCustomWidgets* m_customWidgets;
+    DomTabStops* m_tabStops;
+    DomImages* m_images;
+    DomIncludes* m_includes;
+    DomResources* m_resources;
+    DomConnections* m_connections;
+    DomDesignerData* m_designerdata;
+    DomSlots* m_slots;
+    enum Child {
+        Author = 1,
+        Comment = 2,
+        ExportMacro = 4,
+        Class = 8,
+        Widget = 16,
+        LayoutDefault = 32,
+        LayoutFunction = 64,
+        PixmapFunction = 128,
+        CustomWidgets = 256,
+        TabStops = 512,
+        Images = 1024,
+        Includes = 2048,
+        Resources = 4096,
+        Connections = 8192,
+        Designerdata = 16384,
+        Slots = 32768
+    };
+
+    DomUI(const DomUI &other);
+    void operator = (const DomUI&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomIncludes {
+public:
+    DomIncludes();
+    ~DomIncludes();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    // child element accessors
+    inline QList<DomInclude*> elementInclude() const { return m_include; }
+    void setElementInclude(const QList<DomInclude*>& a);
+
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    // child element data
+    QList<DomInclude*> m_include;
+
+    DomIncludes(const DomIncludes &other);
+    void operator = (const DomIncludes&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomInclude {
+public:
+    DomInclude();
+    ~DomInclude();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    inline bool hasAttributeLocation() const { return m_has_attr_location; }
+    inline QString attributeLocation() const { return m_attr_location; }
+    inline void setAttributeLocation(const QString& a) { m_attr_location = a; m_has_attr_location = true; }
+    inline void clearAttributeLocation() { m_has_attr_location = false; }
+
+    inline bool hasAttributeImpldecl() const { return m_has_attr_impldecl; }
+    inline QString attributeImpldecl() const { return m_attr_impldecl; }
+    inline void setAttributeImpldecl(const QString& a) { m_attr_impldecl = a; m_has_attr_impldecl = true; }
+    inline void clearAttributeImpldecl() { m_has_attr_impldecl = false; }
+
+    // child element accessors
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    QString m_attr_location;
+    bool m_has_attr_location;
+
+    QString m_attr_impldecl;
+    bool m_has_attr_impldecl;
+
+    // child element data
+
+    DomInclude(const DomInclude &other);
+    void operator = (const DomInclude&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomResources {
+public:
+    DomResources();
+    ~DomResources();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    inline bool hasAttributeName() const { return m_has_attr_name; }
+    inline QString attributeName() const { return m_attr_name; }
+    inline void setAttributeName(const QString& a) { m_attr_name = a; m_has_attr_name = true; }
+    inline void clearAttributeName() { m_has_attr_name = false; }
+
+    // child element accessors
+    inline QList<DomResource*> elementInclude() const { return m_include; }
+    void setElementInclude(const QList<DomResource*>& a);
+
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    QString m_attr_name;
+    bool m_has_attr_name;
+
+    // child element data
+    QList<DomResource*> m_include;
+
+    DomResources(const DomResources &other);
+    void operator = (const DomResources&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomResource {
+public:
+    DomResource();
+    ~DomResource();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    inline bool hasAttributeLocation() const { return m_has_attr_location; }
+    inline QString attributeLocation() const { return m_attr_location; }
+    inline void setAttributeLocation(const QString& a) { m_attr_location = a; m_has_attr_location = true; }
+    inline void clearAttributeLocation() { m_has_attr_location = false; }
+
+    // child element accessors
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    QString m_attr_location;
+    bool m_has_attr_location;
+
+    // child element data
+
+    DomResource(const DomResource &other);
+    void operator = (const DomResource&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomActionGroup {
+public:
+    DomActionGroup();
+    ~DomActionGroup();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    inline bool hasAttributeName() const { return m_has_attr_name; }
+    inline QString attributeName() const { return m_attr_name; }
+    inline void setAttributeName(const QString& a) { m_attr_name = a; m_has_attr_name = true; }
+    inline void clearAttributeName() { m_has_attr_name = false; }
+
+    // child element accessors
+    inline QList<DomAction*> elementAction() const { return m_action; }
+    void setElementAction(const QList<DomAction*>& a);
+
+    inline QList<DomActionGroup*> elementActionGroup() const { return m_actionGroup; }
+    void setElementActionGroup(const QList<DomActionGroup*>& a);
+
+    inline QList<DomProperty*> elementProperty() const { return m_property; }
+    void setElementProperty(const QList<DomProperty*>& a);
+
+    inline QList<DomProperty*> elementAttribute() const { return m_attribute; }
+    void setElementAttribute(const QList<DomProperty*>& a);
+
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    QString m_attr_name;
+    bool m_has_attr_name;
+
+    // child element data
+    QList<DomAction*> m_action;
+    QList<DomActionGroup*> m_actionGroup;
+    QList<DomProperty*> m_property;
+    QList<DomProperty*> m_attribute;
+
+    DomActionGroup(const DomActionGroup &other);
+    void operator = (const DomActionGroup&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomAction {
+public:
+    DomAction();
+    ~DomAction();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    inline bool hasAttributeName() const { return m_has_attr_name; }
+    inline QString attributeName() const { return m_attr_name; }
+    inline void setAttributeName(const QString& a) { m_attr_name = a; m_has_attr_name = true; }
+    inline void clearAttributeName() { m_has_attr_name = false; }
+
+    inline bool hasAttributeMenu() const { return m_has_attr_menu; }
+    inline QString attributeMenu() const { return m_attr_menu; }
+    inline void setAttributeMenu(const QString& a) { m_attr_menu = a; m_has_attr_menu = true; }
+    inline void clearAttributeMenu() { m_has_attr_menu = false; }
+
+    // child element accessors
+    inline QList<DomProperty*> elementProperty() const { return m_property; }
+    void setElementProperty(const QList<DomProperty*>& a);
+
+    inline QList<DomProperty*> elementAttribute() const { return m_attribute; }
+    void setElementAttribute(const QList<DomProperty*>& a);
+
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    QString m_attr_name;
+    bool m_has_attr_name;
+
+    QString m_attr_menu;
+    bool m_has_attr_menu;
+
+    // child element data
+    QList<DomProperty*> m_property;
+    QList<DomProperty*> m_attribute;
+
+    DomAction(const DomAction &other);
+    void operator = (const DomAction&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomActionRef {
+public:
+    DomActionRef();
+    ~DomActionRef();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    inline bool hasAttributeName() const { return m_has_attr_name; }
+    inline QString attributeName() const { return m_attr_name; }
+    inline void setAttributeName(const QString& a) { m_attr_name = a; m_has_attr_name = true; }
+    inline void clearAttributeName() { m_has_attr_name = false; }
+
+    // child element accessors
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    QString m_attr_name;
+    bool m_has_attr_name;
+
+    // child element data
+
+    DomActionRef(const DomActionRef &other);
+    void operator = (const DomActionRef&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomImages {
+public:
+    DomImages();
+    ~DomImages();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    // child element accessors
+    inline QList<DomImage*> elementImage() const { return m_image; }
+    void setElementImage(const QList<DomImage*>& a);
+
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    // child element data
+    QList<DomImage*> m_image;
+
+    DomImages(const DomImages &other);
+    void operator = (const DomImages&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomImage {
+public:
+    DomImage();
+    ~DomImage();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    inline bool hasAttributeName() const { return m_has_attr_name; }
+    inline QString attributeName() const { return m_attr_name; }
+    inline void setAttributeName(const QString& a) { m_attr_name = a; m_has_attr_name = true; }
+    inline void clearAttributeName() { m_has_attr_name = false; }
+
+    // child element accessors
+    inline DomImageData* elementData() const { return m_data; }
+    void setElementData(DomImageData* a);
+    inline bool hasElementData() const { return m_children & Data; }
+    void clearElementData();
+
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    QString m_attr_name;
+    bool m_has_attr_name;
+
+    // child element data
+    uint m_children;
+    DomImageData* m_data;
+    enum Child {
+        Data = 1
+    };
+
+    DomImage(const DomImage &other);
+    void operator = (const DomImage&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomImageData {
+public:
+    DomImageData();
+    ~DomImageData();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    inline bool hasAttributeFormat() const { return m_has_attr_format; }
+    inline QString attributeFormat() const { return m_attr_format; }
+    inline void setAttributeFormat(const QString& a) { m_attr_format = a; m_has_attr_format = true; }
+    inline void clearAttributeFormat() { m_has_attr_format = false; }
+
+    inline bool hasAttributeLength() const { return m_has_attr_length; }
+    inline int attributeLength() const { return m_attr_length; }
+    inline void setAttributeLength(int a) { m_attr_length = a; m_has_attr_length = true; }
+    inline void clearAttributeLength() { m_has_attr_length = false; }
+
+    // child element accessors
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    QString m_attr_format;
+    bool m_has_attr_format;
+
+    int m_attr_length;
+    bool m_has_attr_length;
+
+    // child element data
+
+    DomImageData(const DomImageData &other);
+    void operator = (const DomImageData&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomCustomWidgets {
+public:
+    DomCustomWidgets();
+    ~DomCustomWidgets();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    // child element accessors
+    inline QList<DomCustomWidget*> elementCustomWidget() const { return m_customWidget; }
+    void setElementCustomWidget(const QList<DomCustomWidget*>& a);
+
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    // child element data
+    QList<DomCustomWidget*> m_customWidget;
+
+    DomCustomWidgets(const DomCustomWidgets &other);
+    void operator = (const DomCustomWidgets&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomHeader {
+public:
+    DomHeader();
+    ~DomHeader();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    inline bool hasAttributeLocation() const { return m_has_attr_location; }
+    inline QString attributeLocation() const { return m_attr_location; }
+    inline void setAttributeLocation(const QString& a) { m_attr_location = a; m_has_attr_location = true; }
+    inline void clearAttributeLocation() { m_has_attr_location = false; }
+
+    // child element accessors
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    QString m_attr_location;
+    bool m_has_attr_location;
+
+    // child element data
+
+    DomHeader(const DomHeader &other);
+    void operator = (const DomHeader&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomCustomWidget {
+public:
+    DomCustomWidget();
+    ~DomCustomWidget();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    // child element accessors
+    inline QString elementClass() const { return m_class; }
+    void setElementClass(const QString& a);
+    inline bool hasElementClass() const { return m_children & Class; }
+    void clearElementClass();
+
+    inline QString elementExtends() const { return m_extends; }
+    void setElementExtends(const QString& a);
+    inline bool hasElementExtends() const { return m_children & Extends; }
+    void clearElementExtends();
+
+    inline DomHeader* elementHeader() const { return m_header; }
+    void setElementHeader(DomHeader* a);
+    inline bool hasElementHeader() const { return m_children & Header; }
+    void clearElementHeader();
+
+    inline DomSize* elementSizeHint() const { return m_sizeHint; }
+    void setElementSizeHint(DomSize* a);
+    inline bool hasElementSizeHint() const { return m_children & SizeHint; }
+    void clearElementSizeHint();
+
+    inline QString elementAddPageMethod() const { return m_addPageMethod; }
+    void setElementAddPageMethod(const QString& a);
+    inline bool hasElementAddPageMethod() const { return m_children & AddPageMethod; }
+    void clearElementAddPageMethod();
+
+    inline int elementContainer() const { return m_container; }
+    void setElementContainer(int a);
+    inline bool hasElementContainer() const { return m_children & Container; }
+    void clearElementContainer();
+
+    inline DomSizePolicyData* elementSizePolicy() const { return m_sizePolicy; }
+    void setElementSizePolicy(DomSizePolicyData* a);
+    inline bool hasElementSizePolicy() const { return m_children & SizePolicy; }
+    void clearElementSizePolicy();
+
+    inline QString elementPixmap() const { return m_pixmap; }
+    void setElementPixmap(const QString& a);
+    inline bool hasElementPixmap() const { return m_children & Pixmap; }
+    void clearElementPixmap();
+
+    inline DomScript* elementScript() const { return m_script; }
+    void setElementScript(DomScript* a);
+    inline bool hasElementScript() const { return m_children & Script; }
+    void clearElementScript();
+
+    inline DomProperties* elementProperties() const { return m_properties; }
+    void setElementProperties(DomProperties* a);
+    inline bool hasElementProperties() const { return m_children & Properties; }
+    void clearElementProperties();
+
+    inline DomSlots* elementSlots() const { return m_slots; }
+    void setElementSlots(DomSlots* a);
+    inline bool hasElementSlots() const { return m_children & Slots; }
+    void clearElementSlots();
+
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    // child element data
+    uint m_children;
+    QString m_class;
+    QString m_extends;
+    DomHeader* m_header;
+    DomSize* m_sizeHint;
+    QString m_addPageMethod;
+    int m_container;
+    DomSizePolicyData* m_sizePolicy;
+    QString m_pixmap;
+    DomScript* m_script;
+    DomProperties* m_properties;
+    DomSlots* m_slots;
+    enum Child {
+        Class = 1,
+        Extends = 2,
+        Header = 4,
+        SizeHint = 8,
+        AddPageMethod = 16,
+        Container = 32,
+        SizePolicy = 64,
+        Pixmap = 128,
+        Script = 256,
+        Properties = 512,
+        Slots = 1024
+    };
+
+    DomCustomWidget(const DomCustomWidget &other);
+    void operator = (const DomCustomWidget&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomProperties {
+public:
+    DomProperties();
+    ~DomProperties();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    // child element accessors
+    inline QList<DomPropertyData*> elementProperty() const { return m_property; }
+    void setElementProperty(const QList<DomPropertyData*>& a);
+
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    // child element data
+    QList<DomPropertyData*> m_property;
+
+    DomProperties(const DomProperties &other);
+    void operator = (const DomProperties&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomPropertyData {
+public:
+    DomPropertyData();
+    ~DomPropertyData();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    inline bool hasAttributeType() const { return m_has_attr_type; }
+    inline QString attributeType() const { return m_attr_type; }
+    inline void setAttributeType(const QString& a) { m_attr_type = a; m_has_attr_type = true; }
+    inline void clearAttributeType() { m_has_attr_type = false; }
+
+    // child element accessors
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    QString m_attr_type;
+    bool m_has_attr_type;
+
+    // child element data
+
+    DomPropertyData(const DomPropertyData &other);
+    void operator = (const DomPropertyData&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomSizePolicyData {
+public:
+    DomSizePolicyData();
+    ~DomSizePolicyData();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    // child element accessors
+    inline int elementHorData() const { return m_horData; }
+    void setElementHorData(int a);
+    inline bool hasElementHorData() const { return m_children & HorData; }
+    void clearElementHorData();
+
+    inline int elementVerData() const { return m_verData; }
+    void setElementVerData(int a);
+    inline bool hasElementVerData() const { return m_children & VerData; }
+    void clearElementVerData();
+
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    // child element data
+    uint m_children;
+    int m_horData;
+    int m_verData;
+    enum Child {
+        HorData = 1,
+        VerData = 2
+    };
+
+    DomSizePolicyData(const DomSizePolicyData &other);
+    void operator = (const DomSizePolicyData&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomLayoutDefault {
+public:
+    DomLayoutDefault();
+    ~DomLayoutDefault();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    inline bool hasAttributeSpacing() const { return m_has_attr_spacing; }
+    inline int attributeSpacing() const { return m_attr_spacing; }
+    inline void setAttributeSpacing(int a) { m_attr_spacing = a; m_has_attr_spacing = true; }
+    inline void clearAttributeSpacing() { m_has_attr_spacing = false; }
+
+    inline bool hasAttributeMargin() const { return m_has_attr_margin; }
+    inline int attributeMargin() const { return m_attr_margin; }
+    inline void setAttributeMargin(int a) { m_attr_margin = a; m_has_attr_margin = true; }
+    inline void clearAttributeMargin() { m_has_attr_margin = false; }
+
+    // child element accessors
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    int m_attr_spacing;
+    bool m_has_attr_spacing;
+
+    int m_attr_margin;
+    bool m_has_attr_margin;
+
+    // child element data
+
+    DomLayoutDefault(const DomLayoutDefault &other);
+    void operator = (const DomLayoutDefault&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomLayoutFunction {
+public:
+    DomLayoutFunction();
+    ~DomLayoutFunction();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    inline bool hasAttributeSpacing() const { return m_has_attr_spacing; }
+    inline QString attributeSpacing() const { return m_attr_spacing; }
+    inline void setAttributeSpacing(const QString& a) { m_attr_spacing = a; m_has_attr_spacing = true; }
+    inline void clearAttributeSpacing() { m_has_attr_spacing = false; }
+
+    inline bool hasAttributeMargin() const { return m_has_attr_margin; }
+    inline QString attributeMargin() const { return m_attr_margin; }
+    inline void setAttributeMargin(const QString& a) { m_attr_margin = a; m_has_attr_margin = true; }
+    inline void clearAttributeMargin() { m_has_attr_margin = false; }
+
+    // child element accessors
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    QString m_attr_spacing;
+    bool m_has_attr_spacing;
+
+    QString m_attr_margin;
+    bool m_has_attr_margin;
+
+    // child element data
+
+    DomLayoutFunction(const DomLayoutFunction &other);
+    void operator = (const DomLayoutFunction&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomTabStops {
+public:
+    DomTabStops();
+    ~DomTabStops();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    // child element accessors
+    inline QStringList elementTabStop() const { return m_tabStop; }
+    void setElementTabStop(const QStringList& a);
+
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    // child element data
+    QStringList m_tabStop;
+
+    DomTabStops(const DomTabStops &other);
+    void operator = (const DomTabStops&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomLayout {
+public:
+    DomLayout();
+    ~DomLayout();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    inline bool hasAttributeClass() const { return m_has_attr_class; }
+    inline QString attributeClass() const { return m_attr_class; }
+    inline void setAttributeClass(const QString& a) { m_attr_class = a; m_has_attr_class = true; }
+    inline void clearAttributeClass() { m_has_attr_class = false; }
+
+    inline bool hasAttributeName() const { return m_has_attr_name; }
+    inline QString attributeName() const { return m_attr_name; }
+    inline void setAttributeName(const QString& a) { m_attr_name = a; m_has_attr_name = true; }
+    inline void clearAttributeName() { m_has_attr_name = false; }
+
+    // child element accessors
+    inline QList<DomProperty*> elementProperty() const { return m_property; }
+    void setElementProperty(const QList<DomProperty*>& a);
+
+    inline QList<DomProperty*> elementAttribute() const { return m_attribute; }
+    void setElementAttribute(const QList<DomProperty*>& a);
+
+    inline QList<DomLayoutItem*> elementItem() const { return m_item; }
+    void setElementItem(const QList<DomLayoutItem*>& a);
+
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    QString m_attr_class;
+    bool m_has_attr_class;
+
+    QString m_attr_name;
+    bool m_has_attr_name;
+
+    // child element data
+    QList<DomProperty*> m_property;
+    QList<DomProperty*> m_attribute;
+    QList<DomLayoutItem*> m_item;
+
+    DomLayout(const DomLayout &other);
+    void operator = (const DomLayout&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomLayoutItem {
+public:
+    DomLayoutItem();
+    ~DomLayoutItem();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    inline bool hasAttributeRow() const { return m_has_attr_row; }
+    inline int attributeRow() const { return m_attr_row; }
+    inline void setAttributeRow(int a) { m_attr_row = a; m_has_attr_row = true; }
+    inline void clearAttributeRow() { m_has_attr_row = false; }
+
+    inline bool hasAttributeColumn() const { return m_has_attr_column; }
+    inline int attributeColumn() const { return m_attr_column; }
+    inline void setAttributeColumn(int a) { m_attr_column = a; m_has_attr_column = true; }
+    inline void clearAttributeColumn() { m_has_attr_column = false; }
+
+    inline bool hasAttributeRowSpan() const { return m_has_attr_rowSpan; }
+    inline int attributeRowSpan() const { return m_attr_rowSpan; }
+    inline void setAttributeRowSpan(int a) { m_attr_rowSpan = a; m_has_attr_rowSpan = true; }
+    inline void clearAttributeRowSpan() { m_has_attr_rowSpan = false; }
+
+    inline bool hasAttributeColSpan() const { return m_has_attr_colSpan; }
+    inline int attributeColSpan() const { return m_attr_colSpan; }
+    inline void setAttributeColSpan(int a) { m_attr_colSpan = a; m_has_attr_colSpan = true; }
+    inline void clearAttributeColSpan() { m_has_attr_colSpan = false; }
+
+    // child element accessors
+    enum Kind { Unknown = 0, Widget, Layout, Spacer };
+    inline Kind kind() const { return m_kind; }
+
+    inline DomWidget* elementWidget() const { return m_widget; }
+    void setElementWidget(DomWidget* a);
+
+    inline DomLayout* elementLayout() const { return m_layout; }
+    void setElementLayout(DomLayout* a);
+
+    inline DomSpacer* elementSpacer() const { return m_spacer; }
+    void setElementSpacer(DomSpacer* a);
+
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    int m_attr_row;
+    bool m_has_attr_row;
+
+    int m_attr_column;
+    bool m_has_attr_column;
+
+    int m_attr_rowSpan;
+    bool m_has_attr_rowSpan;
+
+    int m_attr_colSpan;
+    bool m_has_attr_colSpan;
+
+    // child element data
+    Kind m_kind;
+    DomWidget* m_widget;
+    DomLayout* m_layout;
+    DomSpacer* m_spacer;
+
+    DomLayoutItem(const DomLayoutItem &other);
+    void operator = (const DomLayoutItem&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomRow {
+public:
+    DomRow();
+    ~DomRow();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    // child element accessors
+    inline QList<DomProperty*> elementProperty() const { return m_property; }
+    void setElementProperty(const QList<DomProperty*>& a);
+
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    // child element data
+    QList<DomProperty*> m_property;
+
+    DomRow(const DomRow &other);
+    void operator = (const DomRow&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomColumn {
+public:
+    DomColumn();
+    ~DomColumn();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    // child element accessors
+    inline QList<DomProperty*> elementProperty() const { return m_property; }
+    void setElementProperty(const QList<DomProperty*>& a);
+
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    // child element data
+    QList<DomProperty*> m_property;
+
+    DomColumn(const DomColumn &other);
+    void operator = (const DomColumn&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomItem {
+public:
+    DomItem();
+    ~DomItem();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    inline bool hasAttributeRow() const { return m_has_attr_row; }
+    inline int attributeRow() const { return m_attr_row; }
+    inline void setAttributeRow(int a) { m_attr_row = a; m_has_attr_row = true; }
+    inline void clearAttributeRow() { m_has_attr_row = false; }
+
+    inline bool hasAttributeColumn() const { return m_has_attr_column; }
+    inline int attributeColumn() const { return m_attr_column; }
+    inline void setAttributeColumn(int a) { m_attr_column = a; m_has_attr_column = true; }
+    inline void clearAttributeColumn() { m_has_attr_column = false; }
+
+    // child element accessors
+    inline QList<DomProperty*> elementProperty() const { return m_property; }
+    void setElementProperty(const QList<DomProperty*>& a);
+
+    inline QList<DomItem*> elementItem() const { return m_item; }
+    void setElementItem(const QList<DomItem*>& a);
+
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    int m_attr_row;
+    bool m_has_attr_row;
+
+    int m_attr_column;
+    bool m_has_attr_column;
+
+    // child element data
+    QList<DomProperty*> m_property;
+    QList<DomItem*> m_item;
+
+    DomItem(const DomItem &other);
+    void operator = (const DomItem&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomWidget {
+public:
+    DomWidget();
+    ~DomWidget();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    inline bool hasAttributeClass() const { return m_has_attr_class; }
+    inline QString attributeClass() const { return m_attr_class; }
+    inline void setAttributeClass(const QString& a) { m_attr_class = a; m_has_attr_class = true; }
+    inline void clearAttributeClass() { m_has_attr_class = false; }
+
+    inline bool hasAttributeName() const { return m_has_attr_name; }
+    inline QString attributeName() const { return m_attr_name; }
+    inline void setAttributeName(const QString& a) { m_attr_name = a; m_has_attr_name = true; }
+    inline void clearAttributeName() { m_has_attr_name = false; }
+
+    inline bool hasAttributeNative() const { return m_has_attr_native; }
+    inline bool attributeNative() const { return m_attr_native; }
+    inline void setAttributeNative(bool a) { m_attr_native = a; m_has_attr_native = true; }
+    inline void clearAttributeNative() { m_has_attr_native = false; }
+
+    // child element accessors
+    inline QStringList elementClass() const { return m_class; }
+    void setElementClass(const QStringList& a);
+
+    inline QList<DomProperty*> elementProperty() const { return m_property; }
+    void setElementProperty(const QList<DomProperty*>& a);
+
+    inline QList<DomScript*> elementScript() const { return m_script; }
+    void setElementScript(const QList<DomScript*>& a);
+
+    inline QList<DomWidgetData*> elementWidgetData() const { return m_widgetData; }
+    void setElementWidgetData(const QList<DomWidgetData*>& a);
+
+    inline QList<DomProperty*> elementAttribute() const { return m_attribute; }
+    void setElementAttribute(const QList<DomProperty*>& a);
+
+    inline QList<DomRow*> elementRow() const { return m_row; }
+    void setElementRow(const QList<DomRow*>& a);
+
+    inline QList<DomColumn*> elementColumn() const { return m_column; }
+    void setElementColumn(const QList<DomColumn*>& a);
+
+    inline QList<DomItem*> elementItem() const { return m_item; }
+    void setElementItem(const QList<DomItem*>& a);
+
+    inline QList<DomLayout*> elementLayout() const { return m_layout; }
+    void setElementLayout(const QList<DomLayout*>& a);
+
+    inline QList<DomWidget*> elementWidget() const { return m_widget; }
+    void setElementWidget(const QList<DomWidget*>& a);
+
+    inline QList<DomAction*> elementAction() const { return m_action; }
+    void setElementAction(const QList<DomAction*>& a);
+
+    inline QList<DomActionGroup*> elementActionGroup() const { return m_actionGroup; }
+    void setElementActionGroup(const QList<DomActionGroup*>& a);
+
+    inline QList<DomActionRef*> elementAddAction() const { return m_addAction; }
+    void setElementAddAction(const QList<DomActionRef*>& a);
+
+    inline QStringList elementZOrder() const { return m_zOrder; }
+    void setElementZOrder(const QStringList& a);
+
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    QString m_attr_class;
+    bool m_has_attr_class;
+
+    QString m_attr_name;
+    bool m_has_attr_name;
+
+    bool m_attr_native;
+    bool m_has_attr_native;
+
+    // child element data
+    QStringList m_class;
+    QList<DomProperty*> m_property;
+    QList<DomScript*> m_script;
+    QList<DomWidgetData*> m_widgetData;
+    QList<DomProperty*> m_attribute;
+    QList<DomRow*> m_row;
+    QList<DomColumn*> m_column;
+    QList<DomItem*> m_item;
+    QList<DomLayout*> m_layout;
+    QList<DomWidget*> m_widget;
+    QList<DomAction*> m_action;
+    QList<DomActionGroup*> m_actionGroup;
+    QList<DomActionRef*> m_addAction;
+    QStringList m_zOrder;
+
+    DomWidget(const DomWidget &other);
+    void operator = (const DomWidget&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomSpacer {
+public:
+    DomSpacer();
+    ~DomSpacer();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    inline bool hasAttributeName() const { return m_has_attr_name; }
+    inline QString attributeName() const { return m_attr_name; }
+    inline void setAttributeName(const QString& a) { m_attr_name = a; m_has_attr_name = true; }
+    inline void clearAttributeName() { m_has_attr_name = false; }
+
+    // child element accessors
+    inline QList<DomProperty*> elementProperty() const { return m_property; }
+    void setElementProperty(const QList<DomProperty*>& a);
+
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    QString m_attr_name;
+    bool m_has_attr_name;
+
+    // child element data
+    QList<DomProperty*> m_property;
+
+    DomSpacer(const DomSpacer &other);
+    void operator = (const DomSpacer&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomColor {
+public:
+    DomColor();
+    ~DomColor();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    inline bool hasAttributeAlpha() const { return m_has_attr_alpha; }
+    inline int attributeAlpha() const { return m_attr_alpha; }
+    inline void setAttributeAlpha(int a) { m_attr_alpha = a; m_has_attr_alpha = true; }
+    inline void clearAttributeAlpha() { m_has_attr_alpha = false; }
+
+    // child element accessors
+    inline int elementRed() const { return m_red; }
+    void setElementRed(int a);
+    inline bool hasElementRed() const { return m_children & Red; }
+    void clearElementRed();
+
+    inline int elementGreen() const { return m_green; }
+    void setElementGreen(int a);
+    inline bool hasElementGreen() const { return m_children & Green; }
+    void clearElementGreen();
+
+    inline int elementBlue() const { return m_blue; }
+    void setElementBlue(int a);
+    inline bool hasElementBlue() const { return m_children & Blue; }
+    void clearElementBlue();
+
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    int m_attr_alpha;
+    bool m_has_attr_alpha;
+
+    // child element data
+    uint m_children;
+    int m_red;
+    int m_green;
+    int m_blue;
+    enum Child {
+        Red = 1,
+        Green = 2,
+        Blue = 4
+    };
+
+    DomColor(const DomColor &other);
+    void operator = (const DomColor&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomGradientStop {
+public:
+    DomGradientStop();
+    ~DomGradientStop();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    inline bool hasAttributePosition() const { return m_has_attr_position; }
+    inline double attributePosition() const { return m_attr_position; }
+    inline void setAttributePosition(double a) { m_attr_position = a; m_has_attr_position = true; }
+    inline void clearAttributePosition() { m_has_attr_position = false; }
+
+    // child element accessors
+    inline DomColor* elementColor() const { return m_color; }
+    void setElementColor(DomColor* a);
+    inline bool hasElementColor() const { return m_children & Color; }
+    void clearElementColor();
+
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    double m_attr_position;
+    bool m_has_attr_position;
+
+    // child element data
+    uint m_children;
+    DomColor* m_color;
+    enum Child {
+        Color = 1
+    };
+
+    DomGradientStop(const DomGradientStop &other);
+    void operator = (const DomGradientStop&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomGradient {
+public:
+    DomGradient();
+    ~DomGradient();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    inline bool hasAttributeStartX() const { return m_has_attr_startX; }
+    inline double attributeStartX() const { return m_attr_startX; }
+    inline void setAttributeStartX(double a) { m_attr_startX = a; m_has_attr_startX = true; }
+    inline void clearAttributeStartX() { m_has_attr_startX = false; }
+
+    inline bool hasAttributeStartY() const { return m_has_attr_startY; }
+    inline double attributeStartY() const { return m_attr_startY; }
+    inline void setAttributeStartY(double a) { m_attr_startY = a; m_has_attr_startY = true; }
+    inline void clearAttributeStartY() { m_has_attr_startY = false; }
+
+    inline bool hasAttributeEndX() const { return m_has_attr_endX; }
+    inline double attributeEndX() const { return m_attr_endX; }
+    inline void setAttributeEndX(double a) { m_attr_endX = a; m_has_attr_endX = true; }
+    inline void clearAttributeEndX() { m_has_attr_endX = false; }
+
+    inline bool hasAttributeEndY() const { return m_has_attr_endY; }
+    inline double attributeEndY() const { return m_attr_endY; }
+    inline void setAttributeEndY(double a) { m_attr_endY = a; m_has_attr_endY = true; }
+    inline void clearAttributeEndY() { m_has_attr_endY = false; }
+
+    inline bool hasAttributeCentralX() const { return m_has_attr_centralX; }
+    inline double attributeCentralX() const { return m_attr_centralX; }
+    inline void setAttributeCentralX(double a) { m_attr_centralX = a; m_has_attr_centralX = true; }
+    inline void clearAttributeCentralX() { m_has_attr_centralX = false; }
+
+    inline bool hasAttributeCentralY() const { return m_has_attr_centralY; }
+    inline double attributeCentralY() const { return m_attr_centralY; }
+    inline void setAttributeCentralY(double a) { m_attr_centralY = a; m_has_attr_centralY = true; }
+    inline void clearAttributeCentralY() { m_has_attr_centralY = false; }
+
+    inline bool hasAttributeFocalX() const { return m_has_attr_focalX; }
+    inline double attributeFocalX() const { return m_attr_focalX; }
+    inline void setAttributeFocalX(double a) { m_attr_focalX = a; m_has_attr_focalX = true; }
+    inline void clearAttributeFocalX() { m_has_attr_focalX = false; }
+
+    inline bool hasAttributeFocalY() const { return m_has_attr_focalY; }
+    inline double attributeFocalY() const { return m_attr_focalY; }
+    inline void setAttributeFocalY(double a) { m_attr_focalY = a; m_has_attr_focalY = true; }
+    inline void clearAttributeFocalY() { m_has_attr_focalY = false; }
+
+    inline bool hasAttributeRadius() const { return m_has_attr_radius; }
+    inline double attributeRadius() const { return m_attr_radius; }
+    inline void setAttributeRadius(double a) { m_attr_radius = a; m_has_attr_radius = true; }
+    inline void clearAttributeRadius() { m_has_attr_radius = false; }
+
+    inline bool hasAttributeAngle() const { return m_has_attr_angle; }
+    inline double attributeAngle() const { return m_attr_angle; }
+    inline void setAttributeAngle(double a) { m_attr_angle = a; m_has_attr_angle = true; }
+    inline void clearAttributeAngle() { m_has_attr_angle = false; }
+
+    inline bool hasAttributeType() const { return m_has_attr_type; }
+    inline QString attributeType() const { return m_attr_type; }
+    inline void setAttributeType(const QString& a) { m_attr_type = a; m_has_attr_type = true; }
+    inline void clearAttributeType() { m_has_attr_type = false; }
+
+    inline bool hasAttributeSpread() const { return m_has_attr_spread; }
+    inline QString attributeSpread() const { return m_attr_spread; }
+    inline void setAttributeSpread(const QString& a) { m_attr_spread = a; m_has_attr_spread = true; }
+    inline void clearAttributeSpread() { m_has_attr_spread = false; }
+
+    inline bool hasAttributeCoordinateMode() const { return m_has_attr_coordinateMode; }
+    inline QString attributeCoordinateMode() const { return m_attr_coordinateMode; }
+    inline void setAttributeCoordinateMode(const QString& a) { m_attr_coordinateMode = a; m_has_attr_coordinateMode = true; }
+    inline void clearAttributeCoordinateMode() { m_has_attr_coordinateMode = false; }
+
+    // child element accessors
+    inline QList<DomGradientStop*> elementGradientStop() const { return m_gradientStop; }
+    void setElementGradientStop(const QList<DomGradientStop*>& a);
+
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    double m_attr_startX;
+    bool m_has_attr_startX;
+
+    double m_attr_startY;
+    bool m_has_attr_startY;
+
+    double m_attr_endX;
+    bool m_has_attr_endX;
+
+    double m_attr_endY;
+    bool m_has_attr_endY;
+
+    double m_attr_centralX;
+    bool m_has_attr_centralX;
+
+    double m_attr_centralY;
+    bool m_has_attr_centralY;
+
+    double m_attr_focalX;
+    bool m_has_attr_focalX;
+
+    double m_attr_focalY;
+    bool m_has_attr_focalY;
+
+    double m_attr_radius;
+    bool m_has_attr_radius;
+
+    double m_attr_angle;
+    bool m_has_attr_angle;
+
+    QString m_attr_type;
+    bool m_has_attr_type;
+
+    QString m_attr_spread;
+    bool m_has_attr_spread;
+
+    QString m_attr_coordinateMode;
+    bool m_has_attr_coordinateMode;
+
+    // child element data
+    QList<DomGradientStop*> m_gradientStop;
+
+    DomGradient(const DomGradient &other);
+    void operator = (const DomGradient&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomBrush {
+public:
+    DomBrush();
+    ~DomBrush();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    inline bool hasAttributeBrushStyle() const { return m_has_attr_brushStyle; }
+    inline QString attributeBrushStyle() const { return m_attr_brushStyle; }
+    inline void setAttributeBrushStyle(const QString& a) { m_attr_brushStyle = a; m_has_attr_brushStyle = true; }
+    inline void clearAttributeBrushStyle() { m_has_attr_brushStyle = false; }
+
+    // child element accessors
+    enum Kind { Unknown = 0, Color, Texture, Gradient };
+    inline Kind kind() const { return m_kind; }
+
+    inline DomColor* elementColor() const { return m_color; }
+    void setElementColor(DomColor* a);
+
+    inline DomProperty* elementTexture() const { return m_texture; }
+    void setElementTexture(DomProperty* a);
+
+    inline DomGradient* elementGradient() const { return m_gradient; }
+    void setElementGradient(DomGradient* a);
+
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    QString m_attr_brushStyle;
+    bool m_has_attr_brushStyle;
+
+    // child element data
+    Kind m_kind;
+    DomColor* m_color;
+    DomProperty* m_texture;
+    DomGradient* m_gradient;
+
+    DomBrush(const DomBrush &other);
+    void operator = (const DomBrush&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomColorRole {
+public:
+    DomColorRole();
+    ~DomColorRole();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    inline bool hasAttributeRole() const { return m_has_attr_role; }
+    inline QString attributeRole() const { return m_attr_role; }
+    inline void setAttributeRole(const QString& a) { m_attr_role = a; m_has_attr_role = true; }
+    inline void clearAttributeRole() { m_has_attr_role = false; }
+
+    // child element accessors
+    inline DomBrush* elementBrush() const { return m_brush; }
+    void setElementBrush(DomBrush* a);
+    inline bool hasElementBrush() const { return m_children & Brush; }
+    void clearElementBrush();
+
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    QString m_attr_role;
+    bool m_has_attr_role;
+
+    // child element data
+    uint m_children;
+    DomBrush* m_brush;
+    enum Child {
+        Brush = 1
+    };
+
+    DomColorRole(const DomColorRole &other);
+    void operator = (const DomColorRole&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomColorGroup {
+public:
+    DomColorGroup();
+    ~DomColorGroup();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    // child element accessors
+    inline QList<DomColorRole*> elementColorRole() const { return m_colorRole; }
+    void setElementColorRole(const QList<DomColorRole*>& a);
+
+    inline QList<DomColor*> elementColor() const { return m_color; }
+    void setElementColor(const QList<DomColor*>& a);
+
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    // child element data
+    QList<DomColorRole*> m_colorRole;
+    QList<DomColor*> m_color;
+
+    DomColorGroup(const DomColorGroup &other);
+    void operator = (const DomColorGroup&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomPalette {
+public:
+    DomPalette();
+    ~DomPalette();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    // child element accessors
+    inline DomColorGroup* elementActive() const { return m_active; }
+    void setElementActive(DomColorGroup* a);
+    inline bool hasElementActive() const { return m_children & Active; }
+    void clearElementActive();
+
+    inline DomColorGroup* elementInactive() const { return m_inactive; }
+    void setElementInactive(DomColorGroup* a);
+    inline bool hasElementInactive() const { return m_children & Inactive; }
+    void clearElementInactive();
+
+    inline DomColorGroup* elementDisabled() const { return m_disabled; }
+    void setElementDisabled(DomColorGroup* a);
+    inline bool hasElementDisabled() const { return m_children & Disabled; }
+    void clearElementDisabled();
+
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    // child element data
+    uint m_children;
+    DomColorGroup* m_active;
+    DomColorGroup* m_inactive;
+    DomColorGroup* m_disabled;
+    enum Child {
+        Active = 1,
+        Inactive = 2,
+        Disabled = 4
+    };
+
+    DomPalette(const DomPalette &other);
+    void operator = (const DomPalette&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomFont {
+public:
+    DomFont();
+    ~DomFont();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    // child element accessors
+    inline QString elementFamily() const { return m_family; }
+    void setElementFamily(const QString& a);
+    inline bool hasElementFamily() const { return m_children & Family; }
+    void clearElementFamily();
+
+    inline int elementPointSize() const { return m_pointSize; }
+    void setElementPointSize(int a);
+    inline bool hasElementPointSize() const { return m_children & PointSize; }
+    void clearElementPointSize();
+
+    inline int elementWeight() const { return m_weight; }
+    void setElementWeight(int a);
+    inline bool hasElementWeight() const { return m_children & Weight; }
+    void clearElementWeight();
+
+    inline bool elementItalic() const { return m_italic; }
+    void setElementItalic(bool a);
+    inline bool hasElementItalic() const { return m_children & Italic; }
+    void clearElementItalic();
+
+    inline bool elementBold() const { return m_bold; }
+    void setElementBold(bool a);
+    inline bool hasElementBold() const { return m_children & Bold; }
+    void clearElementBold();
+
+    inline bool elementUnderline() const { return m_underline; }
+    void setElementUnderline(bool a);
+    inline bool hasElementUnderline() const { return m_children & Underline; }
+    void clearElementUnderline();
+
+    inline bool elementStrikeOut() const { return m_strikeOut; }
+    void setElementStrikeOut(bool a);
+    inline bool hasElementStrikeOut() const { return m_children & StrikeOut; }
+    void clearElementStrikeOut();
+
+    inline bool elementAntialiasing() const { return m_antialiasing; }
+    void setElementAntialiasing(bool a);
+    inline bool hasElementAntialiasing() const { return m_children & Antialiasing; }
+    void clearElementAntialiasing();
+
+    inline QString elementStyleStrategy() const { return m_styleStrategy; }
+    void setElementStyleStrategy(const QString& a);
+    inline bool hasElementStyleStrategy() const { return m_children & StyleStrategy; }
+    void clearElementStyleStrategy();
+
+    inline bool elementKerning() const { return m_kerning; }
+    void setElementKerning(bool a);
+    inline bool hasElementKerning() const { return m_children & Kerning; }
+    void clearElementKerning();
+
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    // child element data
+    uint m_children;
+    QString m_family;
+    int m_pointSize;
+    int m_weight;
+    bool m_italic;
+    bool m_bold;
+    bool m_underline;
+    bool m_strikeOut;
+    bool m_antialiasing;
+    QString m_styleStrategy;
+    bool m_kerning;
+    enum Child {
+        Family = 1,
+        PointSize = 2,
+        Weight = 4,
+        Italic = 8,
+        Bold = 16,
+        Underline = 32,
+        StrikeOut = 64,
+        Antialiasing = 128,
+        StyleStrategy = 256,
+        Kerning = 512
+    };
+
+    DomFont(const DomFont &other);
+    void operator = (const DomFont&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomPoint {
+public:
+    DomPoint();
+    ~DomPoint();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    // child element accessors
+    inline int elementX() const { return m_x; }
+    void setElementX(int a);
+    inline bool hasElementX() const { return m_children & X; }
+    void clearElementX();
+
+    inline int elementY() const { return m_y; }
+    void setElementY(int a);
+    inline bool hasElementY() const { return m_children & Y; }
+    void clearElementY();
+
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    // child element data
+    uint m_children;
+    int m_x;
+    int m_y;
+    enum Child {
+        X = 1,
+        Y = 2
+    };
+
+    DomPoint(const DomPoint &other);
+    void operator = (const DomPoint&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomRect {
+public:
+    DomRect();
+    ~DomRect();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    // child element accessors
+    inline int elementX() const { return m_x; }
+    void setElementX(int a);
+    inline bool hasElementX() const { return m_children & X; }
+    void clearElementX();
+
+    inline int elementY() const { return m_y; }
+    void setElementY(int a);
+    inline bool hasElementY() const { return m_children & Y; }
+    void clearElementY();
+
+    inline int elementWidth() const { return m_width; }
+    void setElementWidth(int a);
+    inline bool hasElementWidth() const { return m_children & Width; }
+    void clearElementWidth();
+
+    inline int elementHeight() const { return m_height; }
+    void setElementHeight(int a);
+    inline bool hasElementHeight() const { return m_children & Height; }
+    void clearElementHeight();
+
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    // child element data
+    uint m_children;
+    int m_x;
+    int m_y;
+    int m_width;
+    int m_height;
+    enum Child {
+        X = 1,
+        Y = 2,
+        Width = 4,
+        Height = 8
+    };
+
+    DomRect(const DomRect &other);
+    void operator = (const DomRect&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomLocale {
+public:
+    DomLocale();
+    ~DomLocale();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    inline bool hasAttributeLanguage() const { return m_has_attr_language; }
+    inline QString attributeLanguage() const { return m_attr_language; }
+    inline void setAttributeLanguage(const QString& a) { m_attr_language = a; m_has_attr_language = true; }
+    inline void clearAttributeLanguage() { m_has_attr_language = false; }
+
+    inline bool hasAttributeCountry() const { return m_has_attr_country; }
+    inline QString attributeCountry() const { return m_attr_country; }
+    inline void setAttributeCountry(const QString& a) { m_attr_country = a; m_has_attr_country = true; }
+    inline void clearAttributeCountry() { m_has_attr_country = false; }
+
+    // child element accessors
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    QString m_attr_language;
+    bool m_has_attr_language;
+
+    QString m_attr_country;
+    bool m_has_attr_country;
+
+    // child element data
+
+    DomLocale(const DomLocale &other);
+    void operator = (const DomLocale&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomSizePolicy {
+public:
+    DomSizePolicy();
+    ~DomSizePolicy();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    inline bool hasAttributeHSizeType() const { return m_has_attr_hSizeType; }
+    inline QString attributeHSizeType() const { return m_attr_hSizeType; }
+    inline void setAttributeHSizeType(const QString& a) { m_attr_hSizeType = a; m_has_attr_hSizeType = true; }
+    inline void clearAttributeHSizeType() { m_has_attr_hSizeType = false; }
+
+    inline bool hasAttributeVSizeType() const { return m_has_attr_vSizeType; }
+    inline QString attributeVSizeType() const { return m_attr_vSizeType; }
+    inline void setAttributeVSizeType(const QString& a) { m_attr_vSizeType = a; m_has_attr_vSizeType = true; }
+    inline void clearAttributeVSizeType() { m_has_attr_vSizeType = false; }
+
+    // child element accessors
+    inline int elementHSizeType() const { return m_hSizeType; }
+    void setElementHSizeType(int a);
+    inline bool hasElementHSizeType() const { return m_children & HSizeType; }
+    void clearElementHSizeType();
+
+    inline int elementVSizeType() const { return m_vSizeType; }
+    void setElementVSizeType(int a);
+    inline bool hasElementVSizeType() const { return m_children & VSizeType; }
+    void clearElementVSizeType();
+
+    inline int elementHorStretch() const { return m_horStretch; }
+    void setElementHorStretch(int a);
+    inline bool hasElementHorStretch() const { return m_children & HorStretch; }
+    void clearElementHorStretch();
+
+    inline int elementVerStretch() const { return m_verStretch; }
+    void setElementVerStretch(int a);
+    inline bool hasElementVerStretch() const { return m_children & VerStretch; }
+    void clearElementVerStretch();
+
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    QString m_attr_hSizeType;
+    bool m_has_attr_hSizeType;
+
+    QString m_attr_vSizeType;
+    bool m_has_attr_vSizeType;
+
+    // child element data
+    uint m_children;
+    int m_hSizeType;
+    int m_vSizeType;
+    int m_horStretch;
+    int m_verStretch;
+    enum Child {
+        HSizeType = 1,
+        VSizeType = 2,
+        HorStretch = 4,
+        VerStretch = 8
+    };
+
+    DomSizePolicy(const DomSizePolicy &other);
+    void operator = (const DomSizePolicy&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomSize {
+public:
+    DomSize();
+    ~DomSize();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    // child element accessors
+    inline int elementWidth() const { return m_width; }
+    void setElementWidth(int a);
+    inline bool hasElementWidth() const { return m_children & Width; }
+    void clearElementWidth();
+
+    inline int elementHeight() const { return m_height; }
+    void setElementHeight(int a);
+    inline bool hasElementHeight() const { return m_children & Height; }
+    void clearElementHeight();
+
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    // child element data
+    uint m_children;
+    int m_width;
+    int m_height;
+    enum Child {
+        Width = 1,
+        Height = 2
+    };
+
+    DomSize(const DomSize &other);
+    void operator = (const DomSize&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomDate {
+public:
+    DomDate();
+    ~DomDate();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    // child element accessors
+    inline int elementYear() const { return m_year; }
+    void setElementYear(int a);
+    inline bool hasElementYear() const { return m_children & Year; }
+    void clearElementYear();
+
+    inline int elementMonth() const { return m_month; }
+    void setElementMonth(int a);
+    inline bool hasElementMonth() const { return m_children & Month; }
+    void clearElementMonth();
+
+    inline int elementDay() const { return m_day; }
+    void setElementDay(int a);
+    inline bool hasElementDay() const { return m_children & Day; }
+    void clearElementDay();
+
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    // child element data
+    uint m_children;
+    int m_year;
+    int m_month;
+    int m_day;
+    enum Child {
+        Year = 1,
+        Month = 2,
+        Day = 4
+    };
+
+    DomDate(const DomDate &other);
+    void operator = (const DomDate&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomTime {
+public:
+    DomTime();
+    ~DomTime();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    // child element accessors
+    inline int elementHour() const { return m_hour; }
+    void setElementHour(int a);
+    inline bool hasElementHour() const { return m_children & Hour; }
+    void clearElementHour();
+
+    inline int elementMinute() const { return m_minute; }
+    void setElementMinute(int a);
+    inline bool hasElementMinute() const { return m_children & Minute; }
+    void clearElementMinute();
+
+    inline int elementSecond() const { return m_second; }
+    void setElementSecond(int a);
+    inline bool hasElementSecond() const { return m_children & Second; }
+    void clearElementSecond();
+
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    // child element data
+    uint m_children;
+    int m_hour;
+    int m_minute;
+    int m_second;
+    enum Child {
+        Hour = 1,
+        Minute = 2,
+        Second = 4
+    };
+
+    DomTime(const DomTime &other);
+    void operator = (const DomTime&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomDateTime {
+public:
+    DomDateTime();
+    ~DomDateTime();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    // child element accessors
+    inline int elementHour() const { return m_hour; }
+    void setElementHour(int a);
+    inline bool hasElementHour() const { return m_children & Hour; }
+    void clearElementHour();
+
+    inline int elementMinute() const { return m_minute; }
+    void setElementMinute(int a);
+    inline bool hasElementMinute() const { return m_children & Minute; }
+    void clearElementMinute();
+
+    inline int elementSecond() const { return m_second; }
+    void setElementSecond(int a);
+    inline bool hasElementSecond() const { return m_children & Second; }
+    void clearElementSecond();
+
+    inline int elementYear() const { return m_year; }
+    void setElementYear(int a);
+    inline bool hasElementYear() const { return m_children & Year; }
+    void clearElementYear();
+
+    inline int elementMonth() const { return m_month; }
+    void setElementMonth(int a);
+    inline bool hasElementMonth() const { return m_children & Month; }
+    void clearElementMonth();
+
+    inline int elementDay() const { return m_day; }
+    void setElementDay(int a);
+    inline bool hasElementDay() const { return m_children & Day; }
+    void clearElementDay();
+
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    // child element data
+    uint m_children;
+    int m_hour;
+    int m_minute;
+    int m_second;
+    int m_year;
+    int m_month;
+    int m_day;
+    enum Child {
+        Hour = 1,
+        Minute = 2,
+        Second = 4,
+        Year = 8,
+        Month = 16,
+        Day = 32
+    };
+
+    DomDateTime(const DomDateTime &other);
+    void operator = (const DomDateTime&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomStringList {
+public:
+    DomStringList();
+    ~DomStringList();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    // child element accessors
+    inline QStringList elementString() const { return m_string; }
+    void setElementString(const QStringList& a);
+
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    // child element data
+    QStringList m_string;
+
+    DomStringList(const DomStringList &other);
+    void operator = (const DomStringList&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomResourcePixmap {
+public:
+    DomResourcePixmap();
+    ~DomResourcePixmap();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    inline bool hasAttributeResource() const { return m_has_attr_resource; }
+    inline QString attributeResource() const { return m_attr_resource; }
+    inline void setAttributeResource(const QString& a) { m_attr_resource = a; m_has_attr_resource = true; }
+    inline void clearAttributeResource() { m_has_attr_resource = false; }
+
+    inline bool hasAttributeAlias() const { return m_has_attr_alias; }
+    inline QString attributeAlias() const { return m_attr_alias; }
+    inline void setAttributeAlias(const QString& a) { m_attr_alias = a; m_has_attr_alias = true; }
+    inline void clearAttributeAlias() { m_has_attr_alias = false; }
+
+    // child element accessors
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    QString m_attr_resource;
+    bool m_has_attr_resource;
+
+    QString m_attr_alias;
+    bool m_has_attr_alias;
+
+    // child element data
+
+    DomResourcePixmap(const DomResourcePixmap &other);
+    void operator = (const DomResourcePixmap&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomResourceIcon {
+public:
+    DomResourceIcon();
+    ~DomResourceIcon();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    inline bool hasAttributeResource() const { return m_has_attr_resource; }
+    inline QString attributeResource() const { return m_attr_resource; }
+    inline void setAttributeResource(const QString& a) { m_attr_resource = a; m_has_attr_resource = true; }
+    inline void clearAttributeResource() { m_has_attr_resource = false; }
+
+    // child element accessors
+    inline DomResourcePixmap* elementNormalOff() const { return m_normalOff; }
+    void setElementNormalOff(DomResourcePixmap* a);
+    inline bool hasElementNormalOff() const { return m_children & NormalOff; }
+    void clearElementNormalOff();
+
+    inline DomResourcePixmap* elementNormalOn() const { return m_normalOn; }
+    void setElementNormalOn(DomResourcePixmap* a);
+    inline bool hasElementNormalOn() const { return m_children & NormalOn; }
+    void clearElementNormalOn();
+
+    inline DomResourcePixmap* elementDisabledOff() const { return m_disabledOff; }
+    void setElementDisabledOff(DomResourcePixmap* a);
+    inline bool hasElementDisabledOff() const { return m_children & DisabledOff; }
+    void clearElementDisabledOff();
+
+    inline DomResourcePixmap* elementDisabledOn() const { return m_disabledOn; }
+    void setElementDisabledOn(DomResourcePixmap* a);
+    inline bool hasElementDisabledOn() const { return m_children & DisabledOn; }
+    void clearElementDisabledOn();
+
+    inline DomResourcePixmap* elementActiveOff() const { return m_activeOff; }
+    void setElementActiveOff(DomResourcePixmap* a);
+    inline bool hasElementActiveOff() const { return m_children & ActiveOff; }
+    void clearElementActiveOff();
+
+    inline DomResourcePixmap* elementActiveOn() const { return m_activeOn; }
+    void setElementActiveOn(DomResourcePixmap* a);
+    inline bool hasElementActiveOn() const { return m_children & ActiveOn; }
+    void clearElementActiveOn();
+
+    inline DomResourcePixmap* elementSelectedOff() const { return m_selectedOff; }
+    void setElementSelectedOff(DomResourcePixmap* a);
+    inline bool hasElementSelectedOff() const { return m_children & SelectedOff; }
+    void clearElementSelectedOff();
+
+    inline DomResourcePixmap* elementSelectedOn() const { return m_selectedOn; }
+    void setElementSelectedOn(DomResourcePixmap* a);
+    inline bool hasElementSelectedOn() const { return m_children & SelectedOn; }
+    void clearElementSelectedOn();
+
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    QString m_attr_resource;
+    bool m_has_attr_resource;
+
+    // child element data
+    uint m_children;
+    DomResourcePixmap* m_normalOff;
+    DomResourcePixmap* m_normalOn;
+    DomResourcePixmap* m_disabledOff;
+    DomResourcePixmap* m_disabledOn;
+    DomResourcePixmap* m_activeOff;
+    DomResourcePixmap* m_activeOn;
+    DomResourcePixmap* m_selectedOff;
+    DomResourcePixmap* m_selectedOn;
+    enum Child {
+        NormalOff = 1,
+        NormalOn = 2,
+        DisabledOff = 4,
+        DisabledOn = 8,
+        ActiveOff = 16,
+        ActiveOn = 32,
+        SelectedOff = 64,
+        SelectedOn = 128
+    };
+
+    DomResourceIcon(const DomResourceIcon &other);
+    void operator = (const DomResourceIcon&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomString {
+public:
+    DomString();
+    ~DomString();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    inline bool hasAttributeNotr() const { return m_has_attr_notr; }
+    inline QString attributeNotr() const { return m_attr_notr; }
+    inline void setAttributeNotr(const QString& a) { m_attr_notr = a; m_has_attr_notr = true; }
+    inline void clearAttributeNotr() { m_has_attr_notr = false; }
+
+    inline bool hasAttributeComment() const { return m_has_attr_comment; }
+    inline QString attributeComment() const { return m_attr_comment; }
+    inline void setAttributeComment(const QString& a) { m_attr_comment = a; m_has_attr_comment = true; }
+    inline void clearAttributeComment() { m_has_attr_comment = false; }
+
+    // child element accessors
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    QString m_attr_notr;
+    bool m_has_attr_notr;
+
+    QString m_attr_comment;
+    bool m_has_attr_comment;
+
+    // child element data
+
+    DomString(const DomString &other);
+    void operator = (const DomString&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomPointF {
+public:
+    DomPointF();
+    ~DomPointF();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    // child element accessors
+    inline double elementX() const { return m_x; }
+    void setElementX(double a);
+    inline bool hasElementX() const { return m_children & X; }
+    void clearElementX();
+
+    inline double elementY() const { return m_y; }
+    void setElementY(double a);
+    inline bool hasElementY() const { return m_children & Y; }
+    void clearElementY();
+
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    // child element data
+    uint m_children;
+    double m_x;
+    double m_y;
+    enum Child {
+        X = 1,
+        Y = 2
+    };
+
+    DomPointF(const DomPointF &other);
+    void operator = (const DomPointF&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomRectF {
+public:
+    DomRectF();
+    ~DomRectF();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    // child element accessors
+    inline double elementX() const { return m_x; }
+    void setElementX(double a);
+    inline bool hasElementX() const { return m_children & X; }
+    void clearElementX();
+
+    inline double elementY() const { return m_y; }
+    void setElementY(double a);
+    inline bool hasElementY() const { return m_children & Y; }
+    void clearElementY();
+
+    inline double elementWidth() const { return m_width; }
+    void setElementWidth(double a);
+    inline bool hasElementWidth() const { return m_children & Width; }
+    void clearElementWidth();
+
+    inline double elementHeight() const { return m_height; }
+    void setElementHeight(double a);
+    inline bool hasElementHeight() const { return m_children & Height; }
+    void clearElementHeight();
+
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    // child element data
+    uint m_children;
+    double m_x;
+    double m_y;
+    double m_width;
+    double m_height;
+    enum Child {
+        X = 1,
+        Y = 2,
+        Width = 4,
+        Height = 8
+    };
+
+    DomRectF(const DomRectF &other);
+    void operator = (const DomRectF&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomSizeF {
+public:
+    DomSizeF();
+    ~DomSizeF();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    // child element accessors
+    inline double elementWidth() const { return m_width; }
+    void setElementWidth(double a);
+    inline bool hasElementWidth() const { return m_children & Width; }
+    void clearElementWidth();
+
+    inline double elementHeight() const { return m_height; }
+    void setElementHeight(double a);
+    inline bool hasElementHeight() const { return m_children & Height; }
+    void clearElementHeight();
+
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    // child element data
+    uint m_children;
+    double m_width;
+    double m_height;
+    enum Child {
+        Width = 1,
+        Height = 2
+    };
+
+    DomSizeF(const DomSizeF &other);
+    void operator = (const DomSizeF&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomChar {
+public:
+    DomChar();
+    ~DomChar();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    // child element accessors
+    inline int elementUnicode() const { return m_unicode; }
+    void setElementUnicode(int a);
+    inline bool hasElementUnicode() const { return m_children & Unicode; }
+    void clearElementUnicode();
+
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    // child element data
+    uint m_children;
+    int m_unicode;
+    enum Child {
+        Unicode = 1
+    };
+
+    DomChar(const DomChar &other);
+    void operator = (const DomChar&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomUrl {
+public:
+    DomUrl();
+    ~DomUrl();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    // child element accessors
+    inline DomString* elementString() const { return m_string; }
+    void setElementString(DomString* a);
+    inline bool hasElementString() const { return m_children & String; }
+    void clearElementString();
+
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    // child element data
+    uint m_children;
+    DomString* m_string;
+    enum Child {
+        String = 1
+    };
+
+    DomUrl(const DomUrl &other);
+    void operator = (const DomUrl&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomProperty {
+public:
+    DomProperty();
+    ~DomProperty();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    inline bool hasAttributeName() const { return m_has_attr_name; }
+    inline QString attributeName() const { return m_attr_name; }
+    inline void setAttributeName(const QString& a) { m_attr_name = a; m_has_attr_name = true; }
+    inline void clearAttributeName() { m_has_attr_name = false; }
+
+    inline bool hasAttributeStdset() const { return m_has_attr_stdset; }
+    inline int attributeStdset() const { return m_attr_stdset; }
+    inline void setAttributeStdset(int a) { m_attr_stdset = a; m_has_attr_stdset = true; }
+    inline void clearAttributeStdset() { m_has_attr_stdset = false; }
+
+    // child element accessors
+    enum Kind { Unknown = 0, Bool, Color, Cstring, Cursor, CursorShape, Enum, Font, IconSet, Pixmap, Palette, Point, Rect, Set, Locale, SizePolicy, Size, String, StringList, Number, Float, Double, Date, Time, DateTime, PointF, RectF, SizeF, LongLong, Char, Url, UInt, ULongLong, Brush };
+    inline Kind kind() const { return m_kind; }
+
+    inline QString elementBool() const { return m_bool; }
+    void setElementBool(const QString& a);
+
+    inline DomColor* elementColor() const { return m_color; }
+    void setElementColor(DomColor* a);
+
+    inline QString elementCstring() const { return m_cstring; }
+    void setElementCstring(const QString& a);
+
+    inline int elementCursor() const { return m_cursor; }
+    void setElementCursor(int a);
+
+    inline QString elementCursorShape() const { return m_cursorShape; }
+    void setElementCursorShape(const QString& a);
+
+    inline QString elementEnum() const { return m_enum; }
+    void setElementEnum(const QString& a);
+
+    inline DomFont* elementFont() const { return m_font; }
+    void setElementFont(DomFont* a);
+
+    inline DomResourceIcon* elementIconSet() const { return m_iconSet; }
+    void setElementIconSet(DomResourceIcon* a);
+
+    inline DomResourcePixmap* elementPixmap() const { return m_pixmap; }
+    void setElementPixmap(DomResourcePixmap* a);
+
+    inline DomPalette* elementPalette() const { return m_palette; }
+    void setElementPalette(DomPalette* a);
+
+    inline DomPoint* elementPoint() const { return m_point; }
+    void setElementPoint(DomPoint* a);
+
+    inline DomRect* elementRect() const { return m_rect; }
+    void setElementRect(DomRect* a);
+
+    inline QString elementSet() const { return m_set; }
+    void setElementSet(const QString& a);
+
+    inline DomLocale* elementLocale() const { return m_locale; }
+    void setElementLocale(DomLocale* a);
+
+    inline DomSizePolicy* elementSizePolicy() const { return m_sizePolicy; }
+    void setElementSizePolicy(DomSizePolicy* a);
+
+    inline DomSize* elementSize() const { return m_size; }
+    void setElementSize(DomSize* a);
+
+    inline DomString* elementString() const { return m_string; }
+    void setElementString(DomString* a);
+
+    inline DomStringList* elementStringList() const { return m_stringList; }
+    void setElementStringList(DomStringList* a);
+
+    inline int elementNumber() const { return m_number; }
+    void setElementNumber(int a);
+
+    inline float elementFloat() const { return m_float; }
+    void setElementFloat(float a);
+
+    inline double elementDouble() const { return m_double; }
+    void setElementDouble(double a);
+
+    inline DomDate* elementDate() const { return m_date; }
+    void setElementDate(DomDate* a);
+
+    inline DomTime* elementTime() const { return m_time; }
+    void setElementTime(DomTime* a);
+
+    inline DomDateTime* elementDateTime() const { return m_dateTime; }
+    void setElementDateTime(DomDateTime* a);
+
+    inline DomPointF* elementPointF() const { return m_pointF; }
+    void setElementPointF(DomPointF* a);
+
+    inline DomRectF* elementRectF() const { return m_rectF; }
+    void setElementRectF(DomRectF* a);
+
+    inline DomSizeF* elementSizeF() const { return m_sizeF; }
+    void setElementSizeF(DomSizeF* a);
+
+    inline qlonglong elementLongLong() const { return m_longLong; }
+    void setElementLongLong(qlonglong a);
+
+    inline DomChar* elementChar() const { return m_char; }
+    void setElementChar(DomChar* a);
+
+    inline DomUrl* elementUrl() const { return m_url; }
+    void setElementUrl(DomUrl* a);
+
+    inline uint elementUInt() const { return m_uInt; }
+    void setElementUInt(uint a);
+
+    inline qulonglong elementULongLong() const { return m_uLongLong; }
+    void setElementULongLong(qulonglong a);
+
+    inline DomBrush* elementBrush() const { return m_brush; }
+    void setElementBrush(DomBrush* a);
+
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    QString m_attr_name;
+    bool m_has_attr_name;
+
+    int m_attr_stdset;
+    bool m_has_attr_stdset;
+
+    // child element data
+    Kind m_kind;
+    QString m_bool;
+    DomColor* m_color;
+    QString m_cstring;
+    int m_cursor;
+    QString m_cursorShape;
+    QString m_enum;
+    DomFont* m_font;
+    DomResourceIcon* m_iconSet;
+    DomResourcePixmap* m_pixmap;
+    DomPalette* m_palette;
+    DomPoint* m_point;
+    DomRect* m_rect;
+    QString m_set;
+    DomLocale* m_locale;
+    DomSizePolicy* m_sizePolicy;
+    DomSize* m_size;
+    DomString* m_string;
+    DomStringList* m_stringList;
+    int m_number;
+    float m_float;
+    double m_double;
+    DomDate* m_date;
+    DomTime* m_time;
+    DomDateTime* m_dateTime;
+    DomPointF* m_pointF;
+    DomRectF* m_rectF;
+    DomSizeF* m_sizeF;
+    qlonglong m_longLong;
+    DomChar* m_char;
+    DomUrl* m_url;
+    uint m_uInt;
+    qulonglong m_uLongLong;
+    DomBrush* m_brush;
+
+    DomProperty(const DomProperty &other);
+    void operator = (const DomProperty&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomConnections {
+public:
+    DomConnections();
+    ~DomConnections();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    // child element accessors
+    inline QList<DomConnection*> elementConnection() const { return m_connection; }
+    void setElementConnection(const QList<DomConnection*>& a);
+
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    // child element data
+    QList<DomConnection*> m_connection;
+
+    DomConnections(const DomConnections &other);
+    void operator = (const DomConnections&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomConnection {
+public:
+    DomConnection();
+    ~DomConnection();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    // child element accessors
+    inline QString elementSender() const { return m_sender; }
+    void setElementSender(const QString& a);
+    inline bool hasElementSender() const { return m_children & Sender; }
+    void clearElementSender();
+
+    inline QString elementSignal() const { return m_signal; }
+    void setElementSignal(const QString& a);
+    inline bool hasElementSignal() const { return m_children & Signal; }
+    void clearElementSignal();
+
+    inline QString elementReceiver() const { return m_receiver; }
+    void setElementReceiver(const QString& a);
+    inline bool hasElementReceiver() const { return m_children & Receiver; }
+    void clearElementReceiver();
+
+    inline QString elementSlot() const { return m_slot; }
+    void setElementSlot(const QString& a);
+    inline bool hasElementSlot() const { return m_children & Slot; }
+    void clearElementSlot();
+
+    inline DomConnectionHints* elementHints() const { return m_hints; }
+    void setElementHints(DomConnectionHints* a);
+    inline bool hasElementHints() const { return m_children & Hints; }
+    void clearElementHints();
+
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    // child element data
+    uint m_children;
+    QString m_sender;
+    QString m_signal;
+    QString m_receiver;
+    QString m_slot;
+    DomConnectionHints* m_hints;
+    enum Child {
+        Sender = 1,
+        Signal = 2,
+        Receiver = 4,
+        Slot = 8,
+        Hints = 16
+    };
+
+    DomConnection(const DomConnection &other);
+    void operator = (const DomConnection&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomConnectionHints {
+public:
+    DomConnectionHints();
+    ~DomConnectionHints();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    // child element accessors
+    inline QList<DomConnectionHint*> elementHint() const { return m_hint; }
+    void setElementHint(const QList<DomConnectionHint*>& a);
+
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    // child element data
+    QList<DomConnectionHint*> m_hint;
+
+    DomConnectionHints(const DomConnectionHints &other);
+    void operator = (const DomConnectionHints&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomConnectionHint {
+public:
+    DomConnectionHint();
+    ~DomConnectionHint();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    inline bool hasAttributeType() const { return m_has_attr_type; }
+    inline QString attributeType() const { return m_attr_type; }
+    inline void setAttributeType(const QString& a) { m_attr_type = a; m_has_attr_type = true; }
+    inline void clearAttributeType() { m_has_attr_type = false; }
+
+    // child element accessors
+    inline int elementX() const { return m_x; }
+    void setElementX(int a);
+    inline bool hasElementX() const { return m_children & X; }
+    void clearElementX();
+
+    inline int elementY() const { return m_y; }
+    void setElementY(int a);
+    inline bool hasElementY() const { return m_children & Y; }
+    void clearElementY();
+
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    QString m_attr_type;
+    bool m_has_attr_type;
+
+    // child element data
+    uint m_children;
+    int m_x;
+    int m_y;
+    enum Child {
+        X = 1,
+        Y = 2
+    };
+
+    DomConnectionHint(const DomConnectionHint &other);
+    void operator = (const DomConnectionHint&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomScript {
+public:
+    DomScript();
+    ~DomScript();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    inline bool hasAttributeSource() const { return m_has_attr_source; }
+    inline QString attributeSource() const { return m_attr_source; }
+    inline void setAttributeSource(const QString& a) { m_attr_source = a; m_has_attr_source = true; }
+    inline void clearAttributeSource() { m_has_attr_source = false; }
+
+    inline bool hasAttributeLanguage() const { return m_has_attr_language; }
+    inline QString attributeLanguage() const { return m_attr_language; }
+    inline void setAttributeLanguage(const QString& a) { m_attr_language = a; m_has_attr_language = true; }
+    inline void clearAttributeLanguage() { m_has_attr_language = false; }
+
+    // child element accessors
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    QString m_attr_source;
+    bool m_has_attr_source;
+
+    QString m_attr_language;
+    bool m_has_attr_language;
+
+    // child element data
+
+    DomScript(const DomScript &other);
+    void operator = (const DomScript&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomWidgetData {
+public:
+    DomWidgetData();
+    ~DomWidgetData();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    // child element accessors
+    inline QList<DomProperty*> elementProperty() const { return m_property; }
+    void setElementProperty(const QList<DomProperty*>& a);
+
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    // child element data
+    QList<DomProperty*> m_property;
+
+    DomWidgetData(const DomWidgetData &other);
+    void operator = (const DomWidgetData&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomDesignerData {
+public:
+    DomDesignerData();
+    ~DomDesignerData();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    // child element accessors
+    inline QList<DomProperty*> elementProperty() const { return m_property; }
+    void setElementProperty(const QList<DomProperty*>& a);
+
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    // child element data
+    QList<DomProperty*> m_property;
+
+    DomDesignerData(const DomDesignerData &other);
+    void operator = (const DomDesignerData&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomSlots {
+public:
+    DomSlots();
+    ~DomSlots();
+
+    void read(const QDomElement &node);
+    QDomElement write(QDomDocument &doc, const QString &tagName = QString()) const;
+    inline QString text() const { return m_text; }
+    inline void setText(const QString &s) { m_text = s; }
+
+    // attribute accessors
+    // child element accessors
+    inline QStringList elementSlot() const { return m_slot; }
+    void setElementSlot(const QStringList& a);
+
+    inline QStringList elementSignal() const { return m_signal; }
+    void setElementSignal(const QStringList& a);
+
+private:
+    QString m_text;
+    void clear(bool clear_all = true);
+
+    // attribute data
+    // child element data
+    QStringList m_slot;
+    QStringList m_signal;
+
+    DomSlots(const DomSlots &other);
+    void operator = (const DomSlots&other);
+};
+
+
+#ifdef QFORMINTERNAL_NAMESPACE
+}
+#endif
+
+QT_END_NAMESPACE
+
+#endif // UI4_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/duic/uic.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,336 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+** exception, Nokia gives you certain additional rights. These rights
+** are described in the Nokia Qt GPL Exception version 1.3, included in
+** the file GPL_EXCEPTION.txt in this package.
+**
+** Qt for Windows(R) Licensees
+** As a special exception, Nokia, as the sole copyright holder for Qt
+** Designer, grants users of the Qt/Eclipse Integration plug-in the
+** right for the Qt/Eclipse Integration to link to functionality
+** provided by Qt Designer and its related libraries.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+****************************************************************************/
+
+#include "uic.h"
+#include "ui4.h"
+#include "driver.h"
+#include "option.h"
+#include "treewalker.h"
+#include "validator.h"
+
+#ifdef QT_UIC_D_GENERATOR
+#include "dwriteincludes.h"
+#include "dwritedeclaration.h"
+#endif
+
+#ifdef QT_UIC_JAVA_GENERATOR
+#include "javawriteincludes.h"
+#include "javawritedeclaration.h"
+#endif
+
+#include <QtXml/QDomDocument>
+#include <QtCore/QFileInfo>
+#include <QtCore/QRegExp>
+#include <QtCore/QTextStream>
+#include <QtCore/QDateTime>
+
+#if defined Q_WS_WIN
+#include <qt_windows.h>
+#endif
+
+QT_BEGIN_NAMESPACE
+
+Uic::Uic(Driver *d)
+     : drv(d),
+       out(d->output()),
+       opt(d->option()),
+       info(d),
+       externalPix(true)
+{
+}
+
+Uic::~Uic()
+{
+}
+
+bool Uic::printDependencies()
+{
+    QString fileName = opt.inputFile;
+
+    QFile f;
+    if (fileName.isEmpty())
+        f.open(stdin, QIODevice::ReadOnly);
+    else {
+        f.setFileName(fileName);
+        if (!f.open(QIODevice::ReadOnly))
+            return false;
+    }
+
+    QDomDocument doc;                        // ### generalize. share more code with the other tools!
+    if (!doc.setContent(&f))
+        return false;
+
+    QDomElement root = doc.firstChildElement();
+    DomUI *ui = new DomUI();
+    ui->read(root);
+
+    double version = ui->attributeVersion().toDouble();
+    if (version < 4.0) {
+        delete ui;
+
+        fprintf(stderr, "uic: File generated with too old version of Qt Designer\n");
+        return false;
+    }
+
+    if (DomIncludes *includes = ui->elementIncludes()) {
+        foreach (DomInclude *incl, includes->elementInclude()) {
+            QString file = incl->text();
+            if (file.isEmpty())
+                continue;
+
+            fprintf(stdout, "%s\n", file.toLocal8Bit().constData());
+        }
+    }
+
+    if (DomCustomWidgets *customWidgets = ui->elementCustomWidgets()) {
+        foreach (DomCustomWidget *customWidget, customWidgets->elementCustomWidget()) {
+            if (DomHeader *header = customWidget->elementHeader()) {
+                QString file = header->text();
+                if (file.isEmpty())
+                    continue;
+
+                fprintf(stdout, "%s\n", file.toLocal8Bit().constData());
+            }
+        }
+    }
+
+    delete ui;
+
+    return true;
+}
+
+void Uic::writeCopyrightHeader(DomUI *ui)
+{
+    QString comment = ui->elementComment();
+    if (comment.size())
+        out << "/*\n" << comment << "\n*/\n\n";
+
+        out << "/********************************************************************************\n";
+        out << "** Form generated from reading ui file '" << QFileInfo(opt.inputFile).fileName() << "'\n";
+        out << "**\n";
+        out << "** Created: " << QDateTime::currentDateTime().toString() << "\n";
+        out << "**      " << QString::fromLatin1("by: QtD User Interface Compiler version %1\n").arg(QLatin1String(QT_VERSION_STR));
+        out << "**\n";
+        out << "** WARNING! All changes made in this file will be lost when recompiling ui file!\n";
+        out << "********************************************************************************/\n\n";
+}
+
+bool Uic::write(QIODevice *in)
+{
+    QDomDocument doc;
+    if (!doc.setContent(in))
+        return false;
+
+    if (option().generator == Option::JavaGenerator || option().generator == Option::DGenerator) {
+         // the Java generator ignores header protection
+        opt.headerProtection = false;
+    }
+
+    QDomElement root = doc.firstChildElement();
+    DomUI *ui = new DomUI();
+    ui->read(root);
+
+    double version = ui->attributeVersion().toDouble();
+    if (version < 4.0) {
+        delete ui;
+
+        fprintf(stderr, "uic: File generated with too old version of Qt Designer\n");
+        return false;
+    }
+
+    QString language = ui->attributeLanguage();
+
+
+    bool rtn = false;
+
+    if (option().generator == Option::JavaGenerator) {
+#ifdef QT_UIC_JAVA_GENERATOR
+        if (language.toLower() != QLatin1String("jambi")) {
+            fprintf(stderr, "uic: File is not a 'jambi' form\n");
+            return false;
+        }
+        rtn = jwrite (ui);
+#else
+        fprintf(stderr, "uic: option to generate java code not compiled in\n");
+#endif
+    } else {
+#ifdef QT_UIC_D_GENERATOR
+        if (!language.isEmpty() && language.toLower() != QLatin1String("d")) {
+            fprintf(stderr, "uic: File is not a 'd' ui file, language=%s\n", qPrintable(language));
+            return false;
+        }
+
+        rtn = write (ui);
+#else
+        fprintf(stderr, "uic: option to generate d code not compiled in\n");
+#endif
+    }
+
+    delete ui;
+
+    return rtn;
+}
+
+#ifdef QT_UIC_D_GENERATOR
+bool Uic::write(DomUI *ui)
+{
+    using namespace D;
+
+    if (!ui || !ui->elementWidget())
+        return false;
+
+    if (opt.copyrightHeader)
+        writeCopyrightHeader(ui);
+
+    if (opt.headerProtection) {
+        writeHeaderProtectionStart();
+        out << "\n";
+    }
+
+    pixFunction = ui->elementPixmapFunction();
+    if (pixFunction == QLatin1String("QPixmap::fromMimeSource"))
+        pixFunction = QLatin1String("qPixmapFromMimeSource");
+
+    externalPix = ui->elementImages() == 0;
+
+    info.acceptUI(ui);
+    cWidgetsInfo.acceptUI(ui);
+    WriteIncludes writeIncludes(this);
+    writeIncludes.acceptUI(ui);
+
+    Validator(this).acceptUI(ui);
+    WriteDeclaration(this, writeIncludes.scriptsActivated()).acceptUI(ui);
+
+    if (opt.headerProtection)
+        writeHeaderProtectionEnd();
+
+    return true;
+}
+#endif
+
+#ifdef QT_UIC_JAVA_GENERATOR
+bool Uic::jwrite(DomUI *ui)
+{
+    using namespace Java;
+
+    if (!ui || !ui->elementWidget())
+        return false;
+
+    if (opt.copyrightHeader)
+        writeCopyrightHeader(ui);
+
+    pixFunction = ui->elementPixmapFunction();
+    if (pixFunction == QLatin1String("QPixmap::fromMimeSource"))
+        pixFunction = QLatin1String("qPixmapFromMimeSource");
+
+    externalPix = ui->elementImages() == 0;
+
+    info.acceptUI(ui);
+    cWidgetsInfo.acceptUI(ui);
+    WriteIncludes(this).acceptUI(ui);
+
+    Validator(this).acceptUI(ui);
+    WriteDeclaration(this).acceptUI(ui);
+
+    return true;
+}
+#endif
+
+#ifdef QT_UIC_D_GENERATOR
+
+void Uic::writeHeaderProtectionStart()
+{
+    QString h = drv->headerFileName();
+    out << "#ifndef " << h << "\n"
+        << "#define " << h << "\n";
+}
+
+void Uic::writeHeaderProtectionEnd()
+{
+    QString h = drv->headerFileName();
+    out << "#endif // " << h << "\n";
+}
+#endif
+
+bool Uic::isMainWindow(const QString &className) const
+{
+    return customWidgetsInfo()->extends(className, QLatin1String("Q3MainWindow"))
+        || customWidgetsInfo()->extends(className, QLatin1String("QMainWindow"));
+}
+
+bool Uic::isToolBar(const QString &className) const
+{
+    return customWidgetsInfo()->extends(className, QLatin1String("Q3ToolBar"))
+        || customWidgetsInfo()->extends(className, QLatin1String("QToolBar"));
+}
+
+bool Uic::isButton(const QString &className) const
+{
+    return customWidgetsInfo()->extends(className, QLatin1String("QRadioButton"))
+        || customWidgetsInfo()->extends(className, QLatin1String("QToolButton"))
+        || customWidgetsInfo()->extends(className, QLatin1String("QCheckBox"))
+        || customWidgetsInfo()->extends(className, QLatin1String("QPushButton"));
+}
+
+bool Uic::isContainer(const QString &className) const
+{
+    return customWidgetsInfo()->extends(className, QLatin1String("QStackedWidget"))
+        || customWidgetsInfo()->extends(className, QLatin1String("QToolBox"))
+        || customWidgetsInfo()->extends(className, QLatin1String("QTabWidget"))
+        || customWidgetsInfo()->extends(className, QLatin1String("QScrollArea"))
+        || customWidgetsInfo()->extends(className, QLatin1String("QMdiArea"))
+        || customWidgetsInfo()->extends(className, QLatin1String("QWizard"))
+        || customWidgetsInfo()->extends(className, QLatin1String("QDockWidget"));
+}
+
+bool Uic::isStatusBar(const QString &className) const
+{
+    return customWidgetsInfo()->extends(className, QLatin1String("QStatusBar"));
+}
+
+bool Uic::isMenuBar(const QString &className) const
+{
+    return customWidgetsInfo()->extends(className, QLatin1String("QMenuBar"));
+}
+
+bool Uic::isMenu(const QString &className) const
+{
+    return customWidgetsInfo()->extends(className, QLatin1String("QMenu"))
+        || customWidgetsInfo()->extends(className, QLatin1String("QPopupMenu"));
+}
+
+QT_END_NAMESPACE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/duic/uic.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,138 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+** exception, Nokia gives you certain additional rights. These rights
+** are described in the Nokia Qt GPL Exception version 1.3, included in
+** the file GPL_EXCEPTION.txt in this package.
+**
+** Qt for Windows(R) Licensees
+** As a special exception, Nokia, as the sole copyright holder for Qt
+** Designer, grants users of the Qt/Eclipse Integration plug-in the
+** right for the Qt/Eclipse Integration to link to functionality
+** provided by Qt Designer and its related libraries.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+****************************************************************************/
+
+#ifndef UIC_H
+#define UIC_H
+
+#include "databaseinfo.h"
+#include "customwidgetsinfo.h"
+#include <QtCore/QString>
+#include <QtCore/QStringList>
+#include <QtCore/QHash>
+#include <QtCore/QStack>
+
+QT_BEGIN_NAMESPACE
+
+class QTextStream;
+class QIODevice;
+
+class Driver;
+class DomUI;
+class DomWidget;
+class DomSpacer;
+class DomLayout;
+class DomLayoutItem;
+class DomItem;
+
+struct Option;
+
+class Uic
+{
+public:
+    Uic(Driver *driver);
+    ~Uic();
+
+    bool printDependencies();
+
+    inline Driver *driver() const
+    { return drv; }
+
+    inline QTextStream &output()
+    { return out; }
+
+    inline const Option &option() const
+    { return opt; }
+
+    inline QString pixmapFunction() const
+    { return pixFunction; }
+
+    inline void setPixmapFunction(const QString &f)
+    { pixFunction = f; }
+
+    inline bool hasExternalPixmap() const
+    { return externalPix; }
+
+    inline void setExternalPixmap(bool b)
+    { externalPix = b; }
+
+    inline const DatabaseInfo *databaseInfo() const
+    { return &info; }
+
+    inline const CustomWidgetsInfo *customWidgetsInfo() const
+    { return &cWidgetsInfo; }
+
+    bool write(QIODevice *in);
+
+#ifdef QT_UIC_JAVA_GENERATOR
+    bool jwrite(DomUI *ui);
+#endif
+
+#ifdef QT_UIC_D_GENERATOR
+    bool write(DomUI *ui);
+#endif
+
+    bool isMainWindow(const QString &className) const;
+    bool isToolBar(const QString &className) const;
+    bool isStatusBar(const QString &className) const;
+    bool isButton(const QString &className) const;
+    bool isContainer(const QString &className) const;
+    bool isMenuBar(const QString &className) const;
+    bool isMenu(const QString &className) const;
+
+private:
+    // copyright header
+    void writeCopyrightHeader(DomUI *ui);
+
+#ifdef QT_UIC_D_GENERATOR
+    // header protection
+    void writeHeaderProtectionStart();
+    void writeHeaderProtectionEnd();
+#endif
+
+private:
+    Driver *drv;
+    QTextStream &out;
+    Option &opt;
+    DatabaseInfo info;
+    CustomWidgetsInfo cWidgetsInfo;
+    QString pixFunction;
+    bool externalPix;
+};
+
+QT_END_NAMESPACE
+
+#endif // UIC_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/duic/utils.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,124 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+** exception, Nokia gives you certain additional rights. These rights
+** are described in the Nokia Qt GPL Exception version 1.3, included in
+** the file GPL_EXCEPTION.txt in this package.
+**
+** Qt for Windows(R) Licensees
+** As a special exception, Nokia, as the sole copyright holder for Qt
+** Designer, grants users of the Qt/Eclipse Integration plug-in the
+** right for the Qt/Eclipse Integration to link to functionality
+** provided by Qt Designer and its related libraries.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+****************************************************************************/
+
+#ifndef UTILS_H
+#define UTILS_H
+
+#include "ui4.h"
+#include <QtCore/QString>
+#include <QtCore/QList>
+#include <QtCore/QHash>
+
+QT_BEGIN_NAMESPACE
+
+inline bool toBool(const QString &str)
+{ return str.toLower() == QLatin1String("true"); }
+
+inline QString toString(const DomString *str)
+{ return str ? str->text() : QString(); }
+
+inline QString fixString(const QString &str, const QString &indent)
+{
+    QString cursegment;
+    QStringList result;
+    const QByteArray utf8 = str.toUtf8();
+    const int utf8Length = utf8.length();
+
+    for (int i = 0; i < utf8Length; ++i) {
+        const uchar cbyte = utf8.at(i);
+        if (cbyte >= 0x80) {
+            cursegment += QLatin1Char('\\');
+            cursegment += QString::number(cbyte, 8);
+        } else {
+            switch(cbyte) {
+            case '\\':
+                cursegment += QLatin1String("\\\\"); break;
+            case '\"':
+                cursegment += QLatin1String("\\\""); break;
+            case '\r':
+                break;
+            case '\n':
+                cursegment += QLatin1String("\\n\"\n\""); break;
+            default:
+                cursegment += QLatin1Char(cbyte);
+            }
+        }
+
+        if (cursegment.length() > 1024) {
+            result << cursegment;
+            cursegment.clear();
+        }
+    }
+
+    if (!cursegment.isEmpty())
+        result << cursegment;
+
+
+    QString joinstr = QLatin1String("\"\n");
+    joinstr += indent;
+    joinstr += indent;
+    joinstr += QLatin1Char('"');
+
+    QString rc(QLatin1Char('"'));
+    rc += result.join(joinstr);
+    rc += QLatin1Char('"');
+    return rc;
+}
+
+inline QHash<QString, DomProperty *> propertyMap(const QList<DomProperty *> &properties)
+{
+    QHash<QString, DomProperty *> map;
+
+    for (int i=0; i<properties.size(); ++i) {
+        DomProperty *p = properties.at(i);
+        map.insert(p->attributeName(), p);
+    }
+
+    return map;
+}
+
+inline QStringList unique(const QStringList &lst)
+{
+    QHash<QString, bool> h;
+    for (int i=0; i<lst.size(); ++i)
+        h.insert(lst.at(i), true);
+    return h.keys();
+}
+
+QT_END_NAMESPACE
+
+#endif // UTILS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/duic/validator.cpp	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,90 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+** exception, Nokia gives you certain additional rights. These rights
+** are described in the Nokia Qt GPL Exception version 1.3, included in
+** the file GPL_EXCEPTION.txt in this package.
+**
+** Qt for Windows(R) Licensees
+** As a special exception, Nokia, as the sole copyright holder for Qt
+** Designer, grants users of the Qt/Eclipse Integration plug-in the
+** right for the Qt/Eclipse Integration to link to functionality
+** provided by Qt Designer and its related libraries.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+****************************************************************************/
+
+#include "validator.h"
+#include "driver.h"
+#include "ui4.h"
+#include "uic.h"
+
+QT_BEGIN_NAMESPACE
+
+Validator::Validator(Uic *uic)   :
+    m_driver(uic->driver())
+{
+}
+
+void Validator::acceptUI(DomUI *node)
+{
+    TreeWalker::acceptUI(node);
+}
+
+void Validator::acceptWidget(DomWidget *node)
+{
+    (void) m_driver->findOrInsertWidget(node);
+
+    TreeWalker::acceptWidget(node);
+}
+
+void Validator::acceptLayoutItem(DomLayoutItem *node)
+{
+    (void) m_driver->findOrInsertLayoutItem(node);
+
+    TreeWalker::acceptLayoutItem(node);
+}
+
+void Validator::acceptLayout(DomLayout *node)
+{
+    (void) m_driver->findOrInsertLayout(node);
+
+    TreeWalker::acceptLayout(node);
+}
+
+void Validator::acceptActionGroup(DomActionGroup *node)
+{
+    (void) m_driver->findOrInsertActionGroup(node);
+
+    TreeWalker::acceptActionGroup(node);
+}
+
+void Validator::acceptAction(DomAction *node)
+{
+    (void) m_driver->findOrInsertAction(node);
+
+    TreeWalker::acceptAction(node);
+}
+
+QT_END_NAMESPACE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/duic/validator.h	Mon May 11 16:01:50 2009 +0000
@@ -0,0 +1,70 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License versions 2.0 or 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 GNU General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
+** exception, Nokia gives you certain additional rights. These rights
+** are described in the Nokia Qt GPL Exception version 1.3, included in
+** the file GPL_EXCEPTION.txt in this package.
+**
+** Qt for Windows(R) Licensees
+** As a special exception, Nokia, as the sole copyright holder for Qt
+** Designer, grants users of the Qt/Eclipse Integration plug-in the
+** right for the Qt/Eclipse Integration to link to functionality
+** provided by Qt Designer and its related libraries.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+****************************************************************************/
+
+#ifndef VALIDATOR_H
+#define VALIDATOR_H
+
+#include "treewalker.h"
+
+QT_BEGIN_NAMESPACE
+
+class QTextStream;
+class Driver;
+class Uic;
+
+struct Option;
+
+struct Validator : public TreeWalker
+{
+    Validator(Uic *uic);
+
+    void acceptUI(DomUI *node);
+    void acceptWidget(DomWidget *node);
+
+    void acceptLayoutItem(DomLayoutItem *node);
+    void acceptLayout(DomLayout *node);
+
+    void acceptActionGroup(DomActionGroup *node);
+    void acceptAction(DomAction *node);
+
+private:
+    Driver *m_driver;
+};
+
+QT_END_NAMESPACE
+
+#endif // VALIDATOR_H